public class AmqpClientInterceptor
extends org.springframework.remoting.support.RemoteAccessor
implements org.aopalliance.intercept.MethodInterceptor
MethodInterceptor
for accessing RMI-style AMQP services.AmqpInvokerServiceExporter
,
AmqpProxyFactoryBean
,
RemoteAccessException
Constructor and Description |
---|
AmqpClientInterceptor() |
Modifier and Type | Method and Description |
---|---|
AmqpTemplate |
getAmqpTemplate() |
org.springframework.remoting.support.RemoteInvocationFactory |
getRemoteInvocationFactory() |
java.lang.String |
getRoutingKey() |
java.lang.Object |
invoke(org.aopalliance.intercept.MethodInvocation invocation) |
void |
setAmqpTemplate(AmqpTemplate amqpTemplate)
The AMQP template to be used for sending messages and receiving results.
|
void |
setRemoteInvocationFactory(org.springframework.remoting.support.RemoteInvocationFactory remoteInvocationFactory)
Set the RemoteInvocationFactory to use for this accessor.
|
void |
setRoutingKey(java.lang.String routingKey)
The routing key to send calls to the service with.
|
getServiceInterface, setServiceInterface
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws java.lang.Throwable
invoke
in interface org.aopalliance.intercept.MethodInterceptor
java.lang.Throwable
public AmqpTemplate getAmqpTemplate()
public void setAmqpTemplate(AmqpTemplate amqpTemplate)
amqpTemplate
- The amqp template.public java.lang.String getRoutingKey()
public void setRoutingKey(java.lang.String routingKey)
AmqpTemplate
's default routing key will be used.
This property is useful if you want to use the same AmqpTemplate to talk to multiple services.
routingKey
- The routing key.public org.springframework.remoting.support.RemoteInvocationFactory getRemoteInvocationFactory()
public void setRemoteInvocationFactory(org.springframework.remoting.support.RemoteInvocationFactory remoteInvocationFactory)
DefaultRemoteInvocationFactory
.
A custom invocation factory can add further context information to the invocation, for example user credentials.
remoteInvocationFactory
- The remote invocation factory.