use of org.apache.activemq.artemis.dto.ComponentDTO in project activemq-artemis by apache.
the class Run method execute.
@Override
public Object execute(ActionContext context) throws Exception {
super.execute(context);
ManagementContextDTO managementDTO = getManagementDTO();
managementContext = ManagementFactory.create(managementDTO);
Artemis.printBanner();
BrokerDTO broker = getBrokerDTO();
addShutdownHook(broker.server.getConfigurationFile().getParentFile());
ActiveMQSecurityManager security = SecurityManagerFactory.create(broker.security);
server = BrokerFactory.createServer(broker.server, security);
managementContext.start();
server.start();
if (broker.web != null) {
broker.components.add(broker.web);
}
for (ComponentDTO componentDTO : broker.components) {
Class clazz = this.getClass().getClassLoader().loadClass(componentDTO.componentClassName);
ExternalComponent component = (ExternalComponent) clazz.newInstance();
component.configure(componentDTO, getBrokerInstance(), getBrokerHome());
component.start();
server.getServer().addExternalComponent(component);
}
return null;
}
Aggregations