org.apache.activemq.artemis.core.server.ActiveMQComponent

Here are the examples of the java api class org.apache.activemq.artemis.core.server.ActiveMQComponent taken from open source projects.

1. FileBroker#start()

Project: activemq-artemis
Source File: FileBroker.java
View license
@Override
public synchronized void start() throws Exception {
    if (started) {
        return;
    }
    //todo if we start to pullout more configs from the main config then we should pull out the configuration objects from factories if available
    FileConfiguration configuration = new FileConfiguration();
    FileJMSConfiguration jmsConfiguration = new FileJMSConfiguration();
    FileDeploymentManager fileDeploymentManager = new FileDeploymentManager(configurationUrl);
    fileDeploymentManager.addDeployable(configuration).addDeployable(jmsConfiguration);
    fileDeploymentManager.readConfiguration();
    components = fileDeploymentManager.buildService(securityManager, ManagementFactory.getPlatformMBeanServer());
    ArrayList<ActiveMQComponent> componentsByStartOrder = getComponentsByStartOrder(components);
    ActiveMQBootstrapLogger.LOGGER.serverStarting();
    for (ActiveMQComponent component : componentsByStartOrder) {
        component.start();
    }
    started = true;
}

2. FileBroker#stop()

Project: activemq-artemis
Source File: FileBroker.java
View license
@Override
public void stop() throws Exception {
    if (!started) {
        return;
    }
    ActiveMQComponent[] mqComponents = new ActiveMQComponent[components.size()];
    components.values().toArray(mqComponents);
    for (int i = mqComponents.length - 1; i >= 0; i--) {
        mqComponents[i].stop();
    }
    started = false;
}

3. FileBroker#getComponentsByStartOrder()

Project: activemq-artemis
Source File: FileBroker.java
View license
/*
   * this makes sure the components are started in the correct order. Its simple at the mo as e only have core and jms but
   * will need impproving if we get more.
   * */
public ArrayList<ActiveMQComponent> getComponentsByStartOrder(Map<String, ActiveMQComponent> components) {
    ArrayList<ActiveMQComponent> activeMQComponents = new ArrayList<>();
    ActiveMQComponent jmsComponent = components.get("jms");
    if (jmsComponent != null) {
        activeMQComponents.add(jmsComponent);
    }
    activeMQComponents.add(components.get("core"));
    return activeMQComponents;
}

4. OsgiBroker#getComponentsByStartOrder()

Project: activemq-artemis
Source File: OsgiBroker.java
View license
/*
    * this makes sure the components are started in the correct order. Its
    * simple at the mo as e only have core and jms but will need impproving if
    * we get more.
    */
public ArrayList<ActiveMQComponent> getComponentsByStartOrder(Map<String, ActiveMQComponent> components) {
    ArrayList<ActiveMQComponent> activeMQComponents = new ArrayList<>();
    ActiveMQComponent jmsComponent = components.get("jms");
    if (jmsComponent != null) {
        activeMQComponents.add(jmsComponent);
    }
    activeMQComponents.add(components.get("core"));
    return activeMQComponents;
}

5. DiscoveryTest#tearDown()

Project: activemq-artemis
Source File: DiscoveryTest.java
View license
@Override
@After
public void tearDown() throws Exception {
    /** This file path is defined at {@link #TEST_JGROUPS_CONF_FILE} */
    deleteDirectory(new File("./target/tmp/amqtest.ping.dir"));
    for (ActiveMQComponent component : new ActiveMQComponent[] { bg, bg1, bg2, bg3, dg, dg1, dg2, dg3 }) {
        stopComponent(component);
    }
    super.tearDown();
}