Package org.apache.axis2.transport.base
Class AbstractPollingTransportListener<T extends AbstractPollTableEntry>
- java.lang.Object
-
- org.apache.axis2.transport.base.AbstractTransportListener
-
- org.apache.axis2.transport.base.AbstractTransportListenerEx<T>
-
- org.apache.axis2.transport.base.AbstractPollingTransportListener<T>
-
- All Implemented Interfaces:
TransportListener
- Direct Known Subclasses:
MailTransportListener
public abstract class AbstractPollingTransportListener<T extends AbstractPollTableEntry> extends AbstractTransportListenerEx<T>
-
-
Field Summary
-
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.kernel.TransportListener
HOST_ADDRESS, PARAM_PORT
-
-
Constructor Summary
Constructors Constructor Description AbstractPollingTransportListener()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddestroy()protected voiddoInit()Initialize the transport.voidmaintenenceShutdown(long millis)Stop processing new messages, and wait the specified maximum time for in-flight requests to complete before a controlled shutdown for maintenenceprotected voidonPollCompletion(T entry)voidpause()Pause the listener - Stop accepting/processing new messages, but continues processing existing messages until they complete.protected abstract voidpoll(T entry)protected voidprocessFailure(String msg, Exception e, T entry)method to log a failure to the log file and to update the last poll status and timevoidresume()Resume the lister - Brings the lister into active mode back from a paused stateprotected voidstartEndpoint(T endpoint)protected voidstopEndpoint(T endpoint)-
Methods inherited from class org.apache.axis2.transport.base.AbstractTransportListenerEx
createEndpoint, getEndpoints, getEPRsForService, init, start, startListeningForService, stop, 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, getTransportInDescription, getTransportName, handleException, handleIncomingMessage, logException, resetStatistics
-
-
-
-
Method Detail
-
doInit
protected void doInit() throws AxisFaultDescription copied from class:AbstractTransportListenerExInitialize the transport. This method will be called after the initialization work inAbstractTransportListenerand before the first endpoint is created, i.e. before the first call toAbstractTransportListenerEx.createEndpoint().- Specified by:
doInitin classAbstractTransportListenerEx<T extends AbstractPollTableEntry>- Throws:
AxisFault
-
destroy
public void destroy()
- Specified by:
destroyin interfaceTransportListener- Overrides:
destroyin classAbstractTransportListener
-
startEndpoint
protected void startEndpoint(T endpoint) throws AxisFault
- Specified by:
startEndpointin classAbstractTransportListenerEx<T extends AbstractPollTableEntry>- Throws:
AxisFault
-
stopEndpoint
protected void stopEndpoint(T endpoint)
- Specified by:
stopEndpointin classAbstractTransportListenerEx<T extends AbstractPollTableEntry>
-
poll
protected abstract void poll(T entry)
-
onPollCompletion
protected void onPollCompletion(T entry)
-
processFailure
protected void processFailure(String msg, Exception e, T entry)
method to log a failure to the log file and to update the last poll status and time- Parameters:
msg- text for the log messagee- optional exception encountered or nullentry- the PollTableEntry
-
pause
public void pause() throws AxisFaultPause the listener - Stop accepting/processing new messages, but continues processing existing messages until they complete. This helps bring an instance into a maintenence mode- Overrides:
pausein classAbstractTransportListener- Throws:
AxisFault- on error
-
resume
public void resume() throws AxisFaultResume the lister - Brings the lister into active mode back from a paused state- Overrides:
resumein classAbstractTransportListener- Throws:
AxisFault- on error
-
maintenenceShutdown
public void maintenenceShutdown(long millis) throws AxisFaultStop processing new messages, and wait the specified maximum time for in-flight requests to complete before a controlled shutdown for maintenence- Overrides:
maintenenceShutdownin classAbstractTransportListener- Parameters:
millis- a number of milliseconds to wait until pending requests are allowed to complete- Throws:
AxisFault- on error
-
-