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.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
-
-
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.FutureResponse
asyncRequest(Object command, org.apache.activemq.transport.ResponseCallback responseCallback)
TransportLoggerView
getView()
Gets the associated MBean for this TransportLogger.boolean
isLogging()
Returns true if logging is activated for this TransportLogger, false otherwise.void
onCommand(Object command)
void
oneway(Object command)
void
onException(IOException error)
Object
request(Object command)
Object
request(Object command, int timeout)
void
setLogging(boolean logging)
Sets if logging should be activated for this TransportLogger.void
setView(TransportLoggerView view)
Sets the associated MBean for this TransportLogger.void
stop()
String
toString()
-
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
-
-
-
-
Constructor Detail
-
TransportLogger
public TransportLogger(org.apache.activemq.transport.Transport next, org.slf4j.Logger log, boolean startLogging, org.apache.activemq.transport.LogWriter logWriter)
-
-
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:
request
in interfaceorg.apache.activemq.transport.Transport
- Overrides:
request
in classorg.apache.activemq.transport.TransportFilter
- Throws:
IOException
-
request
public Object request(Object command, int timeout) throws IOException
- Specified by:
request
in interfaceorg.apache.activemq.transport.Transport
- Overrides:
request
in 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:
asyncRequest
in interfaceorg.apache.activemq.transport.Transport
- Overrides:
asyncRequest
in classorg.apache.activemq.transport.TransportFilter
- Throws:
IOException
-
oneway
public void oneway(Object command) throws IOException
- Specified by:
oneway
in interfaceorg.apache.activemq.transport.Transport
- Overrides:
oneway
in classorg.apache.activemq.transport.TransportFilter
- Throws:
IOException
-
onCommand
public void onCommand(Object command)
- Specified by:
onCommand
in interfaceorg.apache.activemq.transport.TransportListener
- Overrides:
onCommand
in classorg.apache.activemq.transport.TransportFilter
-
onException
public void onException(IOException error)
- Specified by:
onException
in interfaceorg.apache.activemq.transport.TransportListener
- Overrides:
onException
in 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:
toString
in classorg.apache.activemq.transport.TransportFilter
-
-