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:
org.apache.axis2.transport.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.transport.TransportListener
HOST_ADDRESS, PARAM_PORT
 
Constructor Summary
AbstractPollingTransportListener()
           
 
Method Summary
 void destroy()
           
 void init(org.apache.axis2.context.ConfigurationContext cfgCtx, org.apache.axis2.description.TransportInDescription transportIn)
          Initialize the generic 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, startListeningForService, 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, getTransportName, handleException, handleIncomingMessage, logException, resetStatistics, start, stop
 
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

init

public void init(org.apache.axis2.context.ConfigurationContext cfgCtx,
                 org.apache.axis2.description.TransportInDescription transportIn)
          throws org.apache.axis2.AxisFault
Description copied from class: AbstractTransportListener
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:
init in interface org.apache.axis2.transport.TransportListener
Overrides:
init in class AbstractTransportListenerEx<T extends AbstractPollTableEntry>
Parameters:
cfgCtx - the axis configuration context
transportIn - the transport-in description
Throws:
org.apache.axis2.AxisFault - on error

destroy

public void destroy()
Specified by:
destroy in interface org.apache.axis2.transport.TransportListener
Overrides:
destroy in class AbstractTransportListenerEx<T extends AbstractPollTableEntry>

startEndpoint

protected void startEndpoint(T endpoint)
                      throws org.apache.axis2.AxisFault
Specified by:
startEndpoint in class AbstractTransportListenerEx<T extends AbstractPollTableEntry>
Throws:
org.apache.axis2.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 org.apache.axis2.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:
org.apache.axis2.AxisFault - on error

resume

public void resume()
            throws org.apache.axis2.AxisFault
Resume the lister - Brings the lister into active mode back from a paused state

Overrides:
resume in class AbstractTransportListener
Throws:
org.apache.axis2.AxisFault - on error

maintenenceShutdown

public void maintenenceShutdown(long millis)
                         throws org.apache.axis2.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:
org.apache.axis2.AxisFault - on error


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