Class 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.WSTransportSink
    A proxy class that manages sending WebSocket events to the wrapped protocol level WebSocket Transport.
    • 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:
        setBrokerService in interface org.apache.activemq.broker.BrokerServiceAware
      • oneway

        public void oneway​(Object command)
                    throws IOException
        Specified by:
        oneway in interface org.apache.activemq.transport.Transport
        Throws:
        IOException
      • getPeerCertificates

        public X509Certificate[] getPeerCertificates()
        Specified by:
        getPeerCertificates in interface org.apache.activemq.transport.Transport
      • setPeerCertificates

        public void setPeerCertificates​(X509Certificate[] certificates)
        Specified by:
        setPeerCertificates in interface org.apache.activemq.transport.Transport
      • getRemoteAddress

        public String getRemoteAddress()
        Specified by:
        getRemoteAddress in interface org.apache.activemq.transport.Transport
      • getWireFormat

        public org.apache.activemq.wireformat.WireFormat getWireFormat()
        Specified by:
        getWireFormat in interface org.apache.activemq.transport.Transport
      • getReceiveCounter

        public int getReceiveCounter()
        Specified by:
        getReceiveCounter in interface org.apache.activemq.transport.Transport
      • onWebSocketBinary

        public void onWebSocketBinary​(byte[] payload,
                                      int offset,
                                      int length)
        Specified by:
        onWebSocketBinary in interface org.eclipse.jetty.websocket.api.WebSocketListener
      • onWebSocketText

        public void onWebSocketText​(String data)
        Specified by:
        onWebSocketText in interface org.eclipse.jetty.websocket.api.WebSocketListener
      • onWebSocketClose

        public void onWebSocketClose​(int statusCode,
                                     String reason)
        Specified by:
        onWebSocketClose in interface org.eclipse.jetty.websocket.api.WebSocketConnectionListener
      • onWebSocketConnect

        public void onWebSocketConnect​(org.eclipse.jetty.websocket.api.Session session)
        Specified by:
        onWebSocketConnect in interface org.eclipse.jetty.websocket.api.WebSocketConnectionListener
      • onWebSocketError

        public void onWebSocketError​(Throwable cause)
        Specified by:
        onWebSocketError in interface org.eclipse.jetty.websocket.api.WebSocketConnectionListener
      • onSocketOutboundText

        public void onSocketOutboundText​(String data)
                                  throws IOException
        Specified by:
        onSocketOutboundText in interface org.apache.activemq.transport.ws.WSTransport.WSTransportSink
        Throws:
        IOException
      • onSocketOutboundBinary

        public void onSocketOutboundBinary​(ByteBuffer data)
                                    throws IOException
        Specified by:
        onSocketOutboundBinary in interface org.apache.activemq.transport.ws.WSTransport.WSTransportSink
        Throws:
        IOException