Class StompTransportFilter
- java.lang.Object
-
- org.apache.activemq.transport.TransportFilter
-
- org.apache.activemq.transport.stomp.StompTransportFilter
-
- All Implemented Interfaces:
Service
,StompTransport
,Transport
,TransportListener
public class StompTransportFilter extends TransportFilter implements StompTransport
The StompTransportFilter normally sits on top of a TcpTransport that has been configured with the StompWireFormat and is used to convert STOMP commands to ActiveMQ commands. All of the conversion work is done by delegating to the ProtocolConverter.- Author:
- chirino
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.transport.TransportFilter
next, transportListener
-
-
Constructor Summary
Constructors Constructor Description StompTransportFilter(Transport next, WireFormat wireFormat, BrokerContext brokerContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getConnectAttemptTimeout()
String
getDefaultHeartBeat()
float
getHbGracePeriodMultiplier()
Returns the currently configured Read check grace period multiplier.StompInactivityMonitor
getInactivityMonitor()
int
getMaxDataLength()
long
getMaxFrameSize()
StompWireFormat
getWireFormat()
Retrieves the WireFormat instance associated with this Transport instance.boolean
isTrace()
void
onCommand(Object command)
called to process a commandvoid
oneway(Object o)
A one way asynchronous sendvoid
sendToActiveMQ(Command command)
void
sendToStomp(StompFrame command)
void
setConnectAttemptTimeout(long timeout)
void
setDefaultHeartBeat(String defaultHeartBeat)
void
setHbGracePeriodMultiplier(float hbGracePeriodMultiplier)
Sets the read check grace period multiplier.void
setInactivityMonitor(StompInactivityMonitor monitor)
void
setMaxDataLength(int maxDataLength)
Sets the maximum number of bytes that the data portion of a STOMP frame is allowed to be, any incoming STOMP frame with a data section larger than this value will receive an error response.void
setMaxFrameSize(int maxFrameSize)
void
setTrace(boolean trace)
void
start()
-
Methods inherited from class org.apache.activemq.transport.TransportFilter
asyncRequest, getNext, getPeerCertificates, getReceiveCounter, getRemoteAddress, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, narrow, onException, reconnect, request, request, setPeerCertificates, setTransportListener, stop, toString, transportInterupted, transportResumed, updateURIs
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.transport.stomp.StompTransport
onException
-
-
-
-
Constructor Detail
-
StompTransportFilter
public StompTransportFilter(Transport next, WireFormat wireFormat, BrokerContext brokerContext)
-
-
Method Detail
-
start
public void start() throws Exception
- Specified by:
start
in interfaceService
- Overrides:
start
in classTransportFilter
- Throws:
Exception
- See Also:
Service.start()
-
oneway
public void oneway(Object o) throws IOException
Description copied from interface:Transport
A one way asynchronous send- Specified by:
oneway
in interfaceTransport
- Overrides:
oneway
in classTransportFilter
- Throws:
IOException
-
onCommand
public void onCommand(Object command)
Description copied from interface:TransportListener
called to process a command- Specified by:
onCommand
in interfaceTransportListener
- Overrides:
onCommand
in classTransportFilter
-
sendToActiveMQ
public void sendToActiveMQ(Command command)
- Specified by:
sendToActiveMQ
in interfaceStompTransport
-
sendToStomp
public void sendToStomp(StompFrame command) throws IOException
- Specified by:
sendToStomp
in interfaceStompTransport
- Throws:
IOException
-
isTrace
public boolean isTrace()
-
setTrace
public void setTrace(boolean trace)
-
getInactivityMonitor
public StompInactivityMonitor getInactivityMonitor()
- Specified by:
getInactivityMonitor
in interfaceStompTransport
-
setInactivityMonitor
public void setInactivityMonitor(StompInactivityMonitor monitor)
-
getWireFormat
public StompWireFormat getWireFormat()
Description copied from interface:Transport
Retrieves the WireFormat instance associated with this Transport instance.- Specified by:
getWireFormat
in interfaceStompTransport
- Specified by:
getWireFormat
in interfaceTransport
- Overrides:
getWireFormat
in classTransportFilter
- Returns:
- the WireFormat in use.
-
getDefaultHeartBeat
public String getDefaultHeartBeat()
-
setDefaultHeartBeat
public void setDefaultHeartBeat(String defaultHeartBeat)
-
getHbGracePeriodMultiplier
public float getHbGracePeriodMultiplier()
Returns the currently configured Read check grace period multiplier.- Returns:
- the hbGracePeriodMultiplier
-
setHbGracePeriodMultiplier
public void setHbGracePeriodMultiplier(float hbGracePeriodMultiplier)
Sets the read check grace period multiplier. New CONNECT frames that indicate a heart beat value with a read check interval will have that value multiplied by this value to add a grace period before the connection is considered invalid. By default this value is set to zero and no grace period is given. When set the value must be larger than 1.0 or it will be ignored.- Parameters:
hbGracePeriodMultiplier
- the hbGracePeriodMultiplier to set
-
setMaxDataLength
public void setMaxDataLength(int maxDataLength)
Sets the maximum number of bytes that the data portion of a STOMP frame is allowed to be, any incoming STOMP frame with a data section larger than this value will receive an error response.- Parameters:
maxDataLength
- size in bytes of the maximum data portion of a STOMP frame.
-
getMaxDataLength
public int getMaxDataLength()
-
setMaxFrameSize
public void setMaxFrameSize(int maxFrameSize)
-
getMaxFrameSize
public long getMaxFrameSize()
-
getConnectAttemptTimeout
public long getConnectAttemptTimeout()
-
setConnectAttemptTimeout
public void setConnectAttemptTimeout(long timeout)
-
-