https://issues.apache.org/jira/browse/AMQ-4682 - implement runtimeConfigurationPlugin that will track xml config and react to changes. simple verification via test that adds a new network connector on the fly

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1513871 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2013-08-14 13:23:36 +00:00
parent 4dc1ddcd21
commit 3630a41fc9
17 changed files with 746 additions and 3 deletions

View File

@ -37,6 +37,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven-dependency-plugin-version}</version>
<executions>
<execution>
<id>unpack-rar</id>
@ -100,6 +101,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven-dependency-plugin-version}</version>
<executions>
<execution>
<id>unpack-jboss</id>
@ -133,6 +135,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven-dependency-plugin-version}</version>
<executions>
<execution>
<id>unpack-wildfly</id>

View File

@ -218,6 +218,7 @@ public class BrokerService implements Service {
private boolean restartRequested = false;
private int storeOpenWireVersion = OpenWireFormat.DEFAULT_VERSION;
private String configurationUrl;
static {
@ -1030,7 +1031,7 @@ public class BrokerService implements Service {
return systemUsage;
} catch (IOException e) {
LOG.error("Cannot create SystemUsage", e);
throw new RuntimeException("Fatally failed to create SystemUsage" + e.getMessage());
throw new RuntimeException("Fatally failed to create SystemUsage" + e.getMessage(), e);
}
}
@ -2895,4 +2896,12 @@ public class BrokerService implements Service {
public void setStoreOpenWireVersion(int storeOpenWireVersion) {
this.storeOpenWireVersion = storeOpenWireVersion;
}
public String getConfigurationUrl() {
return configurationUrl;
}
public void setConfigurationUrl(String configurationUrl) {
this.configurationUrl = configurationUrl;
}
}

View File

@ -191,6 +191,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven-dependency-plugin-version}</version>
<executions>
<execution>
<id>unpack</id>

152
activemq-runtime-config/pom.xml Executable file
View File

@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-parent</artifactId>
<version>5.9-SNAPSHOT</version>
</parent>
<artifactId>activemq-runtime-config</artifactId>
<name>ActiveMQ :: Runtime Configuration</name>
<description>ActiveMQ Runtime Configuration</description>
<properties>
<activemq.osgi.import>
javax.transaction*;resolution:=optional,
org.apache.geronimo.transaction.manager*;resolution:=optional,
org.springframework*;resolution:=optional
</activemq.osgi.import>
</properties>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-spring</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-kahadb-store</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-spring</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-runtime</artifactId>
<version>${jaxb-basics-version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven-dependency-plugin-version}</version>
<executions>
<execution>
<id>unpack-xsd</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-spring</artifactId>
<type>jar</type>
<overWrite>true</overWrite>
<includes>activemq.xsd</includes>
</artifactItem>
</artifactItems>
<outputDirectory>src/main/resources</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>${maven-jaxb2-plugin-version}</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<extension>true</extension>
<args>
<arg>-XtoString</arg>
<arg>-XhashCode</arg>
<arg>-Xequals</arg>
<arg>-Xequals-equalsStrategyClass=org.apache.activemq.plugin.jaxb2_commons.ElementAwareEqualsStrategy</arg>
</args>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>${jaxb-basics-version}</version>
</plugin>
</plugins>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,208 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.plugin;
import java.io.IOException;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.activemq.broker.BrokerFilter;
import org.apache.activemq.schema.core.Broker;
import org.apache.activemq.schema.core.NetworkConnector;
import org.apache.activemq.spring.Utils;
import org.apache.activemq.util.IntrospectionSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.Resource;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;
public class RuntimeConfigurationBroker extends BrokerFilter {
public static final Logger LOG = LoggerFactory.getLogger(RuntimeConfigurationBroker.class);
private long checkPeriod;
private long lastModified = -1;
private Resource configToMonitor;
private Broker currentConfiguration;
private Runnable monitorTask;
public RuntimeConfigurationBroker(org.apache.activemq.broker.Broker next) {
super(next);
}
@Override
public void start() throws Exception {
super.start();
try {
configToMonitor = Utils.resourceFromString(next.getBrokerService().getConfigurationUrl());
} catch (Exception error) {
LOG.error("failed to determine configuration url resource from broker, updates cannot be tracked", error);
}
currentConfiguration = loadConfiguration(configToMonitor);
monitorModification(configToMonitor);
}
@Override
public void stop() throws Exception {
if (monitorTask != null) {
try {
this.getBrokerService().getScheduler().cancel(monitorTask);
} catch (Exception letsNotStopStop) {
LOG.warn("Failed to cancel config monitor task", letsNotStopStop);
}
}
super.stop();
}
private void monitorModification(final Resource configToMonitor) {
Runnable monitorTask = new Runnable() {
@Override
public void run() {
try {
if (configToMonitor.lastModified() > lastModified) {
applyModifications(configToMonitor);
}
} catch (IOException e) {
LOG.error("Failed to determine lastModified time on configuration: " + configToMonitor, e);
}
}
};
if (lastModified > 0) {
this.getBrokerService().getScheduler().executePeriodically(monitorTask, checkPeriod);
LOG.info("Monitoring for updates (every " + checkPeriod + "millis) : " + configToMonitor);
}
}
private void applyModifications(Resource configToMonitor) {
Broker changed = loadConfiguration(configToMonitor);
if (!currentConfiguration.equals(changed)) {
LOG.info("configuration change in " + configToMonitor + " at: " + new Date(lastModified));
LOG.info("current:" + currentConfiguration);
LOG.info("new :" + changed);
processNetworkConnectors(currentConfiguration, changed);
currentConfiguration = changed;
} else {
LOG.info("file modification but no material change to configuration in " + configToMonitor + " at: " + new Date(lastModified));
}
}
private void processNetworkConnectors(Broker currentConfiguration, Broker modifiedConfiguration) {
List<Broker.NetworkConnectors> currentNc = filterElement(
currentConfiguration.getContents(), Broker.NetworkConnectors.class);
List<Broker.NetworkConnectors> modNc = filterElement(
modifiedConfiguration.getContents(), Broker.NetworkConnectors.class);
int modIndex = 0, currentIndex = 0;
for (; modIndex < modNc.size() && currentIndex < currentNc.size(); modIndex++, currentIndex++) {
if (!modNc.get(modIndex).getContents().get(0).equals(
currentNc.get(currentIndex).getContents().get(0))) {
// change in order will fool this logic
LOG.error("not supported: mod to existing network Connector, new: "
+ modNc.get(modIndex).getContents().get(0));
}
}
for (; modIndex < modNc.size(); modIndex++) {
// additions
addNetworkConnector(modNc.get(modIndex).getContents().get(0));
}
}
private void addNetworkConnector(Object o) {
if (o instanceof NetworkConnector) {
NetworkConnector networkConnector = (NetworkConnector) o;
if (networkConnector.getUri() != null) {
try {
org.apache.activemq.network.NetworkConnector nc =
getBrokerService().addNetworkConnector(networkConnector.getUri());
Properties properties = new Properties();
IntrospectionSupport.getProperties(networkConnector, properties, null);
properties.remove("uri");
LOG.trace("Applying props: " + properties);
IntrospectionSupport.setProperties(nc, properties);
nc.start();
LOG.info("started new network connector: " + nc);
} catch (Exception e) {
LOG.error("Failed to add new networkConnector " + networkConnector, e);
}
}
} else {
LOG.info("No runtime support for modifications to " + o);
}
}
private <T> List<T> filterElement(List<Object> objectList, Class<T> type) {
List<T> result = new LinkedList<T>();
for (Object o : objectList) {
if (o instanceof JAXBElement) {
JAXBElement element = (JAXBElement) o;
if (element.getDeclaredType() == type) {
result.add((T) element.getValue());
}
}
}
return result;
}
private Broker loadConfiguration(Resource configToMonitor) {
Broker jaxbConfig = null;
if (configToMonitor != null) {
try {
JAXBContext context = JAXBContext.newInstance(Broker.class);
Unmarshaller unMarshaller = context.createUnmarshaller();
// skip beans and pull out the broker node to validate
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(configToMonitor.getInputStream());
Node brokerRootNode = doc.getElementsByTagName("broker").item(0);
JAXBElement<Broker> brokerJAXBElement =
unMarshaller.unmarshal(brokerRootNode, Broker.class);
jaxbConfig = brokerJAXBElement.getValue();
// if we can parse we can track mods
lastModified = configToMonitor.lastModified();
} catch (IOException e) {
LOG.error("Failed to access: " + configToMonitor, e);
} catch (JAXBException e) {
LOG.error("Failed to parse: " + configToMonitor, e);
} catch (ParserConfigurationException e) {
LOG.error("Failed to document parse: " + configToMonitor, e);
} catch (SAXException e) {
LOG.error("Failed to find broker element in: " + configToMonitor, e);
}
}
return jaxbConfig;
}
public void setCheckPeriod(long checkPeriod) {
this.checkPeriod = checkPeriod;
}
}

View File

@ -0,0 +1,51 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.plugin;
import org.apache.activemq.broker.Broker;
import org.apache.activemq.broker.BrokerPlugin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Broker plugin that will monitor the broker xml configuration for
* changes and selectively apply those changes to the running broker.
*
* @org.apache.xbean.XBean
*/
public class RuntimeConfigurationPlugin implements BrokerPlugin {
public static final Logger LOG = LoggerFactory.getLogger(RuntimeConfigurationPlugin.class);
private long checkPeriod;
@Override
public Broker installPlugin(Broker broker) throws Exception {
LOG.info("installing runtimeConfiguration plugin");
RuntimeConfigurationBroker runtimeConfigurationBroker = new RuntimeConfigurationBroker(broker);
runtimeConfigurationBroker.setCheckPeriod(getCheckPeriod());
return runtimeConfigurationBroker;
}
public long getCheckPeriod() {
return checkPeriod;
}
public void setCheckPeriod(long checkPeriod) {
this.checkPeriod = checkPeriod;
}
}

View File

@ -0,0 +1,42 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.plugin.jaxb2_commons;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.w3c.dom.Element;
/**
* Ensure uparsed elements like spring beans referenced in the
* xml configuration (broker plugins for example) can be
* examined for equality
*/
public class ElementAwareEqualsStrategy extends JAXBEqualsStrategy {
@Override
protected boolean equalsInternal(ObjectLocator leftLocator,
ObjectLocator rightLocator, Object lhs, Object rhs) {
if (lhs instanceof Element && rhs instanceof Element) {
final Element left = (Element) lhs;
final Element right = (Element) rhs;
return left.isEqualNode(right);
} else {
return super.equalsInternal(leftLocator, rightLocator, lhs, rhs);
}
}
}

View File

@ -0,0 +1,16 @@
<jxb:bindings version="2.0"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jxb:bindings schemaLocation="activemq.xsd" node="/xs:schema/xs:element[@name='broker']">
<jxb:bindings node="xs:complexType/xs:choice">
<jxb:property name="Contents" />
</jxb:bindings>
<jxb:bindings node="xs:complexType/xs:choice/xs:choice/xs:element[@name='networkConnectors']/xs:complexType/xs:choice">
<jxb:property name="Contents" />
</jxb:bindings>
</jxb:bindings>
</jxb:bindings>

View File

@ -0,0 +1,120 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.concurrent.TimeUnit;
import org.apache.activemq.broker.BrokerFactory;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.network.NetworkConnector;
import org.apache.activemq.spring.Utils;
import org.junit.After;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.Resource;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class NetworkConnectorTest {
public static final Logger LOG = LoggerFactory.getLogger(NetworkConnectorTest.class);
public static final int SLEEP = 4; // seconds
String configurationSeed = "networkConnectorTest";
BrokerService brokerService;
public void startBroker(String configFileName) throws Exception {
brokerService = new BrokerService();
brokerService = BrokerFactory.createBroker("xbean:org/apache/activemq/" + configFileName + ".xml");
brokerService.start();
brokerService.waitUntilStarted();
}
@After
public void stopBroker() throws Exception {
brokerService.stop();
}
@Test
public void testNewConnector() throws Exception {
final String brokerConfig = configurationSeed + "-no-nc-broker";
applyNewConfig(brokerConfig, configurationSeed);
startBroker(brokerConfig);
assertTrue("broker alive", brokerService.isStarted());
assertEquals("no network connectors", 0, brokerService.getNetworkConnectors().size());
applyNewConfig(brokerConfig, configurationSeed + "-one-nc", SLEEP);
assertEquals("new network connectors", 1, brokerService.getNetworkConnectors().size());
// apply again - ensure no change
NetworkConnector networkConnector = brokerService.getNetworkConnectors().get(0);
applyNewConfig(brokerConfig, configurationSeed + "-one-nc");
assertEquals("no new network connectors", 1, brokerService.getNetworkConnectors().size());
assertEquals("same instance", networkConnector, brokerService.getNetworkConnectors().get(0));
}
@Ignore("not implemented yet!")
@Test
public void testModConnector() throws Exception {
final String brokerConfig = configurationSeed + "-one-nc-broker";
applyNewConfig(brokerConfig, configurationSeed + "-one-nc");
startBroker(brokerConfig);
assertTrue("broker alive", brokerService.isStarted());
assertEquals("one network connectors", 1, brokerService.getNetworkConnectors().size());
// track the original
NetworkConnector networkConnector = brokerService.getNetworkConnectors().get(0);
assertEquals("network ttl is default", 1, networkConnector.getNetworkTTL());
applyNewConfig(brokerConfig, configurationSeed + "-mod-one-nc", SLEEP);
assertEquals("still one network connectors", 1, brokerService.getNetworkConnectors().size());
NetworkConnector modNetworkConnector = brokerService.getNetworkConnectors().get(0);
assertEquals("got ttl update", 2, modNetworkConnector.getNetworkTTL());
// apply again - ensure no change
applyNewConfig(brokerConfig, configurationSeed + "-mod-one-nc", SLEEP);
assertEquals("no new network connectors", 1, brokerService.getNetworkConnectors().size());
assertEquals("same instance", modNetworkConnector, brokerService.getNetworkConnectors().get(0));
}
private void applyNewConfig(String configName, String newConfigName) throws Exception {
applyNewConfig(configName, newConfigName, 0l);
}
private void applyNewConfig(String configName, String newConfigName, long sleep) throws Exception {
Resource resource = Utils.resourceFromString("org/apache/activemq");
FileOutputStream current = new FileOutputStream(new File(resource.getFile(), configName + ".xml"));
FileInputStream modifications = new FileInputStream(new File(resource.getFile(), (newConfigName != null ? newConfigName : configName) + ".xml"));
modifications.getChannel().transferTo(0, Long.MAX_VALUE, current.getChannel());
current.flush();
LOG.info("Updated: " + current.getChannel());
if (sleep > 0) {
// wait for mods to kick in
TimeUnit.SECONDS.sleep(sleep);
}
}
}

View File

@ -0,0 +1,36 @@
## ---------------------------------------------------------------------------
## Licensed to the Apache Software Foundation (ASF) under one or more
## contributor license agreements. See the NOTICE file distributed with
## this work for additional information regarding copyright ownership.
## The ASF licenses this file to You under the Apache License, Version 2.0
## (the "License"); you may not use this file except in compliance with
## the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
#
# The logging properties used during tests..
#
log4j.rootLogger=INFO, out, stdout
#log4j.logger.org.apache.activemq=DEBUG
#log4j.logger.org.apache.activemq.broker.region=TRACE
# CONSOLE appender not used by default
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
# File appender
log4j.appender.out=org.apache.log4j.FileAppender
log4j.appender.out.layout=org.apache.log4j.PatternLayout
log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
log4j.appender.out.file=target/activemq-test.log
log4j.appender.out.append=true

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<broker xmlns="http://activemq.apache.org/schema/core" start="false" persistent="false" >
<plugins>
<runtimeConfigurationPlugin checkPeriod="1000" />
</plugins>
<networkConnectors>
<networkConnector uri="static:(tcp://localhost:5555)" networkTTL="2" />
</networkConnectors>
</broker>
</beans>

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<broker xmlns="http://activemq.apache.org/schema/core" start="false" persistent="false" >
<plugins>
<runtimeConfigurationPlugin checkPeriod="1000" />
</plugins>
<networkConnectors>
<networkConnector uri="static:(tcp://localhost:5555)"/>
</networkConnectors>
</broker>
</beans>

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<broker xmlns="http://activemq.apache.org/schema/core" start="false" persistent="false" >
<plugins>
<runtimeConfigurationPlugin checkPeriod="1000" />
</plugins>
</broker>
</beans>

View File

@ -242,6 +242,7 @@
<include>${basedir}/../activemq-kahadb-store/src/main/java</include>
<include>${basedir}/../activemq-mqtt/src/main/java</include>
<include>${basedir}/../activemq-stomp/src/main/java</include>
<include>${basedir}/../activemq-runtime-config/src/main/java</include>
</includes>
<strictXsdOrder>false</strictXsdOrder>
<namespace>http://activemq.apache.org/schema/core</namespace>

View File

@ -89,6 +89,8 @@ public class XBeanBrokerFactory implements BrokerFactoryHandler {
((ApplicationContextAware)broker).setApplicationContext(context);
}
broker.setConfigurationUrl(uri);
// TODO warning resources from the context may not be closed down!
return broker;

View File

@ -412,6 +412,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven-dependency-plugin-version}</version>
<executions>
<execution>
<id>unpack</id>

View File

@ -124,6 +124,7 @@
<xbean-version>3.14</xbean-version>
<xerces-version>2.11.0</xerces-version>
<zookeeper-version>3.4.5</zookeeper-version>
<jaxb-basics-version>0.6.4</jaxb-basics-version>
<pax-exam-version>2.6.0</pax-exam-version>
<paxexam-karaf-container-version>1.0.0</paxexam-karaf-container-version>
@ -153,7 +154,7 @@
<maven-javadoc-plugin-version>2.9</maven-javadoc-plugin-version>
<maven-install-plugin-version>2.4</maven-install-plugin-version>
<maven-shade-plugin-version>2.0</maven-shade-plugin-version>
<maven-jaxb2-plugin-version>0.7.2</maven-jaxb2-plugin-version>
<maven-jaxb2-plugin-version>0.8.3</maven-jaxb2-plugin-version>
<findbugs-maven-plugin-version>2.5.2</findbugs-maven-plugin-version>
<javacc-maven-plugin-version>2.6</javacc-maven-plugin-version>
<cobertura-maven-plugin-version>2.5.2</cobertura-maven-plugin-version>
@ -162,6 +163,7 @@
<apache-rat-plugin-version>0.8</apache-rat-plugin-version>
<ianal-maven-plugin-version>1.0-alpha-1</ianal-maven-plugin-version>
<depends-maven-plugin-version>1.2</depends-maven-plugin-version>
<maven-dependency-plugin-version>2.8</maven-dependency-plugin-version>
<!-- OSGi bundles properties -->
<activemq.osgi.import.pkg>*</activemq.osgi.import.pkg>
<activemq.osgi.export.pkg>org.apache.activemq*</activemq.osgi.export.pkg>
@ -238,6 +240,7 @@
<module>activemq-rar</module>
<module>activemq-run</module>
<module>activemq-spring</module>
<module>activemq-runtime-config</module>
<module>activemq-tooling</module>
<module>activemq-web</module>
<module>activemq-osgi</module>