public class JMSListener extends AbstractTransportListenerEx<JMSEndpoint> implements ManagementSupport, TransportErrorSource
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
Modifier and Type | Field and Description |
---|---|
static String |
TRANSPORT_NAME |
cfgCtx, config, isNonBlocking, log, metrics, state, useAxis2ThreadPool, workerPool
HOST_ADDRESS, PARAM_PORT
Constructor and Description |
---|
JMSListener() |
Modifier and Type | Method and Description |
---|---|
void |
addErrorListener(TransportErrorListener listener) |
protected JMSEndpoint |
createEndpoint() |
protected void |
doInit()
Initialize the transport.
|
JMSConnectionFactory |
getConnectionFactory(AxisService service)
Return the connection factory name for this service.
|
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
|
getEndpoints, getEPRsForService, init, start, startListeningForService, stop, stopListeningForService
createMessageContext, destroy, 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, getTransportInDescription, getTransportName, handleException, handleIncomingMessage, logException, resetStatistics
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getActiveThreadCount, getAvgSizeReceived, getAvgSizeSent, getBytesReceived, getBytesSent, getFaultsReceiving, getFaultsSending, getLastResetTime, getMaxSizeReceived, getMaxSizeSent, getMessagesReceived, getMessagesSent, getMetricsWindow, getMinSizeReceived, getMinSizeSent, getQueueSize, getResponseCodeTable, getTimeoutsReceiving, getTimeoutsSending, resetStatistics
public static final String TRANSPORT_NAME
protected void doInit() throws AxisFault
AbstractTransportListenerEx
AbstractTransportListener
and before the first endpoint is created, i.e. before the
first call to AbstractTransportListenerEx.createEndpoint()
.doInit
in class AbstractTransportListenerEx<JMSEndpoint>
AxisFault
protected JMSEndpoint createEndpoint()
createEndpoint
in class AbstractTransportListenerEx<JMSEndpoint>
protected void startEndpoint(JMSEndpoint endpoint) throws AxisFault
startEndpoint
in class AbstractTransportListenerEx<JMSEndpoint>
service
- the Axis service for which to listen for messagesAxisFault
protected void stopEndpoint(JMSEndpoint endpoint)
stopEndpoint
in class AbstractTransportListenerEx<JMSEndpoint>
service
- the service that was undeployed or stoppedpublic JMSConnectionFactory getConnectionFactory(AxisService service)
service
- the AxisServicepublic void pause() throws AxisFault
pause
in interface ManagementSupport
pause
in class AbstractTransportListener
AxisFault
- on errorpublic void resume() throws AxisFault
resume
in interface ManagementSupport
resume
in class AbstractTransportListener
AxisFault
- on errorpublic void maintenenceShutdown(long millis) throws AxisFault
maintenenceShutdown
in interface ManagementSupport
maintenenceShutdown
in class AbstractTransportListener
millis
- a number of milliseconds to wait until pending requests are allowed to completeAxisFault
- on errorpublic void addErrorListener(TransportErrorListener listener)
addErrorListener
in interface TransportErrorSource
public void removeErrorListener(TransportErrorListener listener)
removeErrorListener
in interface TransportErrorSource
Copyright © 2004-2015 The Apache Software Foundation. All Rights Reserved.