java.lang.Object | ||||
↳ | org.springframework.remoting.support.RemotingSupport | |||
↳ | org.springframework.remoting.support.RemoteExporter | |||
↳ | org.springframework.remoting.support.RemoteInvocationBasedExporter | |||
↳ | org.springframework.jms.remoting.JmsInvokerServiceExporter |
JMS message listener that exports the specified service bean as a JMS service endpoint, accessible via a JMS invoker proxy.
Note that this class implements Spring's
SessionAwareMessageListener
interface, since it requires access to the active JMS Session.
Hence, this class can only be used with message listener containers
which support the SessionAwareMessageListener interface (e.g. Spring's
DefaultMessageListenerContainer
).
Thanks to James Strachan for the original prototype that this JMS invoker mechanism was inspired by!
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.remoting.support.RemotingSupport
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
| |||||||||||
Set whether invalidly formatted messages should be discarded.
| |||||||||||
Specify the MessageConverter to use for turning request messages into
RemoteInvocation objects,
as well as RemoteInvocationResult
objects into response messages. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create the invocation result response message.
| |||||||||||
Callback that is invoked by
readRemoteInvocation(Message)
when it encounters an invalid request message. | |||||||||||
Read a RemoteInvocation from the given JMS message.
| |||||||||||
Send the given RemoteInvocationResult as a JMS message to the originator.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.remoting.support.RemoteInvocationBasedExporter
| |||||||||||
From class
org.springframework.remoting.support.RemoteExporter
| |||||||||||
From class
org.springframework.remoting.support.RemotingSupport
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.factory.BeanClassLoaderAware
| |||||||||||
From interface
org.springframework.beans.factory.InitializingBean
| |||||||||||
From interface
org.springframework.jms.listener.SessionAwareMessageListener
|
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
JMSException |
---|
Set whether invalidly formatted messages should be discarded. Default is "true".
Switch this flag to "false" to throw an exception back to the listener container. This will typically lead to redelivery of the message, which is usually undesirable - since the message content will be the same (that is, still invalid).
Specify the MessageConverter to use for turning request messages into
RemoteInvocation
objects,
as well as RemoteInvocationResult
objects into response messages.
Default is a SimpleMessageConverter
,
using a standard JMS javax.jms.ObjectMessage for each invocation /
invocation result object.
Custom implementations may generally adapt Serializables into special kinds of messages, or might be specifically tailored for translating RemoteInvocation(Result)s into specific kinds of messages.
Create the invocation result response message.
The default implementation creates a JMS ObjectMessage for the given RemoteInvocationResult object. It sets the response's correlation id to the request message's correlation id, if any; otherwise to the request message id.
request | the original request message |
---|---|
session | the JMS session to use |
result | the invocation result |
if creating the messsage failed | |
JMSException |
Callback that is invoked by readRemoteInvocation(Message)
when it encounters an invalid request message.
The default implementation either discards the invalid message or throws a MessageFormatException - according to the "ignoreInvalidRequests" flag, which is set to "true" (that is, discard invalid messages) by default.
requestMessage | the invalid request message |
---|
null
in case of an invalid message that will simply be ignored)in case of the invalid request supposed to lead to an exception (instead of ignoring it) | |
JMSException |
Read a RemoteInvocation from the given JMS message.
requestMessage | current request message |
---|
null
in case of an invalid message that will simply be ignored)in case of message access failure | |
JMSException |
Send the given RemoteInvocationResult as a JMS message to the originator.
requestMessage | current request message |
---|---|
session | the JMS Session to use |
result | the RemoteInvocationResult object |
if thrown by trying to send the message | |
JMSException |