public class AmqpClientInterceptor extends RemoteAccessor implements MethodInterceptor
MethodInterceptor
for accessing RMI-style AMQP services.AmqpInvokerServiceExporter
,
AmqpProxyFactoryBean
,
RemoteAccessException
logger
Constructor and Description |
---|
AmqpClientInterceptor() |
Modifier and Type | Method and Description |
---|---|
AmqpTemplate |
getAmqpTemplate() |
RemoteInvocationFactory |
getRemoteInvocationFactory() |
String |
getRoutingKey() |
Object |
invoke(MethodInvocation invocation) |
void |
setAmqpTemplate(AmqpTemplate amqpTemplate)
The AMQP template to be used for sending messages and receiving results.
|
void |
setRemoteInvocationFactory(RemoteInvocationFactory remoteInvocationFactory)
Set the RemoteInvocationFactory to use for this accessor.
|
void |
setRoutingKey(String routingKey)
The routing key to send calls to the service with.
|
getServiceInterface, setServiceInterface
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
public Object invoke(MethodInvocation invocation) throws Throwable
invoke
in interface MethodInterceptor
Throwable
public AmqpTemplate getAmqpTemplate()
public void setAmqpTemplate(AmqpTemplate amqpTemplate)
amqpTemplate
- The amqp template.public String getRoutingKey()
public void setRoutingKey(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 RemoteInvocationFactory getRemoteInvocationFactory()
public void setRemoteInvocationFactory(RemoteInvocationFactory remoteInvocationFactory)
DefaultRemoteInvocationFactory
.
A custom invocation factory can add further context information to the invocation, for example user credentials.
remoteInvocationFactory
- The remote invocation factory.