Package org.apache.axis2.transport.base
Class AbstractTransportListener
java.lang.Object
org.apache.axis2.transport.base.AbstractTransportListener
- All Implemented Interfaces:
TransportListener
- Direct Known Subclasses:
AbstractTransportListenerEx
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConfigurationContextthe axis2 configuration contextprotected TransportConfigurationTransport Configuration for the respective transportsprotected booleanis this transport non-blocking?protected org.apache.commons.logging.Logthe reference to the actual commons logger to be used for log messagesprotected MetricsCollectorMetrics collector for this transportprotected intstate of the listenerprotected booleanuse the thread pool available in the axis2 configuration contextprotected WorkerPoolthe thread pool to execute actual poll invocationsFields inherited from interface org.apache.axis2.transport.TransportListener
HOST_ADDRESS, PARAM_PORT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedA constructor that makes subclasses pick up the correct logger -
Method Summary
Modifier and TypeMethodDescriptionCreate a new axis MessageContext for an incoming message through this transportvoiddestroy()voiddisableTransportForService(AxisService service) intReturns the number of active threads processing messagesdoubledoublelonglonggetEPRForService(String serviceName, String ip) This is a deprecated method in Axis2 and this default implementation returns the first result from the getEPRsForService() methodprotected EndpointReference[]getEPRsForService(String serviceName) getEPRsForService(String serviceName, String ip) longlonglonglonglonglonglonglonglonglongintReturn the number of requests queued in the thread poolgetSessionContext(MessageContext messageContext) longlongprotected voidhandleException(String msg, Exception e) voidhandleIncomingMessage(MessageContext msgCtx, Map trpHeaders, String soapAction, String contentType) Process a new incoming message through the axis enginevoidinit(ConfigurationContext cfgCtx, TransportInDescription transportIn) Initialize the generic transport.protected voidlogException(String msg, Exception e) voidmaintenenceShutdown(long millis) Stop processing new messages, and wait the specified maximum time for in-flight requests to complete before a controlled shutdown for maintenencevoidpause()Pause the listener - Stop accepting/processing new messages, but continues processing existing messages until they complete.voidvoidresume()Resume the lister - Brings the lister into active mode back from a paused statevoidstart()protected abstract voidstartListeningForService(AxisService service) voidstop()protected abstract voidstopListeningForService(AxisService service)
-
Field Details
-
log
protected org.apache.commons.logging.Log logthe reference to the actual commons logger to be used for log messages -
cfgCtx
the axis2 configuration context -
state
protected int statestate of the listener -
isNonBlocking
protected boolean isNonBlockingis this transport non-blocking? -
workerPool
the thread pool to execute actual poll invocations -
useAxis2ThreadPool
protected boolean useAxis2ThreadPooluse the thread pool available in the axis2 configuration context -
metrics
Metrics collector for this transport -
config
Transport Configuration for the respective transports
-
-
Constructor Details
-
AbstractTransportListener
protected AbstractTransportListener()A constructor that makes subclasses pick up the correct logger
-
-
Method Details
-
init
Initialize the generic transport. Sets up the transport and the thread pool to be used for message processing. Also creates an AxisObserver that gets notified of service life cycle events for the transport to act on- Specified by:
initin interfaceTransportListener- Parameters:
cfgCtx- the axis configuration contexttransportIn- the transport-in description- Throws:
AxisFault- on error
-
destroy
public void destroy()- Specified by:
destroyin interfaceTransportListener
-
stop
- Specified by:
stopin interfaceTransportListener- Throws:
AxisFault
-
start
- Specified by:
startin interfaceTransportListener- Throws:
AxisFault
-
getEPRsForService
- Specified by:
getEPRsForServicein interfaceTransportListener- Throws:
AxisFault
-
getEPRsForService
-
disableTransportForService
-
startListeningForService
- Throws:
AxisFault
-
stopListeningForService
-
getEPRForService
This is a deprecated method in Axis2 and this default implementation returns the first result from the getEPRsForService() method- Specified by:
getEPRForServicein interfaceTransportListener- Throws:
AxisFault
-
getSessionContext
- Specified by:
getSessionContextin interfaceTransportListener
-
createMessageContext
Create a new axis MessageContext for an incoming message through this transport- Returns:
- the newly created message context
-
handleIncomingMessage
public void handleIncomingMessage(MessageContext msgCtx, Map trpHeaders, String soapAction, String contentType) throws AxisFault Process a new incoming message through the axis engine- Parameters:
msgCtx- the axis MessageContexttrpHeaders- the map containing transport level message headerssoapAction- the optional soap action or nullcontentType- the optional content-type for the message- Throws:
AxisFault
-
handleException
- Throws:
AxisFault
-
logException
-
getTransportInDescription
-
getTransportName
-
getConfigurationContext
-
getMetricsCollector
-
pause
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- Throws:
AxisFault- on error
-
resume
Resume the lister - Brings the lister into active mode back from a paused state- Throws:
AxisFault- on error
-
maintenenceShutdown
Stop processing new messages, and wait the specified maximum time for in-flight requests to complete before a controlled shutdown for maintenence- Parameters:
millis- a number of milliseconds to wait until pending requests are allowed to complete- Throws:
AxisFault- on error
-
getActiveThreadCount
public int getActiveThreadCount()Returns the number of active threads processing messages- Returns:
- number of active threads processing messages
-
getQueueSize
public int getQueueSize()Return the number of requests queued in the thread pool- Returns:
- queue size
-
getMessagesReceived
public long getMessagesReceived() -
getFaultsReceiving
public long getFaultsReceiving() -
getBytesReceived
public long getBytesReceived() -
getMessagesSent
public long getMessagesSent() -
getFaultsSending
public long getFaultsSending() -
getBytesSent
public long getBytesSent() -
getTimeoutsReceiving
public long getTimeoutsReceiving() -
getTimeoutsSending
public long getTimeoutsSending() -
getMinSizeReceived
public long getMinSizeReceived() -
getMaxSizeReceived
public long getMaxSizeReceived() -
getAvgSizeReceived
public double getAvgSizeReceived() -
getMinSizeSent
public long getMinSizeSent() -
getMaxSizeSent
public long getMaxSizeSent() -
getAvgSizeSent
public double getAvgSizeSent() -
getResponseCodeTable
-
resetStatistics
public void resetStatistics() -
getLastResetTime
public long getLastResetTime() -
getMetricsWindow
public long getMetricsWindow()
-