spring-framework / org.springframework.jms.remoting / JmsInvokerClientInterceptor

JmsInvokerClientInterceptor

open class JmsInvokerClientInterceptor : MethodInterceptor, InitializingBean

org.aopalliance.intercept.MethodInterceptor for accessing a JMS-based remote service.

Serializes remote invocation objects and deserializes remote invocation result objects. Uses Java serialization just like RMI, but with the JMS provider as communication infrastructure.

To be configured with a javax.jms.QueueConnectionFactory and a target queue (either as javax.jms.Queue reference or as queue name).

Thanks to James Strachan for the original prototype that this JMS invoker mechanism was inspired by!

Author
Juergen Hoeller

Author
James Strachan

Author
Stephane Nicoll

Since
2.0

See Also
#setConnectionFactory#setQueue#setQueueNameorg.springframework.jms.remoting.JmsInvokerServiceExporterorg.springframework.jms.remoting.JmsInvokerProxyFactoryBean

Constructors

<init>

JmsInvokerClientInterceptor()

org.aopalliance.intercept.MethodInterceptor for accessing a JMS-based remote service.

Serializes remote invocation objects and deserializes remote invocation result objects. Uses Java serialization just like RMI, but with the JMS provider as communication infrastructure.

To be configured with a javax.jms.QueueConnectionFactory and a target queue (either as javax.jms.Queue reference or as queue name).

Thanks to James Strachan for the original prototype that this JMS invoker mechanism was inspired by!

Functions

afterPropertiesSet

open fun afterPropertiesSet(): Unit

invoke

open fun invoke(methodInvocation: MethodInvocation): Any

setConnectionFactory

open fun setConnectionFactory(connectionFactory: ConnectionFactory): Unit

Set the QueueConnectionFactory to use for obtaining JMS QueueConnections.

setDestinationResolver

open fun setDestinationResolver(destinationResolver: DestinationResolver): Unit

Set the DestinationResolver that is to be used to resolve Queue references for this accessor.

The default resolver is a DynamicDestinationResolver. Specify a JndiDestinationResolver for resolving destination names as JNDI locations.

setMessageConverter

open fun setMessageConverter(messageConverter: MessageConverter): Unit

Specify the MessageConverter to use for turning org.springframework.remoting.support.RemoteInvocation objects into request messages, as well as response messages into org.springframework.remoting.support.RemoteInvocationResult objects.

Default is a SimpleMessageConverter, using a standard JMS javax.jms.ObjectMessage for each invocation / invocation result object.

Custom implementations may generally adapt java.io.Serializable objects into special kinds of messages, or might be specifically tailored for translating RemoteInvocation(Result)s into specific kinds of messages.

setQueue

open fun setQueue(queue: Queue): Unit

Set the target Queue to send invoker requests to.

setQueueName

open fun setQueueName(queueName: String): Unit

Set the name of target queue to send invoker requests to.

The specified name will be dynamically resolved via the DestinationResolver.

setReceiveTimeout

open fun setReceiveTimeout(receiveTimeout: Long): Unit

Set the timeout to use for receiving the response message for a request (in milliseconds).

The default is 0, which indicates a blocking receive without timeout.

setRemoteInvocationFactory

open fun setRemoteInvocationFactory(remoteInvocationFactory: RemoteInvocationFactory): Unit

Set the RemoteInvocationFactory to use for this accessor.

Default is a DefaultRemoteInvocationFactory.

A custom invocation factory can add further context information to the invocation, for example user credentials.

Inheritors

JmsInvokerProxyFactoryBean

open class JmsInvokerProxyFactoryBean : JmsInvokerClientInterceptor, FactoryBean<Any>, BeanClassLoaderAware

FactoryBean for JMS invoker proxies. Exposes the proxied service for use as a bean reference, using the specified service interface.

Serializes remote invocation objects and deserializes remote invocation result objects. Uses Java serialization just like RMI, but with the JMS provider as communication infrastructure.

To be configured with a javax.jms.QueueConnectionFactory and a target queue (either as javax.jms.Queue reference or as queue name).