Package org.apache.activemq.transport
Class TransportLogger
- java.lang.Object
-
- org.apache.activemq.transport.TransportFilter
-
- org.apache.activemq.transport.TransportLogger
-
- All Implemented Interfaces:
org.apache.activemq.Service,org.apache.activemq.transport.Transport,org.apache.activemq.transport.TransportListener
public class TransportLogger extends org.apache.activemq.transport.TransportFilterThis 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
-
-
Constructor Summary
Constructors Constructor Description TransportLogger(org.apache.activemq.transport.Transport next, org.slf4j.Logger log, boolean startLogging, org.apache.activemq.transport.LogWriter logWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.activemq.transport.FutureResponseasyncRequest(Object command, org.apache.activemq.transport.ResponseCallback responseCallback)TransportLoggerViewgetView()Gets the associated MBean for this TransportLogger.booleanisLogging()Returns true if logging is activated for this TransportLogger, false otherwise.voidonCommand(Object command)voidoneway(Object command)voidonException(IOException error)Objectrequest(Object command)Objectrequest(Object command, int timeout)voidsetLogging(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
- Specified by:
requestin interfaceorg.apache.activemq.transport.Transport- Overrides:
requestin classorg.apache.activemq.transport.TransportFilter- Throws:
IOException
-
request
public Object request(Object command, int timeout) throws IOException
- Specified by:
requestin interfaceorg.apache.activemq.transport.Transport- Overrides:
requestin classorg.apache.activemq.transport.TransportFilter- Throws:
IOException
-
asyncRequest
public org.apache.activemq.transport.FutureResponse asyncRequest(Object command, org.apache.activemq.transport.ResponseCallback responseCallback) throws IOException
- Specified by:
asyncRequestin interfaceorg.apache.activemq.transport.Transport- Overrides:
asyncRequestin classorg.apache.activemq.transport.TransportFilter- Throws:
IOException
-
oneway
public void oneway(Object command) throws IOException
- Specified by:
onewayin interfaceorg.apache.activemq.transport.Transport- Overrides:
onewayin classorg.apache.activemq.transport.TransportFilter- Throws:
IOException
-
onCommand
public void onCommand(Object command)
- Specified by:
onCommandin interfaceorg.apache.activemq.transport.TransportListener- Overrides:
onCommandin classorg.apache.activemq.transport.TransportFilter
-
onException
public void onException(IOException error)
- Specified by:
onExceptionin interfaceorg.apache.activemq.transport.TransportListener- Overrides:
onExceptionin classorg.apache.activemq.transport.TransportFilter
-
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 classorg.apache.activemq.transport.TransportFilter
-
-