Package org.apache.activemq.transport.ws
Class WSTransportProxy
- java.lang.Object
-
- org.apache.activemq.util.ServiceSupport
-
- org.apache.activemq.transport.TransportSupport
-
- org.apache.activemq.transport.ws.WSTransportProxy
-
- All Implemented Interfaces:
org.apache.activemq.broker.BrokerServiceAware,org.apache.activemq.Service,org.apache.activemq.transport.Transport,org.apache.activemq.transport.ws.WSTransport.WSTransportSink,org.eclipse.jetty.websocket.api.WebSocketConnectionListener,org.eclipse.jetty.websocket.api.WebSocketListener
public final class WSTransportProxy extends org.apache.activemq.transport.TransportSupport implements org.apache.activemq.transport.Transport, org.eclipse.jetty.websocket.api.WebSocketListener, org.apache.activemq.broker.BrokerServiceAware, org.apache.activemq.transport.ws.WSTransport.WSTransportSinkA proxy class that manages sending WebSocket events to the wrapped protocol level WebSocket Transport.
-
-
Constructor Summary
Constructors Constructor Description WSTransportProxy(String remoteAddress, org.apache.activemq.transport.Transport transport)Create a WebSocket Transport Proxy instance that will pass along WebSocket event to the underlying protocol level transport.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoStart()protected voiddoStop(ServiceStopper stopper)X509Certificate[]getPeerCertificates()intgetReceiveCounter()StringgetRemoteAddress()StringgetSubProtocol()org.apache.activemq.wireformat.WireFormatgetWireFormat()voidoneway(Object command)voidonSocketOutboundBinary(ByteBuffer data)voidonSocketOutboundText(String data)voidonWebSocketBinary(byte[] payload, int offset, int length)voidonWebSocketClose(int statusCode, String reason)voidonWebSocketConnect(org.eclipse.jetty.websocket.api.Session session)voidonWebSocketError(Throwable cause)voidonWebSocketText(String data)voidsetBrokerService(org.apache.activemq.broker.BrokerService brokerService)voidsetPeerCertificates(X509Certificate[] certificates)voidsetTransportOptions(Map<String,Object> options)Apply any configure Transport options on the wrapped Transport and its contained wireFormat instance.-
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
-
-
-
-
Constructor Detail
-
WSTransportProxy
public WSTransportProxy(String remoteAddress, org.apache.activemq.transport.Transport transport)
Create a WebSocket Transport Proxy instance that will pass along WebSocket event to the underlying protocol level transport.- Parameters:
remoteAddress- the provided remote address to report being connected to.transport- The protocol level WebSocket Transport
-
-
Method Detail
-
getSubProtocol
public String getSubProtocol()
- Returns:
- the sub-protocol of the proxied transport.
-
setTransportOptions
public void setTransportOptions(Map<String,Object> options)
Apply any configure Transport options on the wrapped Transport and its contained wireFormat instance.
-
setBrokerService
public void setBrokerService(org.apache.activemq.broker.BrokerService brokerService)
- Specified by:
setBrokerServicein interfaceorg.apache.activemq.broker.BrokerServiceAware
-
oneway
public void oneway(Object command) throws IOException
- Specified by:
onewayin interfaceorg.apache.activemq.transport.Transport- Throws:
IOException
-
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
-
getRemoteAddress
public String getRemoteAddress()
- Specified by:
getRemoteAddressin interfaceorg.apache.activemq.transport.Transport
-
getWireFormat
public org.apache.activemq.wireformat.WireFormat getWireFormat()
- Specified by:
getWireFormatin interfaceorg.apache.activemq.transport.Transport
-
getReceiveCounter
public int getReceiveCounter()
- Specified by:
getReceiveCounterin interfaceorg.apache.activemq.transport.Transport
-
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
-
onWebSocketBinary
public void onWebSocketBinary(byte[] payload, int offset, int length)- Specified by:
onWebSocketBinaryin interfaceorg.eclipse.jetty.websocket.api.WebSocketListener
-
onWebSocketText
public void onWebSocketText(String data)
- Specified by:
onWebSocketTextin interfaceorg.eclipse.jetty.websocket.api.WebSocketListener
-
onWebSocketClose
public void onWebSocketClose(int statusCode, String reason)- Specified by:
onWebSocketClosein interfaceorg.eclipse.jetty.websocket.api.WebSocketConnectionListener
-
onWebSocketConnect
public void onWebSocketConnect(org.eclipse.jetty.websocket.api.Session session)
- Specified by:
onWebSocketConnectin interfaceorg.eclipse.jetty.websocket.api.WebSocketConnectionListener
-
onWebSocketError
public void onWebSocketError(Throwable cause)
- Specified by:
onWebSocketErrorin interfaceorg.eclipse.jetty.websocket.api.WebSocketConnectionListener
-
onSocketOutboundText
public void onSocketOutboundText(String data) throws IOException
- Specified by:
onSocketOutboundTextin interfaceorg.apache.activemq.transport.ws.WSTransport.WSTransportSink- Throws:
IOException
-
onSocketOutboundBinary
public void onSocketOutboundBinary(ByteBuffer data) throws IOException
- Specified by:
onSocketOutboundBinaryin interfaceorg.apache.activemq.transport.ws.WSTransport.WSTransportSink- Throws:
IOException
-
-