Here are the examples of the java api class org.apache.activemq.artemis.jms.server.config.impl.FileJMSConfiguration taken from open source projects.
1. JMSServerStartStopTest#setUp()
Project: activemq-artemis
File: JMSServerStartStopTest.java
File: JMSServerStartStopTest.java
@Override @Before public void setUp() throws Exception { FileConfiguration fc = new FileConfiguration(); FileJMSConfiguration fileConfiguration = new FileJMSConfiguration(); FileDeploymentManager deploymentManager = new FileDeploymentManager("server-start-stop-config1.xml"); deploymentManager.addDeployable(fc); deploymentManager.addDeployable(fileConfiguration); deploymentManager.readConfiguration(); ActiveMQJAASSecurityManager sm = new ActiveMQJAASSecurityManager(InVMLoginModule.class.getName(), new SecurityConfiguration()); ActiveMQServer server = addServer(new ActiveMQServerImpl(fc, sm)); jmsServer = new JMSServerManagerImpl(server, fileConfiguration); jmsServer.setRegistry(null); }
2. JMSServerConfigParserTest#testParsing()
Project: activemq-artemis
File: JMSServerConfigParserTest.java
File: JMSServerConfigParserTest.java
// Constants ----------------------------------------------------- // Attributes ---------------------------------------------------- // Static -------------------------------------------------------- // Constructors -------------------------------------------------- // Public -------------------------------------------------------- @Test public void testParsing() throws Exception { Configuration config = createDefaultInVMConfig().addConnectorConfiguration(// anything so the parsing will work "netty", new TransportConfiguration()); String conf = "activemq-jms-for-JMSServerDeployerTest.xml"; FileJMSConfiguration jmsconfig = new FileJMSConfiguration(); FileDeploymentManager deploymentManager = new FileDeploymentManager(conf); deploymentManager.addDeployable(jmsconfig); deploymentManager.readConfiguration(); assertEquals(1, jmsconfig.getQueueConfigurations().size()); JMSQueueConfiguration queueConfig = jmsconfig.getQueueConfigurations().get(0); assertEquals("fullConfigurationQueue", queueConfig.getName()); assertEquals(1, jmsconfig.getTopicConfigurations().size()); TopicConfiguration topicConfig = jmsconfig.getTopicConfigurations().get(0); assertEquals("fullConfigurationTopic", topicConfig.getName()); }
3. FileBroker#start()
Project: activemq-artemis
File: FileBroker.java
File: FileBroker.java
@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; }
4. OsgiBroker#activate()
Project: activemq-artemis
File: OsgiBroker.java
File: OsgiBroker.java
@Activate public void activate(ComponentContext cctx) throws Exception { final BundleContext context = cctx.getBundleContext(); final Dictionary<String, Object> properties = cctx.getProperties(); configurationUrl = getMandatory(properties, "config"); name = getMandatory(properties, "name"); rolePrincipalClass = (String) properties.get("rolePrincipalClass"); String domain = getMandatory(properties, "domain"); ActiveMQJAASSecurityManager security = new ActiveMQJAASSecurityManager(domain); if (rolePrincipalClass != null) { security.setRolePrincipalClass(rolePrincipalClass); } String brokerInstance = null; String karafDataDir = System.getProperty("karaf.data"); if (karafDataDir != null) { brokerInstance = karafDataDir + "/artemis/" + name; } // 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(); if (brokerInstance != null) { configuration.setBrokerInstance(new File(brokerInstance)); } FileJMSConfiguration jmsConfiguration = new FileJMSConfiguration(); FileDeploymentManager fileDeploymentManager = new FileDeploymentManager(configurationUrl); fileDeploymentManager.addDeployable(configuration).addDeployable(jmsConfiguration).readConfiguration(); components = fileDeploymentManager.buildService(security, ManagementFactory.getPlatformMBeanServer()); final ActiveMQServer server = (ActiveMQServer) components.get("core"); String[] requiredProtocols = getRequiredProtocols(server.getConfiguration().getAcceptorConfigurations()); ProtocolTrackerCallBack callback = new ProtocolTrackerCallBack() { @Override public void addFactory(ProtocolManagerFactory<Interceptor> pmf) { server.addProtocolManagerFactory(pmf); } @Override public void removeFactory(ProtocolManagerFactory<Interceptor> pmf) { server.removeProtocolManagerFactory(pmf); } @Override public void stop() throws Exception { ActiveMQComponent[] mqComponents = new ActiveMQComponent[components.size()]; components.values().toArray(mqComponents); for (int i = mqComponents.length - 1; i >= 0; i--) { mqComponents[i].stop(); } unregister(); } @Override public void start() throws Exception { List<ActiveMQComponent> componentsByStartOrder = getComponentsByStartOrder(components); for (ActiveMQComponent component : componentsByStartOrder) { component.start(); } register(context, properties); } @Override public boolean isStarted() { return server.isStarted(); } }; ProtocolTracker trackerCust = new ProtocolTracker(name, context, requiredProtocols, callback); tracker = new ServiceTracker(context, ProtocolManagerFactory.class, trackerCust); tracker.open(); }