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 void
destroy()
protected void
doInit()
Initialize the transport.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 maintenenceprotected void
onPollCompletion(T entry)
void
pause()
Pause the listener - Stop accepting/processing new messages, but continues processing existing messages until they complete.protected abstract void
poll(T entry)
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 timevoid
resume()
Resume the lister - Brings the lister into active mode back from a paused stateprotected void
startEndpoint(T endpoint)
protected void
stopEndpoint(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 AxisFault
Description copied from class:AbstractTransportListenerEx
Initialize the transport. This method will be called after the initialization work inAbstractTransportListener
and before the first endpoint is created, i.e. before the first call toAbstractTransportListenerEx.createEndpoint()
.- Specified by:
doInit
in classAbstractTransportListenerEx<T extends AbstractPollTableEntry>
- Throws:
AxisFault
-
destroy
public void destroy()
- Specified by:
destroy
in interfaceTransportListener
- Overrides:
destroy
in classAbstractTransportListener
-
startEndpoint
protected void startEndpoint(T endpoint) throws AxisFault
- Specified by:
startEndpoint
in classAbstractTransportListenerEx<T extends AbstractPollTableEntry>
- Throws:
AxisFault
-
stopEndpoint
protected void stopEndpoint(T endpoint)
- Specified by:
stopEndpoint
in 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 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- Overrides:
pause
in classAbstractTransportListener
- Throws:
AxisFault
- on error
-
resume
public void resume() throws AxisFault
Resume the lister - Brings the lister into active mode back from a paused state- Overrides:
resume
in classAbstractTransportListener
- Throws:
AxisFault
- on error
-
maintenenceShutdown
public void maintenenceShutdown(long millis) throws AxisFault
Stop processing new messages, and wait the specified maximum time for in-flight requests to complete before a controlled shutdown for maintenence- Overrides:
maintenenceShutdown
in classAbstractTransportListener
- Parameters:
millis
- a number of milliseconds to wait until pending requests are allowed to complete- Throws:
AxisFault
- on error
-
-