org.apache.axis2.transport.jms
Class JMSListener

java.lang.Object
  extended by org.apache.axis2.transport.base.AbstractTransportListener
      extended by org.apache.axis2.transport.base.AbstractTransportListenerEx<JMSEndpoint>
          extended by org.apache.axis2.transport.jms.JMSListener
All Implemented Interfaces:
TransportErrorSource, ManagementSupport, org.apache.axis2.transport.TransportListener

public class JMSListener
extends AbstractTransportListenerEx<JMSEndpoint>
implements ManagementSupport, TransportErrorSource

The revamped JMS Transport listener implementation. Creates ServiceTaskManager instances for each service requesting exposure over JMS, and stops these if they are undeployed / stopped.

A service indicates a JMS Connection factory definition by name, which would be defined in the JMSListner on the axis2.xml, and this provides a way to reuse common configuration between services, as well as to optimize resources utilized

If the connection factory name was not specified, it will default to the one named "default" JMSConstants.DEFAULT_CONFAC_NAME

If a destination JNDI name is not specified, a service will expect to use a Queue with the same JNDI name as of the service. Additional Parameters allows one to bind to a Topic or specify many more detailed control options. See package documentation for more details

All Destinations / JMS Administered objects used MUST be pre-created or already available


Field Summary
static java.lang.String TRANSPORT_NAME
           
 
Fields inherited from class org.apache.axis2.transport.base.AbstractTransportListener
cfgCtx, config, isNonBlocking, log, metrics, state, useAxis2ThreadPool, workerPool
 
Fields inherited from interface org.apache.axis2.transport.TransportListener
HOST_ADDRESS, PARAM_PORT
 
Constructor Summary
JMSListener()
           
 
Method Summary
 void addErrorListener(TransportErrorListener listener)
           
protected  JMSEndpoint createEndpoint()
           
 JMSConnectionFactory getConnectionFactory(org.apache.axis2.description.AxisService service)
          Return the connection factory name for this service.
 void init(org.apache.axis2.context.ConfigurationContext cfgCtx, org.apache.axis2.description.TransportInDescription trpInDesc)
          TransportListener initialization
 void maintenenceShutdown(long millis)
          Stop processing new messages, and wait the specified maximum time for in-flight requests to complete before a controlled shutdown for maintenence
 void pause()
          Pause the listener - Stop accepting/processing new messages, but continues processing existing messages until they complete.
 void removeErrorListener(TransportErrorListener listener)
           
 void resume()
          Resume the lister - Brings the lister into active mode back from a paused state
protected  void startEndpoint(JMSEndpoint endpoint)
          Listen for JMS messages on behalf of the given service
protected  void stopEndpoint(JMSEndpoint endpoint)
          Stops listening for messages for the service thats undeployed or stopped
 
Methods inherited from class org.apache.axis2.transport.base.AbstractTransportListenerEx
destroy, getEndpoints, getEPRsForService, startListeningForService, stopListeningForService
 
Methods inherited from class org.apache.axis2.transport.base.AbstractTransportListener
createMessageContext, disableTransportForService, getActiveThreadCount, getAvgSizeReceived, getAvgSizeSent, getBytesReceived, getBytesSent, getConfigurationContext, getEPRForService, getEPRsForService, getFaultsReceiving, getFaultsSending, getLastResetTime, getMaxSizeReceived, getMaxSizeSent, getMessagesReceived, getMessagesSent, getMetricsCollector, getMetricsWindow, getMinSizeReceived, getMinSizeSent, getQueueSize, getResponseCodeTable, getSessionContext, getTimeoutsReceiving, getTimeoutsSending, getTransportName, handleException, handleIncomingMessage, logException, resetStatistics, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.axis2.transport.base.ManagementSupport
getActiveThreadCount, getAvgSizeReceived, getAvgSizeSent, getBytesReceived, getBytesSent, getFaultsReceiving, getFaultsSending, getLastResetTime, getMaxSizeReceived, getMaxSizeSent, getMessagesReceived, getMessagesSent, getMetricsWindow, getMinSizeReceived, getMinSizeSent, getQueueSize, getResponseCodeTable, getTimeoutsReceiving, getTimeoutsSending, resetStatistics
 

Field Detail

TRANSPORT_NAME

public static final java.lang.String TRANSPORT_NAME
See Also:
Constant Field Values
Constructor Detail

JMSListener

public JMSListener()
Method Detail

init

public void init(org.apache.axis2.context.ConfigurationContext cfgCtx,
                 org.apache.axis2.description.TransportInDescription trpInDesc)
          throws org.apache.axis2.AxisFault
TransportListener initialization

Specified by:
init in interface org.apache.axis2.transport.TransportListener
Overrides:
init in class AbstractTransportListenerEx<JMSEndpoint>
Parameters:
cfgCtx - the Axis configuration context
trpInDesc - the TransportIn description
Throws:
org.apache.axis2.AxisFault - on error

createEndpoint

protected JMSEndpoint createEndpoint()
Specified by:
createEndpoint in class AbstractTransportListenerEx<JMSEndpoint>

startEndpoint

protected void startEndpoint(JMSEndpoint endpoint)
                      throws org.apache.axis2.AxisFault
Listen for JMS messages on behalf of the given service

Specified by:
startEndpoint in class AbstractTransportListenerEx<JMSEndpoint>
Parameters:
service - the Axis service for which to listen for messages
Throws:
org.apache.axis2.AxisFault

stopEndpoint

protected void stopEndpoint(JMSEndpoint endpoint)
Stops listening for messages for the service thats undeployed or stopped

Specified by:
stopEndpoint in class AbstractTransportListenerEx<JMSEndpoint>
Parameters:
service - the service that was undeployed or stopped

getConnectionFactory

public JMSConnectionFactory getConnectionFactory(org.apache.axis2.description.AxisService service)
Return the connection factory name for this service. If this service refers to an invalid factory or defaults to a non-existent default factory, this returns null

Parameters:
service - the AxisService
Returns:
the JMSConnectionFactory to be used, or null if reference is invalid

pause

public void pause()
           throws org.apache.axis2.AxisFault
Pause the listener - Stop accepting/processing new messages, but continues processing existing messages until they complete. This helps bring an instance into a maintenence mode

Specified by:
pause in interface ManagementSupport
Overrides:
pause in class AbstractTransportListener
Throws:
org.apache.axis2.AxisFault - on error

resume

public void resume()
            throws org.apache.axis2.AxisFault
Resume the lister - Brings the lister into active mode back from a paused state

Specified by:
resume in interface ManagementSupport
Overrides:
resume in class AbstractTransportListener
Throws:
org.apache.axis2.AxisFault - on error

maintenenceShutdown

public void maintenenceShutdown(long millis)
                         throws org.apache.axis2.AxisFault
Stop processing new messages, and wait the specified maximum time for in-flight requests to complete before a controlled shutdown for maintenence

Specified by:
maintenenceShutdown in interface ManagementSupport
Overrides:
maintenenceShutdown in class AbstractTransportListener
Parameters:
millis - a number of milliseconds to wait until pending requests are allowed to complete
Throws:
org.apache.axis2.AxisFault - on error

addErrorListener

public void addErrorListener(TransportErrorListener listener)
Specified by:
addErrorListener in interface TransportErrorSource

removeErrorListener

public void removeErrorListener(TransportErrorListener listener)
Specified by:
removeErrorListener in interface TransportErrorSource


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.