org.apache.axis2.transport.base
Class AbstractPollingTransportListener<T extends AbstractPollTableEntry>

java.lang.Object
  extended by org.apache.axis2.transport.base.AbstractTransportListener
      extended by org.apache.axis2.transport.base.AbstractTransportListenerEx<T>
          extended by org.apache.axis2.transport.base.AbstractPollingTransportListener<T>
All Implemented Interfaces:
TransportListener

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.transport.TransportListener
HOST_ADDRESS, PARAM_PORT
 
Constructor Summary
AbstractPollingTransportListener()
           
 
Method Summary
 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 maintenence
protected  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(java.lang.String msg, java.lang.Exception e, T entry)
          method to log a failure to the log file and to update the last poll status and time
 void resume()
          Resume the lister - Brings the lister into active mode back from a paused state
protected  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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPollingTransportListener

public AbstractPollingTransportListener()
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 in AbstractTransportListener and before the first endpoint is created, i.e. before the first call to AbstractTransportListenerEx.createEndpoint().

Specified by:
doInit in class AbstractTransportListenerEx<T extends AbstractPollTableEntry>
Throws:
AxisFault

destroy

public void destroy()
Specified by:
destroy in interface TransportListener
Overrides:
destroy in class AbstractTransportListener

startEndpoint

protected void startEndpoint(T endpoint)
                      throws AxisFault
Specified by:
startEndpoint in class AbstractTransportListenerEx<T extends AbstractPollTableEntry>
Throws:
AxisFault

stopEndpoint

protected void stopEndpoint(T endpoint)
Specified by:
stopEndpoint in class AbstractTransportListenerEx<T extends AbstractPollTableEntry>

poll

protected abstract void poll(T entry)

onPollCompletion

protected void onPollCompletion(T entry)

processFailure

protected void processFailure(java.lang.String msg,
                              java.lang.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 message
e - optional exception encountered or null
entry - 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 class AbstractTransportListener
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 class AbstractTransportListener
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 class AbstractTransportListener
Parameters:
millis - a number of milliseconds to wait until pending requests are allowed to complete
Throws:
AxisFault - on error


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