org.apache.axis2.transport.base
Class AbstractTransportSender

java.lang.Object
  extended by org.apache.axis2.handlers.AbstractHandler
      extended by org.apache.axis2.transport.base.AbstractTransportSender
All Implemented Interfaces:
org.apache.axis2.engine.Handler, org.apache.axis2.transport.TransportSender
Direct Known Subclasses:
JMSSender, MailTransportSender, SMSSender, UDPSender

public abstract class AbstractTransportSender
extends org.apache.axis2.handlers.AbstractHandler
implements org.apache.axis2.transport.TransportSender


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.axis2.engine.Handler
org.apache.axis2.engine.Handler.InvocationResponse
 
Field Summary
protected  org.apache.axis2.context.ConfigurationContext cfgCtx
          the axis2 configuration context
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 the sender
 
Fields inherited from class org.apache.axis2.handlers.AbstractHandler
handlerDesc
 
Constructor Summary
protected AbstractTransportSender()
          A constructor that makes subclasses pick up the correct logger
 
Method Summary
 void cleanup(org.apache.axis2.context.MessageContext msgContext)
           
 org.apache.axis2.context.MessageContext createResponseMessageContext(org.apache.axis2.context.MessageContext outMsgCtx)
          Create a new axis MessageContext for an incoming response message through this transport, for the given outgoing message
 int getActiveThreadCount()
          Returns the number of active threads processing messages
 double getAvgSizeReceived()
           
 double getAvgSizeSent()
           
 long getBytesReceived()
           
 long getBytesSent()
           
 long getFaultsReceiving()
           
 long getFaultsSending()
           
 long getLastResetTime()
           
 long getMaxSizeReceived()
           
 long getMaxSizeSent()
           
 long getMessagesReceived()
           
 long getMessagesSent()
           
 long getMetricsWindow()
           
 long getMinSizeReceived()
           
 long getMinSizeSent()
           
 int getQueueSize()
          Return the number of requests queued in the thread pool
 java.util.Map getResponseCodeTable()
           
 long getTimeoutsReceiving()
           
 long getTimeoutsSending()
           
 java.lang.String getTransportName()
           
protected  void handleException(java.lang.String msg)
           
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 (Response) through the axis engine
 void init(org.apache.axis2.context.ConfigurationContext cfgCtx, org.apache.axis2.description.TransportOutDescription transportOut)
          Initialize the generic transport sender.
 org.apache.axis2.engine.Handler.InvocationResponse invoke(org.apache.axis2.context.MessageContext msgContext)
           
protected  void logException(java.lang.String msg, java.lang.Exception e)
           
 void maintenenceShutdown(long millis)
           
 void pause()
           
 void resetStatistics()
           
 void resume()
           
abstract  void sendMessage(org.apache.axis2.context.MessageContext msgCtx, java.lang.String targetEPR, org.apache.axis2.transport.OutTransportInfo outTransportInfo)
           
 void stop()
           
protected  boolean waitForSynchronousResponse(org.apache.axis2.context.MessageContext msgCtx)
          Should the transport sender wait for a synchronous response to be received?
 
Methods inherited from class org.apache.axis2.handlers.AbstractHandler
cleanup, flowComplete, getHandlerDesc, getName, getParameter, init, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.axis2.engine.Handler
cleanup, flowComplete, getHandlerDesc, getName, getParameter, init
 

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


metrics

protected MetricsCollector metrics
Metrics collector for the sender

Constructor Detail

AbstractTransportSender

protected AbstractTransportSender()
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.TransportOutDescription transportOut)
          throws org.apache.axis2.AxisFault
Initialize the generic transport sender.

Specified by:
init in interface org.apache.axis2.transport.TransportSender
Parameters:
cfgCtx - the axis configuration context
transportOut - the transport-out description
Throws:
org.apache.axis2.AxisFault - on error

stop

public void stop()
Specified by:
stop in interface org.apache.axis2.transport.TransportSender

cleanup

public void cleanup(org.apache.axis2.context.MessageContext msgContext)
             throws org.apache.axis2.AxisFault
Specified by:
cleanup in interface org.apache.axis2.transport.TransportSender
Throws:
org.apache.axis2.AxisFault

sendMessage

public abstract void sendMessage(org.apache.axis2.context.MessageContext msgCtx,
                                 java.lang.String targetEPR,
                                 org.apache.axis2.transport.OutTransportInfo outTransportInfo)
                          throws org.apache.axis2.AxisFault
Throws:
org.apache.axis2.AxisFault

invoke

public org.apache.axis2.engine.Handler.InvocationResponse invoke(org.apache.axis2.context.MessageContext msgContext)
                                                          throws org.apache.axis2.AxisFault
Specified by:
invoke in interface org.apache.axis2.engine.Handler
Throws:
org.apache.axis2.AxisFault

handleIncomingMessage

public 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 (Response) 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

createResponseMessageContext

public org.apache.axis2.context.MessageContext createResponseMessageContext(org.apache.axis2.context.MessageContext outMsgCtx)
Create a new axis MessageContext for an incoming response message through this transport, for the given outgoing message

Parameters:
outMsgCtx - the outgoing message
Returns:
the newly created message context

waitForSynchronousResponse

protected boolean waitForSynchronousResponse(org.apache.axis2.context.MessageContext msgCtx)
Should the transport sender wait for a synchronous response to be received?

Parameters:
msgCtx - the outgoing message context
Returns:
true if a sync response is expected

getTransportName

public java.lang.String getTransportName()

handleException

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

handleException

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

logException

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

pause

public void pause()
           throws org.apache.axis2.AxisFault
Throws:
org.apache.axis2.AxisFault

resume

public void resume()
            throws org.apache.axis2.AxisFault
Throws:
org.apache.axis2.AxisFault

maintenenceShutdown

public void maintenenceShutdown(long millis)
                         throws org.apache.axis2.AxisFault
Throws:
org.apache.axis2.AxisFault

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.