|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.remoting.support.RemoteAccessor
org.springframework.remoting.support.UrlBasedRemoteAccessor
org.springframework.remoting.support.RemoteInvocationBasedAccessor
org.logicblaze.lingo.jms.JmsClientInterceptor
public class JmsClientInterceptor
Interceptor for accessing a JMS based service which must be configured with a
LingoRemoteInvocationFactory
instance.
RemoteAccessor.setServiceInterface(java.lang.Class)
,
UrlBasedRemoteAccessor.setServiceUrl(java.lang.String)
,
JmsServiceExporter
,
JmsProxyFactoryBean
Field Summary |
---|
Fields inherited from class org.springframework.remoting.support.RemoteAccessor |
---|
logger |
Constructor Summary | |
---|---|
JmsClientInterceptor()
|
|
JmsClientInterceptor(Requestor requestor)
|
|
JmsClientInterceptor(Requestor requestor,
LingoRemoteInvocationFactory factory)
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
protected AsyncReplyHandler |
createAsyncHandler(java.lang.Object value)
|
protected MetadataStrategy |
createMetadataStrategy()
Factory method to create a default metadata strategy if none is configured |
protected LingoRemoteInvocationFactory |
createRemoteInvocationFactory()
Factory method to create a default lingo based invocation factory if none is configured |
protected Requestor |
createRequestor()
|
protected ResultJoinHandler |
createResultJoinHandler(org.aopalliance.intercept.MethodInvocation methodInvocation,
MethodMetadata metadata)
|
void |
destroy()
|
java.lang.String |
getClientID()
|
javax.jms.ConnectionFactory |
getConnectionFactory()
|
javax.jms.Destination |
getDestination()
|
int |
getJmsPriority()
|
java.lang.String |
getJmsType()
|
Marshaller |
getMarshaller()
|
java.util.Map |
getMessageProperties()
|
MetadataStrategy |
getMetadataStrategy()
|
long |
getMultipleResponseTimeout()
|
JmsProducerConfig |
getProducerConfig()
|
long |
getRemoteReferenceTimeout()
|
Requestor |
getRequestor()
|
javax.jms.Destination |
getResponseDestination()
|
long |
getResponseTimeout()
|
int |
getTimeToLive()
|
java.lang.Object |
invoke(org.aopalliance.intercept.MethodInvocation methodInvocation)
|
protected boolean |
isMultipleResponse(org.aopalliance.intercept.MethodInvocation methodInvocation,
MethodMetadata metadata)
Returns true if this method expects multiple response messages such as when sending a message over a topic. |
boolean |
isMultipleResponsesExpected()
|
boolean |
isPersistentDelivery()
|
protected void |
populateHeaders(javax.jms.Message requestMessage)
|
protected java.lang.Object |
recreateRemoteInvocationResult(org.springframework.remoting.support.RemoteInvocationResult result)
Recreate the invocation result contained in the given RemoteInvocationResult object. |
protected java.lang.Object |
remoteReference(java.lang.Class type,
java.lang.Object value)
|
protected void |
replaceRemoteReferences(LingoInvocation invocation,
MethodMetadata metadata)
|
void |
setClientID(java.lang.String clientID)
Sets the JMS connections unique clientID. |
void |
setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
Used to create a default Requestor if no requestor is explicitly
configured. |
void |
setCorrelationID(java.lang.String correlationID)
|
void |
setDestination(javax.jms.Destination destination)
Sets the destination used to make requests |
void |
setJmsPriority(int jmsPriority)
Sets the JMS priority of the request message |
void |
setJmsType(java.lang.String jmsType)
Sets the JMS message type string which is appended to messages if set |
void |
setMarshaller(Marshaller marshaller)
|
void |
setMessageProperties(java.util.Map messageProperties)
Sets the message properties to be added to each message. |
void |
setMetadataStrategy(MetadataStrategy metadataStrategy)
|
void |
setMultipleResponsesExpected(boolean multipleResponsesExpected)
Sets whether or not multiple response messages are expected. |
void |
setMultipleResponseTimeout(long multipleResponseTimeout)
Sets the maximum amount of time to wait for multiple results to come back if communicating with multiple servers and aggregating together the results. |
void |
setPersistentDelivery(boolean persistent)
Sets the delivery mode to be persistent or non-persistent. |
void |
setProducerConfig(JmsProducerConfig producerConfig)
Sets the configuration of the producer used to send back responses |
void |
setRemoteReferenceTimeout(long remoteReferenceTimeout)
Sets the maximum amount of time an inactive remote object reference will keep around until it is garbage collected. |
void |
setRequestor(Requestor requestor)
|
void |
setResponseDestination(javax.jms.Destination responseDestination)
Sets the destination used to consume responses on - or null and a temporary queue will be created. |
void |
setResponseTimeout(long responseTimeout)
Sets the maximum amount of time (in milliseconds) to wait for responses to come back before timing out the request. |
void |
setTimeToLive(int timeToLive)
Sets the JMS expiration timeout (in milliseconds) of the request message |
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedAccessor |
---|
createRemoteInvocation, getRemoteInvocationFactory, setRemoteInvocationFactory |
Methods inherited from class org.springframework.remoting.support.UrlBasedRemoteAccessor |
---|
getServiceUrl, setServiceUrl |
Methods inherited from class org.springframework.remoting.support.RemoteAccessor |
---|
getServiceInterface, setServiceInterface |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JmsClientInterceptor()
public JmsClientInterceptor(Requestor requestor)
public JmsClientInterceptor(Requestor requestor, LingoRemoteInvocationFactory factory)
Method Detail |
---|
public void afterPropertiesSet() throws javax.jms.JMSException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
javax.jms.JMSException
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation) throws java.lang.Throwable
invoke
in interface org.aopalliance.intercept.MethodInterceptor
java.lang.Throwable
public void destroy() throws java.lang.Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
java.lang.Exception
public Requestor getRequestor()
public void setRequestor(Requestor requestor)
public javax.jms.Destination getDestination()
public void setDestination(javax.jms.Destination destination)
destination
- public javax.jms.Destination getResponseDestination()
public void setResponseDestination(javax.jms.Destination responseDestination)
responseDestination
- public void setCorrelationID(java.lang.String correlationID)
public java.lang.String getJmsType()
public void setJmsType(java.lang.String jmsType)
public java.util.Map getMessageProperties()
public int getJmsPriority()
public void setJmsPriority(int jmsPriority)
public int getTimeToLive()
public void setTimeToLive(int timeToLive)
public void setMessageProperties(java.util.Map messageProperties)
public Marshaller getMarshaller()
public void setMarshaller(Marshaller marshaller)
public javax.jms.ConnectionFactory getConnectionFactory()
public void setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
Requestor
if no requestor is explicitly
configured.
public JmsProducerConfig getProducerConfig()
public void setProducerConfig(JmsProducerConfig producerConfig)
public boolean isPersistentDelivery()
public void setPersistentDelivery(boolean persistent)
public java.lang.String getClientID()
public void setClientID(java.lang.String clientID)
public MetadataStrategy getMetadataStrategy()
public void setMetadataStrategy(MetadataStrategy metadataStrategy)
public boolean isMultipleResponsesExpected()
public void setMultipleResponsesExpected(boolean multipleResponsesExpected)
getDestination()
method returns a Topic
but there could be circumstances when
sending a request to a queue results in messages being fanned out to many
servers which could all respond.
public long getRemoteReferenceTimeout()
public void setRemoteReferenceTimeout(long remoteReferenceTimeout)
public long getMultipleResponseTimeout()
public void setMultipleResponseTimeout(long multipleResponseTimeout)
public long getResponseTimeout()
public void setResponseTimeout(long responseTimeout)
getTimeToLive()
property which is used to
set the expiration time on the request message.
protected boolean isMultipleResponse(org.aopalliance.intercept.MethodInvocation methodInvocation, MethodMetadata metadata)
protected void populateHeaders(javax.jms.Message requestMessage) throws javax.jms.JMSException
javax.jms.JMSException
protected java.lang.Object recreateRemoteInvocationResult(org.springframework.remoting.support.RemoteInvocationResult result) throws java.lang.Throwable
Can be overridden in subclass to provide custom recreation, potentially processing the returned result object.
recreateRemoteInvocationResult
in class org.springframework.remoting.support.RemoteInvocationBasedAccessor
result
- the RemoteInvocationResult to recreate
java.lang.Throwable
- if the invocation result is an exceptionRemoteInvocationResult.recreate()
protected void replaceRemoteReferences(LingoInvocation invocation, MethodMetadata metadata)
protected java.lang.Object remoteReference(java.lang.Class type, java.lang.Object value)
protected ResultJoinHandler createResultJoinHandler(org.aopalliance.intercept.MethodInvocation methodInvocation, MethodMetadata metadata)
protected AsyncReplyHandler createAsyncHandler(java.lang.Object value)
protected Requestor createRequestor() throws javax.jms.JMSException
javax.jms.JMSException
protected LingoRemoteInvocationFactory createRemoteInvocationFactory()
protected MetadataStrategy createMetadataStrategy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |