Examples of DefaultTransportListener


Examples of org.apache.activemq.transport.DefaultTransportListener

        serviceRemoteCommand(remoteBrokerInfo);
    }

    public void start() throws Exception {
        if (started.compareAndSet(false, true)) {
            localBroker.setTransportListener(new DefaultTransportListener() {

                @Override
                public void onCommand(Object o) {
                    Command command = (Command) o;
                    serviceLocalCommand(command);
View Full Code Here

Examples of org.apache.activemq.transport.DefaultTransportListener

    public void start() throws Exception {
        LOG.info("Starting a network connection between " + localBroker + " and " + remoteBroker
                 + " has been established.");

        localBroker.setTransportListener(new DefaultTransportListener() {
            public void onCommand(Object o) {
                Command command = (Command)o;
                serviceLocalCommand(command);
            }

            public void onException(IOException error) {
                serviceLocalException(error);
            }
        });

        remoteBroker.setTransportListener(new DefaultTransportListener() {
            public void onCommand(Object o) {
                Command command = (Command)o;
                serviceRemoteCommand(command);
            }
View Full Code Here

Examples of org.apache.activemq.transport.DefaultTransportListener

            throw new IllegalArgumentException("You must specify a remoteURI");
        }
        localBroker = TransportFactory.connect(localURI);
        remoteBroker = TransportFactory.connect(remoteURI);
        LOG.info("Starting a slave connection between " + localBroker + " and " + remoteBroker);
        localBroker.setTransportListener(new DefaultTransportListener() {

            public void onCommand(Object command) {
            }

            public void onException(IOException error) {
                if (started.get()) {
                    serviceLocalException(error);
                }
            }
        });
        remoteBroker.setTransportListener(new DefaultTransportListener() {

            public void onCommand(Object o) {
                Command command = (Command)o;
                if (started.get()) {
                    serviceRemoteCommand(command);
                }
            }

            public void onException(IOException error) {
                if (started.get()) {
                    serviceRemoteException(error);
                }
            }
           
            public void transportResumed() {
              try{
                if(!firstConnection){
                  localBroker = TransportFactory.connect(localURI);
                  localBroker.setTransportListener(new DefaultTransportListener() {
 
                          public void onCommand(Object command) {
                          }
 
                          public void onException(IOException error) {
View Full Code Here

Examples of org.apache.activemq.transport.DefaultTransportListener

        if (connector != null) {
            this.statistics.setParent(connector.getStatistics());
        }
        this.taskRunnerFactory = taskRunnerFactory;
        this.transport = transport;
        this.transport.setTransportListener(new DefaultTransportListener() {
            @Override
            public void onCommand(Object o) {
                serviceLock.readLock().lock();
                try {
                    if (!(o instanceof Command)) {
View Full Code Here

Examples of org.apache.activemq.transport.DefaultTransportListener

        serviceRemoteCommand(remoteBrokerInfo);
    }

    public void start() throws Exception {
        if (started.compareAndSet(false, true)) {
            localBroker.setTransportListener(new DefaultTransportListener() {

                @Override
                public void onCommand(Object o) {
                    Command command = (Command) o;
                    serviceLocalCommand(command);
View Full Code Here

Examples of org.apache.activemq.transport.DefaultTransportListener

        if (connector != null) {
            this.statistics.setParent(connector.getStatistics());
        }
        this.taskRunnerFactory = taskRunnerFactory;
        this.transport = transport;
        this.transport.setTransportListener(new DefaultTransportListener() {
            @Override
            public void onCommand(Object o) {
                serviceLock.readLock().lock();
                try {
                    if (!(o instanceof Command)) {
View Full Code Here

Examples of org.apache.activemq.transport.DefaultTransportListener

        this.localBroker = localBroker;
        this.remoteBroker = remoteBroker;
    }

    public void start() throws Exception {
        localBroker.setTransportListener(new DefaultTransportListener(){
            public void onCommand(Object o){
              Command command = (Command) o;
                serviceLocalCommand(command);
            }
   
View Full Code Here

Examples of org.apache.activemq.transport.DefaultTransportListener

        this.connection = connection;
    }

    public StubConnection(Transport transport) throws Exception {
        this.transport = transport;
        transport.setTransportListener(new DefaultTransportListener() {
            public void onCommand(Object command) {
                try {
                    if (command.getClass() == ShutdownInfo.class) {
                        shuttingDown = true;
                    }
View Full Code Here

Examples of org.apache.activemq.transport.DefaultTransportListener

            taskRunner = null;
        }       
       
        connector.setBrokerName(broker.getBrokerName());
        this.transport = transport;
        this.transport.setTransportListener(new DefaultTransportListener() {
            public void onCommand(Object o) {
              Command command = (Command) o;
                Response response = service(command);
                if (response != null) {
                    dispatchSync(response);
View Full Code Here

Examples of org.apache.activemq.transport.DefaultTransportListener

    }

    public void start() throws Exception {
        log.info("Starting a network connection between " + localBroker + " and " + remoteBroker + " has been established.");

        localBroker.setTransportListener(new DefaultTransportListener(){
            public void onCommand(Object o) {
              Command command = (Command) o;
                serviceLocalCommand(command);
            }
            public void onException(IOException error) {
                serviceLocalException(error);
            }
        });
       
        remoteBroker.setTransportListener(new DefaultTransportListener(){
            public void onCommand(Object o) {
              Command command = (Command) o;
                serviceRemoteCommand(command);
            }
            public void onException(IOException error) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.