public File getConfigurationFile() throws Exception { if (configurationFile == null) { configurationFile = new File(getConfigurationURI()); } return configurationFile; }
public static Broker createServer(ServerDTO brokerDTO, ActiveMQSecurityManager security) throws Exception { if (brokerDTO.configuration != null) { BrokerHandler handler; URI configURI = brokerDTO.getConfigurationURI(); try { FactoryFinder finder = new FactoryFinder("META-INF/services/org/apache/activemq/artemis/broker/server/"); handler = (BrokerHandler) finder.newInstance(configURI.getScheme()); } catch (IOException ioe) { throw new ConfigurationException("Invalid configuration URI, can't find configuration scheme: " + configURI.getScheme()); } return handler.createServer(brokerDTO, security); } return null; }
public static Broker createServer(ServerDTO brokerDTO, ActiveMQSecurityManager security) throws Exception { if (brokerDTO.configuration != null) { BrokerHandler handler; URI configURI = brokerDTO.getConfigurationURI(); try { FactoryFinder finder = new FactoryFinder("META-INF/services/org/apache/activemq/artemis/broker/server/"); handler = (BrokerHandler) finder.newInstance(configURI.getScheme()); } catch (IOException ioe) { throw new ConfigurationException("Invalid configuration URI, can't find configuration scheme: " + configURI.getScheme()); } return handler.createServer(brokerDTO, security); } return null; }
protected FileConfiguration readConfiguration() throws Exception { FileConfiguration fileConfiguration = new FileConfiguration(); if (getBrokerInstance() == null) { final String defaultLocation = "./data"; fileConfiguration = new FileConfiguration(); // These will be the default places in case the file can't be loaded fileConfiguration.setBindingsDirectory(defaultLocation + "/bindings"); fileConfiguration.setJournalDirectory(defaultLocation + "/journal"); fileConfiguration.setLargeMessagesDirectory(defaultLocation + "/largemessages"); fileConfiguration.setPagingDirectory(defaultLocation + "/paging"); fileConfiguration.setBrokerInstance(new File(".")); } else { FileJMSConfiguration jmsConfiguration = new FileJMSConfiguration(); String serverConfiguration = getBrokerDTO().server.getConfigurationURI().toASCIIString(); FileDeploymentManager fileDeploymentManager = new FileDeploymentManager(serverConfiguration); fileDeploymentManager.addDeployable(fileConfiguration).addDeployable(jmsConfiguration); fileDeploymentManager.readConfiguration(); fileConfiguration.setBrokerInstance(new File(getBrokerInstance())); } return fileConfiguration; }
protected FileConfiguration readConfiguration() throws Exception { FileConfiguration fileConfiguration = new FileConfiguration(); if (getBrokerInstance() == null) { final String defaultLocation = "./data"; fileConfiguration = new FileConfiguration(); // These will be the default places in case the file can't be loaded fileConfiguration.setBindingsDirectory(defaultLocation + "/bindings"); fileConfiguration.setJournalDirectory(defaultLocation + "/journal"); fileConfiguration.setLargeMessagesDirectory(defaultLocation + "/largemessages"); fileConfiguration.setPagingDirectory(defaultLocation + "/paging"); fileConfiguration.setBrokerInstance(new File(".")); } else { FileJMSConfiguration jmsConfiguration = new FileJMSConfiguration(); String serverConfiguration = getBrokerDTO().server.getConfigurationURI().toASCIIString(); FileDeploymentManager fileDeploymentManager = new FileDeploymentManager(serverConfiguration); fileDeploymentManager.addDeployable(fileConfiguration).addDeployable(jmsConfiguration); fileDeploymentManager.readConfiguration(); fileConfiguration.setBrokerInstance(new File(getBrokerInstance())); } return fileConfiguration; }