|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.logicblaze.lingo.jms.marshall.DefaultMarshaller
public class DefaultMarshaller
Represents the strategy of object marshalling of requests and responses in and out
of JMS messages. Collaborates with HeaderMarshaller
which captures the strategy
for JMS header marshalling.
Field Summary | |
---|---|
protected HeaderMarshaller |
headerMarshaller
|
protected HeaderMarshaller |
nativeHeaderMarshaller
|
Constructor Summary | |
---|---|
DefaultMarshaller()
|
Method Summary | |
---|---|
void |
addResponseMessageHeaders(javax.jms.ObjectMessage answer,
org.springframework.remoting.support.RemoteInvocationResult result,
javax.jms.Message requestMessage)
A strategy for derived classes to allow them to plug in custom header processing for responses |
void |
appendMessageHeaders(javax.jms.Message message,
Requestor requestor,
LingoInvocation invocation)
A strategy method for derived classes to allow them a plugin point to perform custom header processing. |
void |
appendMessageHeaders(javax.jms.Message message,
javax.jms.Session session,
Object value)
|
javax.jms.Message |
createObjectMessage(javax.jms.Session session,
Object value)
Creates a message for a Java Object for when distributing objects in collections |
javax.jms.Message |
createRequestMessage(Requestor requestor,
LingoInvocation invocation)
Creates the request message |
javax.jms.Message |
createResponseMessage(javax.jms.Session session,
org.springframework.remoting.support.RemoteInvocationResult result,
javax.jms.Message requestMessage)
Creates the response message |
org.springframework.remoting.support.RemoteInvocationResult |
extractInvocationResult(javax.jms.Message message)
Extracts the invocation result from the response message |
void |
handleInvocationHeaders(javax.jms.Message message)
A strategy method to allow derived classes to process the headers in a special way. |
void |
handleInvocationResultHeaders(javax.jms.Message message)
A strategy method to allow derived classes to process the headers in a special way |
void |
handleMessageHeaders(javax.jms.Message message)
A strategy method to allow derived classes to process the headers in a special way |
boolean |
isIgnoreInvalidMessages()
|
protected org.springframework.remoting.support.RemoteInvocationResult |
onInvalidClientMessage(javax.jms.Message message)
|
protected org.springframework.remoting.support.RemoteInvocation |
onInvalidMessage(javax.jms.Message message)
Handle invalid messages by just logging, though a different implementation may wish to throw exceptions |
Object |
readMessage(javax.jms.Message message)
Extracts the body from the given JMS message |
org.springframework.remoting.support.RemoteInvocation |
readRemoteInvocation(javax.jms.Message message)
Read a RemoteInvocation from the given JMS message |
void |
setHeaderMarshaller(HeaderMarshaller headerMarshaller)
|
void |
setIgnoreInvalidMessages(boolean ignoreInvalidMessages)
Sets whether invalidly formatted messages should be silently ignored or not |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected HeaderMarshaller nativeHeaderMarshaller
protected HeaderMarshaller headerMarshaller
Constructor Detail |
---|
public DefaultMarshaller()
Method Detail |
---|
public void setHeaderMarshaller(HeaderMarshaller headerMarshaller)
public javax.jms.Message createRequestMessage(Requestor requestor, LingoInvocation invocation) throws javax.jms.JMSException
Marshaller
createRequestMessage
in interface Marshaller
invocation
- the remote invocation to send
javax.jms.JMSException
- if the message could not be createdpublic javax.jms.Message createResponseMessage(javax.jms.Session session, org.springframework.remoting.support.RemoteInvocationResult result, javax.jms.Message requestMessage) throws javax.jms.JMSException
Marshaller
createResponseMessage
in interface Marshaller
session
- the JMS session to useresult
- the result invocationrequestMessage
- the original request message
javax.jms.JMSException
- if the message could not be createdpublic org.springframework.remoting.support.RemoteInvocationResult extractInvocationResult(javax.jms.Message message) throws javax.jms.JMSException
Marshaller
extractInvocationResult
in interface Marshaller
message
- the response message
javax.jms.JMSException
- is thrown if a JMS exception occurspublic org.springframework.remoting.support.RemoteInvocation readRemoteInvocation(javax.jms.Message message) throws javax.jms.JMSException
Marshaller
readRemoteInvocation
in interface Marshaller
message
- current JMS message
javax.jms.JMSException
public javax.jms.Message createObjectMessage(javax.jms.Session session, Object value) throws javax.jms.JMSException
Marshaller
createObjectMessage
in interface Marshaller
javax.jms.JMSException
public Object readMessage(javax.jms.Message message) throws javax.jms.JMSException
Marshaller
readMessage
in interface Marshaller
javax.jms.JMSException
public boolean isIgnoreInvalidMessages()
public void setIgnoreInvalidMessages(boolean ignoreInvalidMessages)
protected org.springframework.remoting.support.RemoteInvocationResult onInvalidClientMessage(javax.jms.Message message) throws javax.jms.JMSException
javax.jms.JMSException
protected org.springframework.remoting.support.RemoteInvocation onInvalidMessage(javax.jms.Message message)
public void appendMessageHeaders(javax.jms.Message message, Requestor requestor, LingoInvocation invocation) throws javax.jms.JMSException
HeaderMarshaller
appendMessageHeaders
in interface HeaderMarshaller
javax.jms.JMSException
public void appendMessageHeaders(javax.jms.Message message, javax.jms.Session session, Object value)
appendMessageHeaders
in interface HeaderMarshaller
public void addResponseMessageHeaders(javax.jms.ObjectMessage answer, org.springframework.remoting.support.RemoteInvocationResult result, javax.jms.Message requestMessage) throws javax.jms.JMSException
HeaderMarshaller
addResponseMessageHeaders
in interface HeaderMarshaller
javax.jms.JMSException
public void handleInvocationHeaders(javax.jms.Message message)
HeaderMarshaller
handleInvocationHeaders
in interface HeaderMarshaller
public final void handleInvocationResultHeaders(javax.jms.Message message)
HeaderMarshaller
handleInvocationResultHeaders
in interface HeaderMarshaller
public final void handleMessageHeaders(javax.jms.Message message)
HeaderMarshaller
handleMessageHeaders
in interface HeaderMarshaller
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |