org.apache.axis2.transport.base
Class AbstractTransportListener

java.lang.Object
  extended by org.apache.axis2.transport.base.AbstractTransportListener
All Implemented Interfaces:
org.apache.axis2.transport.TransportListener
Direct Known Subclasses:
AbstractTransportListenerEx

public abstract class AbstractTransportListener
extends java.lang.Object
implements org.apache.axis2.transport.TransportListener


Field Summary
protected  org.apache.axis2.context.ConfigurationContext cfgCtx
          the axis2 configuration context
protected  TransportConfiguration config
          Transport Configuration for the respective transports
protected  boolean isNonBlocking
          is this transport non-blocking?
protected  org.apache.commons.logging.Log log
          the reference to the actual commons logger to be used for log messages
protected  MetricsCollector metrics
          Metrics collector for this transport
protected  int state
          state of the listener
protected  boolean useAxis2ThreadPool
          use the thread pool available in the axis2 configuration context
protected  WorkerPool workerPool
          the thread pool to execute actual poll invocations
 
Fields inherited from interface org.apache.axis2.transport.TransportListener
HOST_ADDRESS, PARAM_PORT
 
Constructor Summary
protected AbstractTransportListener()
          A constructor that makes subclasses pick up the correct logger
 
Method Summary
 org.apache.axis2.context.MessageContext createMessageContext()
          Create a new axis MessageContext for an incoming message through this transport
 void destroy()
           
 void disableTransportForService(org.apache.axis2.description.AxisService service)
           
 int getActiveThreadCount()
          Returns the number of active threads processing messages
 double getAvgSizeReceived()
           
 double getAvgSizeSent()
           
 long getBytesReceived()
           
 long getBytesSent()
           
 org.apache.axis2.context.ConfigurationContext getConfigurationContext()
           
 org.apache.axis2.addressing.EndpointReference getEPRForService(java.lang.String serviceName, java.lang.String ip)
          This is a deprecated method in Axis2 and this default implementation returns the first result from the getEPRsForService() method
protected  org.apache.axis2.addressing.EndpointReference[] getEPRsForService(java.lang.String serviceName)
           
 org.apache.axis2.addressing.EndpointReference[] getEPRsForService(java.lang.String serviceName, java.lang.String ip)
           
 long getFaultsReceiving()
           
 long getFaultsSending()
           
 long getLastResetTime()
           
 long getMaxSizeReceived()
           
 long getMaxSizeSent()
           
 long getMessagesReceived()
           
 long getMessagesSent()
           
 MetricsCollector getMetricsCollector()
           
 long getMetricsWindow()
           
 long getMinSizeReceived()
           
 long getMinSizeSent()
           
 int getQueueSize()
          Return the number of requests queued in the thread pool
 java.util.Map getResponseCodeTable()
           
 org.apache.axis2.context.SessionContext getSessionContext(org.apache.axis2.context.MessageContext messageContext)
           
 long getTimeoutsReceiving()
           
 long getTimeoutsSending()
           
 java.lang.String getTransportName()
           
protected  void handleException(java.lang.String msg, java.lang.Exception e)
           
 void handleIncomingMessage(org.apache.axis2.context.MessageContext msgCtx, java.util.Map trpHeaders, java.lang.String soapAction, java.lang.String contentType)
          Process a new incoming message through the axis engine
 void init(org.apache.axis2.context.ConfigurationContext cfgCtx, org.apache.axis2.description.TransportInDescription transportIn)
          Initialize the generic transport.
protected  void logException(java.lang.String msg, java.lang.Exception e)
           
 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
 void pause()
          Pause the listener - Stop accepting/processing new messages, but continues processing existing messages until they complete.
 void resetStatistics()
           
 void resume()
          Resume the lister - Brings the lister into active mode back from a paused state
 void start()
           
protected abstract  void startListeningForService(org.apache.axis2.description.AxisService service)
           
 void stop()
           
protected abstract  void stopListeningForService(org.apache.axis2.description.AxisService service)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log
the reference to the actual commons logger to be used for log messages


cfgCtx

protected org.apache.axis2.context.ConfigurationContext cfgCtx
the axis2 configuration context


state

protected int state
state of the listener


isNonBlocking

protected boolean isNonBlocking
is this transport non-blocking?


workerPool

protected WorkerPool workerPool
the thread pool to execute actual poll invocations


useAxis2ThreadPool

protected boolean useAxis2ThreadPool
use the thread pool available in the axis2 configuration context


metrics

protected MetricsCollector metrics
Metrics collector for this transport


config

protected TransportConfiguration config
Transport Configuration for the respective transports

Constructor Detail

AbstractTransportListener

protected AbstractTransportListener()
A constructor that makes subclasses pick up the correct logger

Method Detail

init

public void init(org.apache.axis2.context.ConfigurationContext cfgCtx,
                 org.apache.axis2.description.TransportInDescription transportIn)
          throws org.apache.axis2.AxisFault
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
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

stop

public void stop()
          throws org.apache.axis2.AxisFault
Specified by:
stop in interface org.apache.axis2.transport.TransportListener
Throws:
org.apache.axis2.AxisFault

start

public void start()
           throws org.apache.axis2.AxisFault
Specified by:
start in interface org.apache.axis2.transport.TransportListener
Throws:
org.apache.axis2.AxisFault

getEPRsForService

public org.apache.axis2.addressing.EndpointReference[] getEPRsForService(java.lang.String serviceName,
                                                                         java.lang.String ip)
                                                                  throws org.apache.axis2.AxisFault
Specified by:
getEPRsForService in interface org.apache.axis2.transport.TransportListener
Throws:
org.apache.axis2.AxisFault

getEPRsForService

protected org.apache.axis2.addressing.EndpointReference[] getEPRsForService(java.lang.String serviceName)

disableTransportForService

public void disableTransportForService(org.apache.axis2.description.AxisService service)

startListeningForService

protected abstract void startListeningForService(org.apache.axis2.description.AxisService service)
                                          throws org.apache.axis2.AxisFault
Throws:
org.apache.axis2.AxisFault

stopListeningForService

protected abstract void stopListeningForService(org.apache.axis2.description.AxisService service)

getEPRForService

public org.apache.axis2.addressing.EndpointReference getEPRForService(java.lang.String serviceName,
                                                                      java.lang.String ip)
                                                               throws org.apache.axis2.AxisFault
This is a deprecated method in Axis2 and this default implementation returns the first result from the getEPRsForService() method

Specified by:
getEPRForService in interface org.apache.axis2.transport.TransportListener
Throws:
org.apache.axis2.AxisFault

getSessionContext

public org.apache.axis2.context.SessionContext getSessionContext(org.apache.axis2.context.MessageContext messageContext)
Specified by:
getSessionContext in interface org.apache.axis2.transport.TransportListener

createMessageContext

public org.apache.axis2.context.MessageContext createMessageContext()
Create a new axis MessageContext for an incoming message through this transport

Returns:
the newly created message context

handleIncomingMessage

public void handleIncomingMessage(org.apache.axis2.context.MessageContext msgCtx,
                                  java.util.Map trpHeaders,
                                  java.lang.String soapAction,
                                  java.lang.String contentType)
                           throws org.apache.axis2.AxisFault
Process a new incoming message through the axis engine

Parameters:
msgCtx - the axis MessageContext
trpHeaders - the map containing transport level message headers
soapAction - the optional soap action or null
contentType - the optional content-type for the message
Throws:
org.apache.axis2.AxisFault

handleException

protected void handleException(java.lang.String msg,
                               java.lang.Exception e)
                        throws org.apache.axis2.AxisFault
Throws:
org.apache.axis2.AxisFault

logException

protected void logException(java.lang.String msg,
                            java.lang.Exception e)

getTransportName

public java.lang.String getTransportName()

getConfigurationContext

public org.apache.axis2.context.ConfigurationContext getConfigurationContext()

getMetricsCollector

public MetricsCollector getMetricsCollector()

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

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

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

Parameters:
millis - a number of milliseconds to wait until pending requests are allowed to complete
Throws:
org.apache.axis2.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

public java.util.Map getResponseCodeTable()

resetStatistics

public void resetStatistics()

getLastResetTime

public long getLastResetTime()

getMetricsWindow

public long getMetricsWindow()


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