Package org.apache.activemq.transport

Examples of org.apache.activemq.transport.Transport


    RemoveInfo info = new RemoveInfo(new ConnectionId("2"));
    assertNotNull("Should have received a Response", this.transport.request(info));
  }

    protected Transport createTransport() throws Exception {
      Transport transport = TransportFactory.connect(
          new URI("failover://(tcp://localhost:1234)"));
        transport.setTransportListener(new TransportListener() {

            public void onCommand(Object command) {
              commandsReceived++;
            }

            public void onException(IOException error) {
            }

            public void transportInterupted() {
            }

            public void transportResumed() {
            }
        });
        transport.start();

        this.failoverTransport = transport.narrow(FailoverTransport.class);

        return transport;
    }
View Full Code Here


        if (brokerURL == null) {
            throw new ConfigurationException("brokerURL not set.");
        }
        ActiveMQConnection connection = null;
        try {
            Transport transport = createTransport();
            connection = createActiveMQConnection(transport, factoryStats);

            connection.setUserName(userName);
            connection.setPassword(password);

            configureConnection(connection);

            transport.start();

            if (clientID != null) {
                connection.setDefaultClientID(clientID);
            }
View Full Code Here

                                } catch(Throwable e) {
                                    LOG.error("Caught an exception trying to create a JMSException for " +exception,e);
                                }
                                //dispose of transport for security exceptions
                                if (exception instanceof SecurityException){
                                    Transport t = transport;
                                    if (null != t){
                                        ServiceSupport.dispose(t);
                                    }
                                }
                                if (jmsEx !=null) {
View Full Code Here

                        } catch(Throwable e) {
                            LOG.error("Caught an exception trying to create a JMSException for " +er.getException(),e);
                        }
                        //dispose of transport for security exceptions
                        if (er.getException() instanceof SecurityException){
                            Transport t = this.transport;
                            if (null != t){
                                ServiceSupport.dispose(t);
                            }
                        }
                        if (jmsEx !=null) {
View Full Code Here

        NetworkBridgeConfiguration config = new NetworkBridgeConfiguration();
        config.setBrokerName("local");
        config.setDispatchAsync(false);
        config.setDuplex(true);

        Transport localTransport = createTransport();
        Transport remoteTransport = createRemoteTransport();
       
        // Create a network bridge between the two brokers
        bridge = new DemandForwardingBridge(config, localTransport, remoteTransport);
        bridge.setBrokerService(localBroker);
        bridge.start();
View Full Code Here

       
        return remoteBroker;
    }
   
    protected Transport createTransport() throws Exception {
        Transport transport = TransportFactory.connect(connector.getServer().getConnectURI());
        return transport;
    }
View Full Code Here

        Transport transport = TransportFactory.connect(connector.getServer().getConnectURI());
        return transport;
    }
   
    protected Transport createRemoteTransport() throws Exception {
        Transport transport = TransportFactory.connect(remoteConnector.getServer().getConnectURI());
        return transport;
    }
View Full Code Here

    protected String getLocalURI() {
        return "vm://localhost";
    }
   
    protected StubConnection createConnection() throws Exception {
        Transport transport = TransportFactory.connect(connector.getServer().getConnectURI());
        StubConnection connection = new StubConnection(transport);
        connections.add(connection);
        return connection;
    }
View Full Code Here

        connections.add(connection);
        return connection;
    }

    protected StubConnection createRemoteConnection() throws Exception {
        Transport transport = TransportFactory.connect(remoteConnector.getServer().getConnectURI());
        StubConnection connection = new StubConnection(transport);
        connections.add(connection);
        return connection;
    }
View Full Code Here

    public void sendToMQTT(MQTTFrame command) throws IOException {
        if (trace) {
            TRACE.trace("Sending: \n" + command);
        }
        Transport n = next;
        if (n != null) {
            n.oneway(command);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.transport.Transport

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.