org.apache.synapse.transport.base
Class AbstractTransportSender

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

public abstract class AbstractTransportSender
extends AbstractHandler
implements TransportSender


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.axis2.engine.Handler
Handler.InvocationResponse
 
Field Summary
protected  ConfigurationContext cfgCtx
          the axis2 configuration context
protected  AxisEngine engine
          an axis2 engine over the above configuration context to process messages
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
protected  String transportName
          the name of the transport
 
Fields inherited from class org.apache.axis2.handlers.AbstractHandler
handlerDesc
 
Constructor Summary
AbstractTransportSender()
           
 
Method Summary
 void cleanup(MessageContext msgContext)
           
 MessageContext createResponseMessageContext(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
 long getBytesReceived()
           
 long getBytesSent()
           
 long getFaultsReceiving()
           
 long getFaultsSending()
           
 long getMessagesReceived()
           
 long getMessagesSent()
           
 int getQueueSize()
          Return the number of requests queued in the thread pool
 String getTransportName()
           
protected  void handleException(String msg)
           
protected  void handleException(String msg, Exception e)
           
 void handleIncomingMessage(MessageContext msgCtx, Map trpHeaders, String soapAction, String contentType)
          Process a new incoming message (Response) through the axis engine
 void init(ConfigurationContext cfgCtx, TransportOutDescription transportOut)
          Initialize the generic transport sender.
 Handler.InvocationResponse invoke(MessageContext msgContext)
           
protected  void logException(String msg, Exception e)
           
 void maintenenceShutdown(long millis)
           
 void pause()
           
 void resume()
           
abstract  void sendMessage(MessageContext msgCtx, String targetEPR, OutTransportInfo outTransportInfo)
           
 void setTransportName(String transportName)
           
 void stop()
           
protected  boolean waitForSynchronousResponse(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


transportName

protected String transportName
the name of the transport


cfgCtx

protected ConfigurationContext cfgCtx
the axis2 configuration context


engine

protected AxisEngine engine
an axis2 engine over the above configuration context to process messages


metrics

protected MetricsCollector metrics
Metrics collector for the sender

Constructor Detail

AbstractTransportSender

public AbstractTransportSender()
Method Detail

init

public void init(ConfigurationContext cfgCtx,
                 TransportOutDescription transportOut)
          throws AxisFault
Initialize the generic transport sender.

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

stop

public void stop()
Specified by:
stop in interface TransportSender

cleanup

public void cleanup(MessageContext msgContext)
             throws AxisFault
Specified by:
cleanup in interface TransportSender
Throws:
AxisFault

sendMessage

public abstract void sendMessage(MessageContext msgCtx,
                                 String targetEPR,
                                 OutTransportInfo outTransportInfo)
                          throws AxisFault
Throws:
AxisFault

invoke

public Handler.InvocationResponse invoke(MessageContext msgContext)
                                  throws AxisFault
Specified by:
invoke in interface Handler
Throws:
AxisFault

handleIncomingMessage

public void handleIncomingMessage(MessageContext msgCtx,
                                  Map trpHeaders,
                                  String soapAction,
                                  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 MessageContext createResponseMessageContext(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(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 String getTransportName()

setTransportName

public void setTransportName(String transportName)

handleException

protected void handleException(String msg,
                               Exception e)
                        throws AxisFault
Throws:
AxisFault

handleException

protected void handleException(String msg)
                        throws AxisFault
Throws:
AxisFault

logException

protected void logException(String msg,
                            Exception e)

pause

public void pause()
           throws AxisFault
Throws:
AxisFault

resume

public void resume()
            throws AxisFault
Throws:
AxisFault

maintenenceShutdown

public void maintenenceShutdown(long millis)
                         throws AxisFault
Throws:
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()


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.