org.logicblaze.lingo.jms
Class JmsClientInterceptor

java.lang.Object
  extended byorg.springframework.remoting.support.RemoteAccessor
      extended byorg.springframework.remoting.support.UrlBasedRemoteAccessor
          extended byorg.springframework.remoting.support.RemoteInvocationBasedAccessor
              extended byorg.logicblaze.lingo.jms.JmsClientInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor
Direct Known Subclasses:
JmsProxyFactoryBean

public class JmsClientInterceptor
extends org.springframework.remoting.support.RemoteInvocationBasedAccessor
implements org.aopalliance.intercept.MethodInterceptor, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean

Interceptor for accessing a JMS based service which must be configured with a LingoRemoteInvocationFactory instance.

Author:
James Strachan
See Also:
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  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
 void destroy()
           
 ConnectionFactory getConnectionFactory()
           
 Destination getDestination()
           
 Marshaller getMarshaller()
           
 Requestor getRequestor()
           
 Destination getResponseDestination()
           
 Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation)
           
protected  void populateHeaders(Message requestMessage)
           
protected  Object recreateRemoteInvocationResult(org.springframework.remoting.support.RemoteInvocationResult result)
          Recreate the invocation result contained in the given RemoteInvocationResult object.
protected  Object remoteReference(Class type, Object value)
           
protected  void replaceRemoteReferences(LingoInvocation invocation, MethodMetadata metadata)
           
 void setConnectionFactory(ConnectionFactory connectionFactory)
          Used to create a default Requestor if no requestor is explicitly configured.
 void setCorrelationID(String correlationID)
           
 void setDestination(Destination destination)
          Sets the destination used to make requests
 void setMarshaller(Marshaller marshaller)
           
 void setRequestor(Requestor requestor)
           
 void setResponseDestination(Destination responseDestination)
          Sets the destination used to consume responses on - or null and a temporary queue will be created.
 
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

JmsClientInterceptor

public JmsClientInterceptor()

JmsClientInterceptor

public JmsClientInterceptor(Requestor requestor)

JmsClientInterceptor

public JmsClientInterceptor(Requestor requestor,
                            LingoRemoteInvocationFactory factory)
Method Detail

invoke

public Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation)
              throws Throwable
Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Throws:
Throwable

afterPropertiesSet

public void afterPropertiesSet()
                        throws JMSException
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
JMSException

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
Exception

getRequestor

public Requestor getRequestor()

setRequestor

public void setRequestor(Requestor requestor)

getDestination

public Destination getDestination()

setDestination

public void setDestination(Destination destination)
Sets the destination used to make requests

Parameters:
destination -

getResponseDestination

public Destination getResponseDestination()

setResponseDestination

public void setResponseDestination(Destination responseDestination)
Sets the destination used to consume responses on - or null and a temporary queue will be created.

Parameters:
responseDestination -

setCorrelationID

public void setCorrelationID(String correlationID)

getMarshaller

public Marshaller getMarshaller()

setMarshaller

public void setMarshaller(Marshaller marshaller)

getConnectionFactory

public ConnectionFactory getConnectionFactory()

setConnectionFactory

public void setConnectionFactory(ConnectionFactory connectionFactory)
Used to create a default Requestor if no requestor is explicitly configured.


populateHeaders

protected void populateHeaders(Message requestMessage)
                        throws JMSException
Throws:
JMSException

recreateRemoteInvocationResult

protected Object recreateRemoteInvocationResult(org.springframework.remoting.support.RemoteInvocationResult result)
                                         throws Throwable
Recreate the invocation result contained in the given RemoteInvocationResult object. The default implementation calls the default recreate method.

Can be overridden in subclass to provide custom recreation, potentially processing the returned result object.

Parameters:
result - the RemoteInvocationResult to recreate
Returns:
a return value if the invocation result is a successful return
Throws:
Throwable - if the invocation result is an exception
See Also:
RemoteInvocationResult.recreate()

replaceRemoteReferences

protected void replaceRemoteReferences(LingoInvocation invocation,
                                       MethodMetadata metadata)

remoteReference

protected Object remoteReference(Class type,
                                 Object value)

createRemoteInvocationFactory

protected LingoRemoteInvocationFactory createRemoteInvocationFactory()
Factory method to create a default lingo based invocation factory if none is configured


createMetadataStrategy

protected MetadataStrategy createMetadataStrategy()
Factory method to create a default metadata strategy if none is configured

Returns:


Copyright © 2005 LogicBlaze, Inc.. All Rights Reserved.