Package org.apache.activemq.transport
Class TransportLogger
- java.lang.Object
-
- org.apache.activemq.transport.TransportFilter
-
- org.apache.activemq.transport.TransportLogger
-
- All Implemented Interfaces:
Service,Transport,TransportListener
public class TransportLogger extends TransportFilter
This TransportFilter implementation writes output to a log as it intercepts commands / events before sending them to the following layer in the Transport stack.- Author:
- David Martin Clavo david(dot)martin(dot)clavo(at)gmail.com
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.transport.TransportFilter
next, transportListener
-
-
Constructor Summary
Constructors Constructor Description TransportLogger(Transport next, org.slf4j.Logger log, boolean startLogging, LogWriter logWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FutureResponseasyncRequest(Object command, ResponseCallback responseCallback)An asynchronous request response where the Receipt will be returned in the future.TransportLoggerViewgetView()Gets the associated MBean for this TransportLogger.booleanisLogging()Returns true if logging is activated for this TransportLogger, false otherwise.voidonCommand(Object command)called to process a commandvoidoneway(Object command)A one way asynchronous sendvoidonException(IOException error)An unrecoverable exception has occured on the transportObjectrequest(Object command)A synchronous request responseObjectrequest(Object command, int timeout)A synchronous request responsevoidsetLogging(boolean logging)Sets if logging should be activated for this TransportLogger.voidsetView(TransportLoggerView view)Sets the associated MBean for this TransportLogger.voidstop()StringtoString()-
Methods inherited from class org.apache.activemq.transport.TransportFilter
getNext, getPeerCertificates, getReceiveCounter, getRemoteAddress, getTransportListener, getWireFormat, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, narrow, reconnect, setPeerCertificates, setTransportListener, start, transportInterupted, transportResumed, updateURIs
-
-
-
-
Method Detail
-
isLogging
public boolean isLogging()
Returns true if logging is activated for this TransportLogger, false otherwise.- Returns:
- true if logging is activated for this TransportLogger, false otherwise.
-
setLogging
public void setLogging(boolean logging)
Sets if logging should be activated for this TransportLogger.- Parameters:
logging- true to activate logging, false to deactivate.
-
request
public Object request(Object command) throws IOException
Description copied from interface:TransportA synchronous request response- Specified by:
requestin interfaceTransport- Overrides:
requestin classTransportFilter- Returns:
- the response
- Throws:
IOException
-
request
public Object request(Object command, int timeout) throws IOException
Description copied from interface:TransportA synchronous request response- Specified by:
requestin interfaceTransport- Overrides:
requestin classTransportFilter- Returns:
- the repsonse or null if timeout
- Throws:
IOException
-
asyncRequest
public FutureResponse asyncRequest(Object command, ResponseCallback responseCallback) throws IOException
Description copied from interface:TransportAn asynchronous request response where the Receipt will be returned in the future. If responseCallback is not null, then it will be called when the response has been completed.- Specified by:
asyncRequestin interfaceTransport- Overrides:
asyncRequestin classTransportFilterresponseCallback- TODO- Returns:
- the FutureResponse
- Throws:
IOException
-
oneway
public void oneway(Object command) throws IOException
Description copied from interface:TransportA one way asynchronous send- Specified by:
onewayin interfaceTransport- Overrides:
onewayin classTransportFilter- Throws:
IOException
-
onCommand
public void onCommand(Object command)
Description copied from interface:TransportListenercalled to process a command- Specified by:
onCommandin interfaceTransportListener- Overrides:
onCommandin classTransportFilter
-
onException
public void onException(IOException error)
Description copied from interface:TransportListenerAn unrecoverable exception has occured on the transport- Specified by:
onExceptionin interfaceTransportListener- Overrides:
onExceptionin classTransportFilter
-
getView
public TransportLoggerView getView()
Gets the associated MBean for this TransportLogger.- Returns:
- the associated MBean for this TransportLogger.
-
setView
public void setView(TransportLoggerView view)
Sets the associated MBean for this TransportLogger.- Parameters:
view- the associated MBean for this TransportLogger.
-
toString
public String toString()
- Overrides:
toStringin classTransportFilter
-
stop
public void stop() throws Exception- Specified by:
stopin interfaceService- Overrides:
stopin classTransportFilter- Throws:
Exception- See Also:
Service.stop()
-
-