Search in sources :

Example 21 with Transport

use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.

the class UdpTestSupport method setUp.

@Override
protected void setUp() throws Exception {
    server = createServer();
    if (server != null) {
        server.setAcceptListener(new TransportAcceptListener() {

            @Override
            public void onAccept(Transport transport) {
                consumer = transport;
                consumer.setTransportListener(UdpTestSupport.this);
                try {
                    consumer.start();
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }

            @Override
            public void onAcceptError(Exception error) {
            }
        });
        server.start();
    }
    consumer = createConsumer();
    if (consumer != null) {
        consumer.setTransportListener(this);
        consumer.start();
    }
    producer = createProducer();
    producer.setTransportListener(new TransportListener() {

        @Override
        public void onCommand(Object command) {
            LOG.info("Producer received: " + command);
        }

        @Override
        public void onException(IOException error) {
            LOG.info("Producer exception: " + error);
            error.printStackTrace();
        }

        @Override
        public void transportInterupted() {
        }

        @Override
        public void transportResumed() {
        }
    });
    producer.start();
}
Also used : TransportListener(org.apache.activemq.transport.TransportListener) IOException(java.io.IOException) Transport(org.apache.activemq.transport.Transport) TransportAcceptListener(org.apache.activemq.transport.TransportAcceptListener) IOException(java.io.IOException) MessageNotWriteableException(javax.jms.MessageNotWriteableException)

Example 22 with Transport

use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.

the class FailoverTransportBrokerTest method createConnection.

protected StubConnection createConnection() throws Exception {
    Transport transport = TransportFactory.connect(new URI(newURI(0)));
    StubConnection connection = new StubConnection(transport);
    connections.add(connection);
    return connection;
}
Also used : StubConnection(org.apache.activemq.broker.StubConnection) Transport(org.apache.activemq.transport.Transport) URI(java.net.URI)

Example 23 with Transport

use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.

the class FailoverTransportBrokerTest method createRemoteConnection.

protected StubConnection createRemoteConnection() throws Exception {
    Transport transport = TransportFactory.connect(new URI(newURI(1)));
    StubConnection connection = new StubConnection(transport);
    connections.add(connection);
    return connection;
}
Also used : StubConnection(org.apache.activemq.broker.StubConnection) Transport(org.apache.activemq.transport.Transport) URI(java.net.URI)

Example 24 with Transport

use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.

the class FanoutTransportBrokerTest method createRemoteConnection.

protected StubConnection createRemoteConnection() throws Exception {
    Transport transport = TransportFactory.connect(new URI(newURI(1)));
    StubConnection connection = new StubConnection(transport);
    connections.add(connection);
    return connection;
}
Also used : StubConnection(org.apache.activemq.broker.StubConnection) Transport(org.apache.activemq.transport.Transport) MockTransport(org.apache.activemq.transport.mock.MockTransport) URI(java.net.URI)

Example 25 with Transport

use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.

the class FanoutTransportBrokerTest method createConnection.

protected StubConnection createConnection() throws Exception {
    Transport transport = TransportFactory.connect(new URI(newURI(0)));
    StubConnection connection = new StubConnection(transport);
    connections.add(connection);
    return connection;
}
Also used : StubConnection(org.apache.activemq.broker.StubConnection) Transport(org.apache.activemq.transport.Transport) MockTransport(org.apache.activemq.transport.mock.MockTransport) URI(java.net.URI)

Aggregations

Transport (org.apache.activemq.transport.Transport)31 StubConnection (org.apache.activemq.broker.StubConnection)16 URI (java.net.URI)12 IOException (java.io.IOException)5 ActiveMQConnection (org.apache.activemq.ActiveMQConnection)5 TransportListener (org.apache.activemq.transport.TransportListener)5 FailoverTransport (org.apache.activemq.transport.failover.FailoverTransport)5 ActiveMQSessionGetter (com.navercorp.pinpoint.plugin.activemq.client.field.getter.ActiveMQSessionGetter)3 SocketGetter (com.navercorp.pinpoint.plugin.activemq.client.field.getter.SocketGetter)3 URISyntaxException (java.net.URISyntaxException)3 ActiveMQSession (org.apache.activemq.ActiveMQSession)3 ActiveMQDestination (org.apache.activemq.command.ActiveMQDestination)3 TransportAcceptListener (org.apache.activemq.transport.TransportAcceptListener)3 MockTransport (org.apache.activemq.transport.mock.MockTransport)3 TransportGetter (com.navercorp.pinpoint.plugin.activemq.client.field.getter.TransportGetter)2 Socket (java.net.Socket)2 JMSException (javax.jms.JMSException)2 ActiveMQMessage (org.apache.activemq.command.ActiveMQMessage)2 MessageDispatch (org.apache.activemq.command.MessageDispatch)2 File (java.io.File)1