Package org.apache.activemq.transport.ws
Class AbstractStompSocket
- java.lang.Object
-
- org.apache.activemq.util.ServiceSupport
-
- org.apache.activemq.transport.TransportSupport
-
- org.apache.activemq.transport.ws.AbstractStompSocket
-
- All Implemented Interfaces:
org.apache.activemq.Service,StompTransport,org.apache.activemq.transport.Transport
- Direct Known Subclasses:
StompSocket
public abstract class AbstractStompSocket extends org.apache.activemq.transport.TransportSupport implements StompTransport
Base implementation of a STOMP based WebSocket handler.
-
-
Field Summary
Fields Modifier and Type Field Description protected X509Certificate[]certificatesprotected ProtocolConverterprotocolConverterprotected ReentrantLockprotocolLockprotected intreceiveCounterprotected StringremoteAddressprotected CountDownLatchsocketTransportStartedprotected StompInactivityMonitorstompInactivityMonitorprotected StompWireFormatwireFormat
-
Constructor Summary
Constructors Constructor Description AbstractStompSocket(String remoteAddress)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voiddoStart()protected voiddoStop(ServiceStopper stopper)StompInactivityMonitorgetInactivityMonitor()X509Certificate[]getPeerCertificates()intgetReceiveCounter()StringgetRemoteAddress()StompWireFormatgetWireFormat()abstract voidhandleStopped()Called when the transport is stopping to allow the dervied classes a chance to close WebSocket resources.voidoneway(Object command)protected voidprocessStompFrame(String data)voidsendToActiveMQ(org.apache.activemq.command.Command command)abstract voidsendToStomp(StompFrame command)voidsetPeerCertificates(X509Certificate[] certificates)-
Methods inherited from class org.apache.activemq.transport.TransportSupport
asyncRequest, checkStarted, doConsume, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, narrow, onException, reconnect, request, request, setTransportListener, updateURIs
-
Methods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, preStart, removeServiceListener, start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.transport.stomp.StompTransport
onException
-
-
-
-
Field Detail
-
protocolLock
protected ReentrantLock protocolLock
-
protocolConverter
protected ProtocolConverter protocolConverter
-
wireFormat
protected StompWireFormat wireFormat
-
socketTransportStarted
protected final CountDownLatch socketTransportStarted
-
stompInactivityMonitor
protected final StompInactivityMonitor stompInactivityMonitor
-
receiveCounter
protected volatile int receiveCounter
-
remoteAddress
protected final String remoteAddress
-
certificates
protected X509Certificate[] certificates
-
-
Constructor Detail
-
AbstractStompSocket
public AbstractStompSocket(String remoteAddress)
-
-
Method Detail
-
oneway
public void oneway(Object command) throws IOException
- Specified by:
onewayin interfaceorg.apache.activemq.transport.Transport- Throws:
IOException
-
sendToActiveMQ
public void sendToActiveMQ(org.apache.activemq.command.Command command)
- Specified by:
sendToActiveMQin interfaceStompTransport
-
doStop
protected void doStop(ServiceStopper stopper) throws Exception
- Specified by:
doStopin classServiceSupport- Throws:
Exception
-
doStart
protected void doStart() throws Exception- Specified by:
doStartin classServiceSupport- Throws:
Exception
-
sendToStomp
public abstract void sendToStomp(StompFrame command) throws IOException
- Specified by:
sendToStompin interfaceStompTransport- Throws:
IOException
-
handleStopped
public abstract void handleStopped() throws IOExceptionCalled when the transport is stopping to allow the dervied classes a chance to close WebSocket resources.- Throws:
IOException- if an error occurs during the stop.
-
getInactivityMonitor
public StompInactivityMonitor getInactivityMonitor()
- Specified by:
getInactivityMonitorin interfaceStompTransport
-
getWireFormat
public StompWireFormat getWireFormat()
- Specified by:
getWireFormatin interfaceStompTransport- Specified by:
getWireFormatin interfaceorg.apache.activemq.transport.Transport
-
getRemoteAddress
public String getRemoteAddress()
- Specified by:
getRemoteAddressin interfaceorg.apache.activemq.transport.Transport
-
getReceiveCounter
public int getReceiveCounter()
- Specified by:
getReceiveCounterin interfaceorg.apache.activemq.transport.Transport
-
processStompFrame
protected void processStompFrame(String data)
-
getPeerCertificates
public X509Certificate[] getPeerCertificates()
- Specified by:
getPeerCertificatesin interfaceorg.apache.activemq.transport.Transport
-
setPeerCertificates
public void setPeerCertificates(X509Certificate[] certificates)
- Specified by:
setPeerCertificatesin interfaceorg.apache.activemq.transport.Transport
-
-