Examples of BrokerService


Examples of org.apache.activemq.broker.BrokerService

        if (this.disabled) {
            return;
        }
        URI uri = new URI("tcp", null, bind, this.port, null, null, null);

        broker = new BrokerService();
        broker.setPersistent(false);
        broker.addConnector(uri);
    }
View Full Code Here

Examples of org.apache.activemq.broker.BrokerService

    @Override
    public void setUp() throws Exception {
        port = AvailablePortFinder.getNextAvailable(61613);

        brokerService = new BrokerService();
        brokerService.setPersistent(false);
        brokerService.setAdvisorySupport(false);
        brokerService.addConnector("stomp://localhost:" + getPort() + "?trace=true");
        brokerService.start();
        brokerService.waitUntilStarted();
View Full Code Here

Examples of org.apache.activemq.broker.BrokerService

                if (brokerUri != null) {
                    brokerService = BrokerFactory.createBroker(new URI(brokerUri));
                    brokerName = brokerService.getBrokerName();
                }
                else {
                    brokerService = new BrokerService();
                    if (brokerName != null) {
                        brokerService.setBrokerName(brokerName);
                    }
                    else {
                        brokerName = brokerService.getBrokerName();
View Full Code Here

Examples of org.apache.activemq.broker.BrokerService

        }
    }

    public synchronized void doStop() throws Exception {
        if (brokerService != null) {
            BrokerService temp = brokerService;
            brokerService = null;
            try {
                temp.stop();
            } catch (JMSException ignored) {
                // just a lame exception ActiveMQ likes to throw on shutdown
                if (!(ignored.getCause() instanceof TransportDisposedIOException)) {
                    throw ignored;
                }
View Full Code Here

Examples of org.apache.activemq.broker.BrokerService

        }
    }

    public synchronized void doFail() {
        if (brokerService != null) {
            BrokerService temp = brokerService;
            brokerService = null;
            try {
                temp.stop();
            } catch (JMSException ignored) {
                // just a lame exception ActiveMQ likes to throw on shutdown
                if (!(ignored.getCause() instanceof TransportDisposedIOException)) {
                    log.warn("Caught while closing due to failure: " + ignored, ignored);
                }
View Full Code Here

Examples of org.apache.activemq.broker.BrokerService

                if (brokerUri != null) {
                    brokerService = BrokerFactory.createBroker(new URI(brokerUri));
                    brokerName = brokerService.getBrokerName();
                }
                else {
                    brokerService = new BrokerService();
                    if (brokerName != null) {
                        brokerService.setBrokerName(brokerName);
                    }
                    else {
                        brokerName = brokerService.getBrokerName();
View Full Code Here

Examples of org.apache.activemq.broker.BrokerService

        }
    }

    public synchronized void doStop() throws Exception {
        if (brokerService != null) {
            BrokerService temp = brokerService;
            brokerService = null;
            try {
                temp.stop();
            } catch (JMSException ignored) {
                // just a lame exception ActiveMQ likes to throw on shutdown
                if (!(ignored.getCause() instanceof TransportDisposedIOException)) {
                    throw ignored;
                }
View Full Code Here

Examples of org.apache.activemq.broker.BrokerService

        }
    }

    public synchronized void doFail() {
        if (brokerService != null) {
            BrokerService temp = brokerService;
            brokerService = null;
            try {
                temp.stop();
            } catch (JMSException ignored) {
                // just a lame exception ActiveMQ likes to throw on shutdown
                if (!(ignored.getCause() instanceof TransportDisposedIOException)) {
                    log.warn("Caught while closing due to failure: " + ignored, ignored);
                }
View Full Code Here

Examples of org.apache.activemq.broker.BrokerService

            }
        }
       
        public void run() {
            try
                BrokerService broker = new BrokerService();
                synchronized (this) {                                    
                    broker.setPersistenceAdapter(new MemoryPersistenceAdapter());                   
                    broker.setTmpDataDirectory(new File("./target"));
                    broker.addConnector(brokerUrl);
                    broker.start();
                    Thread.sleep(200);
                    notifyAll();
                }
                synchronized (this) {
                    while (!shutdownBroker) {
                        wait(1000);
                    }
                }               
                broker.stop();             
            } catch (Exception e) {
                exception = e;
                e.printStackTrace();
            }
        }
View Full Code Here

Examples of org.apache.activemq.broker.BrokerService

    }


    @Override
    protected void setUp() throws Exception {
        brokerService = new BrokerService();
        brokerService.setPersistent(false);
        brokerService.start();

        super.setUp();
    }
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.