Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationWithConnectorTest.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationWithConnectorTest.java?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationWithConnectorTest.java (original) +++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationWithConnectorTest.java Thu Jun 19 18:26:39 2008 @@ -16,12 +16,58 @@ */ package org.apache.camel.management; +import javax.management.MBeanServerConnection; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; + +/** + * Test that verifies JMX connector server can be connected by + * a client. + * + * @version $Revision$ + * + */ public class JmxInstrumentationWithConnectorTest extends JmxInstrumentationUsingDefaultsTest { + protected JMXConnector clientConnector; + protected static final String JMXSERVICEURL = + "service:jmx:rmi:///jndi/rmi://localhost:2000/jmxrmi"; + + @Override + protected void setUp() throws Exception { + sleepForConnection = 2000; + System.setProperty(JmxSystemPropertyKeys.CREATE_CONNECTOR, "True"); + System.setProperty(JmxSystemPropertyKeys.REGISTRY_PORT, "2000"); + super.setUp(); + } @Override - protected void enableJmx() { - domainName = "org.apache.camel-explicit"; - iAgent.enableJmx(domainName, "/jmxtest", 1099); + protected void tearDown() throws Exception { + System.clearProperty(JmxSystemPropertyKeys.REGISTRY_PORT); + System.clearProperty(JmxSystemPropertyKeys.CREATE_CONNECTOR); + + if (clientConnector != null) { + try { + clientConnector.close(); + } catch (Exception e) { + // ignore + } + clientConnector = null; + } + super.tearDown(); } + + @Override + protected MBeanServerConnection getMBeanConnection() throws Exception { + if (mbsc == null) { + if (clientConnector == null) { + clientConnector = JMXConnectorFactory.connect( + new JMXServiceURL(JMXSERVICEURL), null); + } + mbsc = clientConnector.getMBeanServerConnection(); + } + return mbsc; + } + }
Modified: activemq/camel/trunk/components/camel-atom/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-atom/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-atom/pom.xml (original) +++ activemq/camel/trunk/components/camel-atom/pom.xml Thu Jun 19 18:26:39 2008 @@ -70,7 +70,23 @@ <artifactId>junit</artifactId> <scope>test</scope> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> </dependencies> </project> + Modified: activemq/camel/trunk/components/camel-csv/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-csv/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-csv/pom.xml (original) +++ activemq/camel/trunk/components/camel-csv/pom.xml Thu Jun 19 18:26:39 2008 @@ -80,6 +80,21 @@ <artifactId>log4j</artifactId> <scope>test</scope> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> Modified: activemq/camel/trunk/components/camel-ftp/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-ftp/pom.xml (original) +++ activemq/camel/trunk/components/camel-ftp/pom.xml Thu Jun 19 18:26:39 2008 @@ -96,6 +96,21 @@ <artifactId>log4j</artifactId> <scope>test</scope> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> </dependencies> <build> Modified: activemq/camel/trunk/components/camel-http/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-http/pom.xml (original) +++ activemq/camel/trunk/components/camel-http/pom.xml Thu Jun 19 18:26:39 2008 @@ -69,6 +69,21 @@ <type>test-jar</type> <scope>test</scope> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> Modified: activemq/camel/trunk/components/camel-jcr/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jcr/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-jcr/pom.xml (original) +++ activemq/camel/trunk/components/camel-jcr/pom.xml Thu Jun 19 18:26:39 2008 @@ -66,5 +66,20 @@ <artifactId>slf4j-log4j12</artifactId> <version>1.4.3</version> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> </dependencies> </project> Modified: activemq/camel/trunk/components/camel-jdbc/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jdbc/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-jdbc/pom.xml (original) +++ activemq/camel/trunk/components/camel-jdbc/pom.xml Thu Jun 19 18:26:39 2008 @@ -48,6 +48,22 @@ <artifactId>junit</artifactId> <scope>test</scope> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <!-- <dependency> <groupId>org.apache.derby</groupId> Modified: activemq/camel/trunk/components/camel-jetty/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jetty/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-jetty/pom.xml (original) +++ activemq/camel/trunk/components/camel-jetty/pom.xml Thu Jun 19 18:26:39 2008 @@ -67,6 +67,21 @@ <type>test-jar</type> <scope>test</scope> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> Modified: activemq/camel/trunk/components/camel-josql/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-josql/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-josql/pom.xml (original) +++ activemq/camel/trunk/components/camel-josql/pom.xml Thu Jun 19 18:26:39 2008 @@ -68,6 +68,22 @@ <version>1.5</version> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> Modified: activemq/camel/trunk/components/camel-juel/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-juel/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-juel/pom.xml (original) +++ activemq/camel/trunk/components/camel-juel/pom.xml Thu Jun 19 18:26:39 2008 @@ -66,6 +66,21 @@ <artifactId>log4j</artifactId> <scope>test</scope> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> Modified: activemq/camel/trunk/components/camel-mina/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-mina/pom.xml (original) +++ activemq/camel/trunk/components/camel-mina/pom.xml Thu Jun 19 18:26:39 2008 @@ -80,6 +80,21 @@ <artifactId>slf4j-log4j12</artifactId> <scope>test</scope> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> <dependency> <groupId>org.easymock</groupId> <artifactId>easymockclassextension</artifactId> Modified: activemq/camel/trunk/components/camel-ognl/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ognl/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-ognl/pom.xml (original) +++ activemq/camel/trunk/components/camel-ognl/pom.xml Thu Jun 19 18:26:39 2008 @@ -66,6 +66,21 @@ <artifactId>log4j</artifactId> <scope>test</scope> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> Modified: activemq/camel/trunk/components/camel-quartz/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-quartz/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-quartz/pom.xml (original) +++ activemq/camel/trunk/components/camel-quartz/pom.xml Thu Jun 19 18:26:39 2008 @@ -71,6 +71,21 @@ <artifactId>junit</artifactId> <scope>test</scope> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> </dependencies> <build> Modified: activemq/camel/trunk/components/camel-rmi/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-rmi/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-rmi/pom.xml (original) +++ activemq/camel/trunk/components/camel-rmi/pom.xml Thu Jun 19 18:26:39 2008 @@ -50,6 +50,22 @@ <type>test-jar</type> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java (original) +++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java Thu Jun 19 18:26:39 2008 @@ -20,7 +20,6 @@ import java.util.List; import java.util.Map; -import javax.management.MBeanServer; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; @@ -32,13 +31,15 @@ import org.apache.camel.RuntimeCamelException; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.impl.DefaultLifecycleStrategy; +import org.apache.camel.management.DefaultInstrumentationAgent; +import org.apache.camel.management.InstrumentationLifecycleStrategy; import org.apache.camel.model.IdentifiedType; import org.apache.camel.model.RouteBuilderRef; import org.apache.camel.model.RouteContainer; import org.apache.camel.model.RouteType; import org.apache.camel.model.dataformat.DataFormatType; import org.apache.camel.processor.interceptor.Debugger; -import org.apache.camel.spi.InstrumentationAgent; import org.apache.camel.spi.LifecycleStrategy; import org.apache.camel.spi.Registry; import org.apache.commons.logging.Log; @@ -65,10 +66,7 @@ @XmlAccessorType(XmlAccessType.FIELD) public class CamelContextFactoryBean extends IdentifiedType implements RouteContainer, FactoryBean, InitializingBean, DisposableBean, ApplicationContextAware, ApplicationListener { private static final Log LOG = LogFactory.getLog(CamelContextFactoryBean.class); - @XmlAttribute(required = false) - private Boolean useJmx; - @XmlAttribute(required = false) - private String mbeanServer; + @XmlAttribute(required = false) private Boolean autowireRouteBuilders = Boolean.TRUE; @XmlElement(name = "package", required = false) @@ -100,8 +98,6 @@ @XmlTransient private ClassLoader contextClassLoaderOnStart; @XmlTransient - private InstrumentationAgent instrumentationAgent; - @XmlTransient private BeanPostProcessor beanPostProcessor; public CamelContextFactoryBean() { @@ -154,33 +150,27 @@ // lets force any lazy creation getContext().addRouteDefinitions(routes); - // set the instrumentation agent here - if (instrumentationAgent == null && isJmxEnabled()) { - if (lifecycleStrategy != null) { - LOG.warn("lifecycleStrategy will be overriden by InstrumentationLifecycleStrategy"); - } + if (camelJMXAgent != null) { + if (camelJMXAgent.isDisabled() != null && camelJMXAgent.isDisabled()) { + getContext().setLifecycleStrategy(new DefaultLifecycleStrategy()); + } else { - SpringInstrumentationAgent agent = new SpringInstrumentationAgent(); - if (camelJMXAgent != null) { - agent.enableJmx(camelJMXAgent.getJmxDomainName(), camelJMXAgent.getConnectorPath(), camelJMXAgent.getConnectorPort()); - if (camelJMXAgent.isCreateConnector() != null) { - agent.setCreateConnector(camelJMXAgent.isCreateConnector()); + if (lifecycleStrategy != null) { + LOG.warn("lifecycleStrategy will be overriden by InstrumentationLifecycleStrategy"); } - if (camelJMXAgent.isUsePlatformMBeanServer() != null) { - agent.setUsePlatformMBeanServer(camelJMXAgent.isUsePlatformMBeanServer()); - } - } else { - agent.enableJmx(); - } - agent.setCamelContext(getContext()); - String name = getMbeanServer(); - if (name != null) { - MBeanServer mbeanServer = (MBeanServer) getApplicationContext().getBean(name, MBeanServer.class); - agent.setMBeanServer(mbeanServer); + + DefaultInstrumentationAgent agent = new DefaultInstrumentationAgent(); + agent.setConnectorPort(camelJMXAgent.getConnectorPort()); + agent.setCreateConnector(camelJMXAgent.isCreateConnector()); + agent.setMBeanObjectDomainName(camelJMXAgent.getMbeanObjectDomainName()); + agent.setMBeanServerDefaultDomain(camelJMXAgent.getMbeanServerDefaultDomain()); + agent.setRegistryPort(camelJMXAgent.getRegistryPort()); + agent.setServiceUrlPath(camelJMXAgent.getServiceUrlPath()); + agent.setUsePlatformMBeanServer(camelJMXAgent.isUsePlatformMBeanServer()); + + getContext().setLifecycleStrategy(new InstrumentationLifecycleStrategy(agent)); } - instrumentationAgent = agent; - instrumentationAgent.start(); - } + } if (LOG.isDebugEnabled()) { LOG.debug("Found JAXB created routes: " + getRoutes()); @@ -303,14 +293,6 @@ this.packages = packages; } - public String getMbeanServer() { - return mbeanServer; - } - - public void setMbeanServer(String mbeanServer) { - this.mbeanServer = mbeanServer; - } - public void setBeanPostProcessor(BeanPostProcessor postProcessor) { this.beanPostProcessor = postProcessor; } @@ -319,18 +301,6 @@ return beanPostProcessor; } - public boolean isJmxEnabled() { - return useJmx != null && useJmx.booleanValue(); - } - - public Boolean getUseJmx() { - return useJmx; - } - - public void setUseJmx(Boolean useJmx) { - this.useJmx = useJmx; - } - public void setCamelJMXAgent(CamelJMXAgentType agent) { camelJMXAgent = agent; } Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelJMXAgentType.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelJMXAgentType.java?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelJMXAgentType.java (original) +++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelJMXAgentType.java Thu Jun 19 18:26:39 2008 @@ -33,54 +33,117 @@ @XmlRootElement(name = "jmxAgent") @XmlAccessorType(XmlAccessType.FIELD) public class CamelJMXAgentType extends IdentifiedType { + /** + * Disable JMI (default false) + */ + @XmlAttribute(required = false) + private Boolean disabled; + + /** + * RMI connector registry port (default 1099) + */ + @XmlAttribute(required = false) + private Integer registryPort; + + /** + * RMI connector server port (default -1 not used) + */ @XmlAttribute(required = false) private Integer connectorPort; + + /** + * MBean server default domain name (default org.apache.camel) + */ + @XmlAttribute(required = false) + private String mbeanServerDefaultDomain; + + /** + * MBean object domain name (default org.apache.camel) + */ @XmlAttribute(required = false) - private String jmxDomainName; + private String mbeanObjectDomainName; + + /** + * JMX Service URL path (default /jmxrmi) + */ @XmlAttribute(required = false) - private String connectorPath; + private String serviceUrlPath; + + /** + * A flag that indicates whether the agent should be created + */ @XmlAttribute(required = false) private Boolean createConnector; + + /** + * A flag that indicates whether the platform mbean server should be used + */ @XmlAttribute(required = false) private Boolean usePlatformMBeanServer; - public void setConnectorPort(Integer port) { - connectorPort = port; - } - public Integer getConnectorPort() { return connectorPort; } - - public void setJmxDomainName(String name) { - jmxDomainName = name; + + public void setConnectorPort(Integer value) { + connectorPort = value; } - public String getJmxDomainName() { - return jmxDomainName; + public Integer getRegistryPort() { + return registryPort; } - - public void setConnectorPath(String path) { - connectorPath = path; + + public void setRegistryPort(Integer value) { + registryPort = value; } - - public String getConnectorPath() { - return connectorPath; + + public String getMbeanServerDefaultDomain() { + return mbeanServerDefaultDomain; } - - public void setCreateConnector(Boolean flag) { - createConnector = flag; + + public void setMbeanServerDefaultDomain(String value) { + mbeanServerDefaultDomain = value; + } + + public String getMbeanObjectDomainName() { + return mbeanObjectDomainName; + } + + public void getMbeanObjectDomainName(String value) { + mbeanObjectDomainName = value; + } + + public String getServiceUrlPath() { + return serviceUrlPath; + } + + public void getServiceUrlPath(String value) { + serviceUrlPath = value; } public Boolean isCreateConnector() { return createConnector; } - - public void setUsePlatformMBeanServer(Boolean flag) { - usePlatformMBeanServer = flag; + + public void setCreateConnector(Boolean value) { + createConnector = value; } public Boolean isUsePlatformMBeanServer() { return usePlatformMBeanServer; } + + public void setUsePlatformMBeanServer(Boolean value) { + usePlatformMBeanServer = value; + } + + public Boolean isDisabled() { + return disabled; + } + + public void setDisabled(Boolean value) { + disabled = value; + } + + } Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringInstrumentationAgent.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringInstrumentationAgent.java?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringInstrumentationAgent.java (original) +++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringInstrumentationAgent.java Thu Jun 19 18:26:39 2008 @@ -1,36 +0,0 @@ -/** - * 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.camel.spring; - -import org.apache.camel.management.DefaultInstrumentationAgent; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.DisposableBean; -import org.springframework.beans.factory.InitializingBean; - -public class SpringInstrumentationAgent extends DefaultInstrumentationAgent implements InitializingBean, - DisposableBean { - private static final transient Log LOG = LogFactory.getLog(SpringInstrumentationAgent.class); - - public void afterPropertiesSet() throws Exception { - LOG.debug("Starting JMX agent on server: " + getMBeanServer()); - start(); - } - - public void destroy() throws Exception { - } -} Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DefaultJMXAgentTest.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DefaultJMXAgentTest.java?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DefaultJMXAgentTest.java (original) +++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DefaultJMXAgentTest.java Thu Jun 19 18:26:39 2008 @@ -16,30 +16,56 @@ */ package org.apache.camel.spring; -import java.net.MalformedURLException; +import java.util.List; +import javax.management.MBeanServer; import javax.management.MBeanServerConnection; -import javax.management.remote.JMXConnector; -import javax.management.remote.JMXConnectorFactory; -import javax.management.remote.JMXServiceURL; +import javax.management.MBeanServerFactory; +import org.apache.camel.management.DefaultInstrumentationAgent; import org.springframework.context.support.ClassPathXmlApplicationContext; +/** + * Test that verifies JMX is enabled by default. + * + * @version $Revision$ + * + */ public class DefaultJMXAgentTest extends SpringTestSupport { + + protected MBeanServerConnection mbsc; + protected long sleepForConnection = 0; - protected String getPort() { - return "1099"; + @Override + protected void setUp() throws Exception { + releaseMBeanServers(); + super.setUp(); + Thread.sleep(sleepForConnection); + mbsc = getMBeanConnection(); } - + + @Override + protected void tearDown() throws Exception { + releaseMBeanServers(); + mbsc = null; + super.tearDown(); + } + protected String getDomainName() { - return "org.apache.camel"; + return DefaultInstrumentationAgent.DEFAULT_DOMAIN; + } + + @SuppressWarnings("unchecked") + protected void releaseMBeanServers() { + List<MBeanServer> servers = + (List<MBeanServer>)MBeanServerFactory.findMBeanServer(null); + + for (MBeanServer server : servers) { + MBeanServerFactory.releaseMBeanServer(server); + } } public void testGetJMXConnector() throws Exception { - JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + getPort() + "/jmxrmi"); - JMXConnector jmxc = JMXConnectorFactory.connect(url, null); - MBeanServerConnection mbsc = jmxc.getMBeanServerConnection(); - assertNotNull(mbsc); assertEquals("Get the wrong domain name", mbsc.getDefaultDomain(), getDomainName()); } @@ -47,5 +73,20 @@ protected ClassPathXmlApplicationContext createApplicationContext() { return new ClassPathXmlApplicationContext("org/apache/camel/spring/defaultJmxConfig.xml"); } - + + @SuppressWarnings("unchecked") + protected MBeanServerConnection getMBeanConnection() throws Exception { + if (mbsc == null) { + List<MBeanServer> servers = + (List<MBeanServer>)MBeanServerFactory.findMBeanServer(null); + + for (MBeanServer server : servers) { + if (getDomainName().equals(server.getDefaultDomain())) { + mbsc = server; + break; + } + } + } + return mbsc; + } } Added: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DisableJmxAgentTest.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DisableJmxAgentTest.java?rev=669756&view=auto ============================================================================== --- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DisableJmxAgentTest.java (added) +++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DisableJmxAgentTest.java Thu Jun 19 18:26:39 2008 @@ -0,0 +1,38 @@ +/** + * 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.camel.spring; + +import org.springframework.context.support.ClassPathXmlApplicationContext; + +/** + * Test that verifies JMX can be disabled via Spring. + * + * @version $Revision$ + * + */ +public class DisableJmxAgentTest extends DefaultJMXAgentTest { + + @Override + protected ClassPathXmlApplicationContext createApplicationContext() { + return new ClassPathXmlApplicationContext("org/apache/camel/spring/disableJmxConfig.xml"); + } + + public void testGetJMXConnector() throws Exception { + assertNull(mbsc); + } + +} Propchange: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DisableJmxAgentTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DisableJmxAgentTest.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DummyLifecycleStrategy.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DummyLifecycleStrategy.java?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DummyLifecycleStrategy.java (original) +++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DummyLifecycleStrategy.java Thu Jun 19 18:26:39 2008 @@ -59,4 +59,9 @@ } + public void onContextStart(CamelContext arg0) { + // TODO Auto-generated method stub + + } + } Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentTest.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentTest.java?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentTest.java (original) +++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentTest.java Thu Jun 19 18:26:39 2008 @@ -16,8 +16,6 @@ */ package org.apache.camel.spring; -import java.net.MalformedURLException; - import javax.management.MBeanServerConnection; import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorFactory; @@ -25,13 +23,39 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; +/** + * Test that verifies JMX properties can be configured via + * Spring. + * + * @version $Revision$ + * + */ public class JMXAgentTest extends DefaultJMXAgentTest { + + protected static final String JMXSERVICEURL = + "service:jmx:rmi:///jndi/rmi://localhost:20008/jmxrmi"; + protected JMXConnector clientConnector; @Override - protected String getPort() { - return "20008"; + protected void setUp() throws Exception { + sleepForConnection = 2000; + super.setUp(); } - + + @Override + protected void tearDown() throws Exception { + + if (clientConnector != null) { + try { + clientConnector.close(); + } catch (Exception e) { + // ignore + } + clientConnector = null; + } + super.tearDown(); + } + @Override protected String getDomainName() { return "org.apache.camel.test"; @@ -41,5 +65,17 @@ protected ClassPathXmlApplicationContext createApplicationContext() { return new ClassPathXmlApplicationContext("org/apache/camel/spring/jmxConfig.xml"); } + + @Override + protected MBeanServerConnection getMBeanConnection() throws Exception { + if (mbsc == null) { + if (clientConnector == null) { + clientConnector = JMXConnectorFactory.connect( + new JMXServiceURL(JMXSERVICEURL), null); + } + mbsc = clientConnector.getMBeanServerConnection(); + } + return mbsc; + } } Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/managment/CamelChoiceWithManagementTest.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/managment/CamelChoiceWithManagementTest.java?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/managment/CamelChoiceWithManagementTest.java (original) +++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/managment/CamelChoiceWithManagementTest.java Thu Jun 19 18:26:39 2008 @@ -1,121 +0,0 @@ -/** - * 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.camel.spring.managment; - -import org.apache.camel.ContextTestSupport; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.spring.SpringInstrumentationAgent; - -import static org.apache.camel.component.mock.MockEndpoint.expectsMessageCount; - -/** - * @version $Revision$ - */ -public class CamelChoiceWithManagementTest extends ContextTestSupport { - private SpringInstrumentationAgent agent; - private MockEndpoint a; - private MockEndpoint b; - private MockEndpoint c; - private MockEndpoint d; - private MockEndpoint e; - - protected void setUp() throws Exception { - context = createCamelContext(); - assertValidContext(context); - - - template = context.createProducerTemplate(); - agent = new SpringInstrumentationAgent(); - agent.setCamelContext(context); - agent.enableJmx(); - agent.start(); - RouteBuilder[] builders = createRouteBuilders(); - for (RouteBuilder builder : builders) { - context.addRoutes(builder); - } - startCamelContext(); - a = getMockEndpoint("mock:a"); - b = getMockEndpoint("mock:b"); - c = getMockEndpoint("mock:c"); - d = getMockEndpoint("mock:d"); - e = getMockEndpoint("mock:e"); - } - - protected void tearDown() throws Exception { - agent.stop(); - super.tearDown(); - } - - public void testFirstChoiceRoute() throws Exception { - final String body = "<one/>"; - a.expectedBodiesReceived(body); - a.expectedHeaderReceived("CBR1", "Yes"); - c.expectedBodiesReceived(body); - c.expectedHeaderReceived("CBR1", "Yes"); - c.expectedHeaderReceived("Validation", "Yes"); - expectsMessageCount(0, b, d, e); - - template.send("direct:start", new Processor() { - - public void process(Exchange exchange) throws Exception { - exchange.getIn().setBody(body); - exchange.getIn().setHeader("CBR1", "Yes"); - } - }); - - assertMockEndpointsSatisifed(); - - } - - public void testOtherwise() throws Exception { - final String body = "<None/>"; - e.expectedBodiesReceived(body); - - expectsMessageCount(0, a, b, c, d); - - template.send("direct:start", new Processor() { - - public void process(Exchange exchange) throws Exception { - exchange.getIn().setBody(body); - } - }); - - assertMockEndpointsSatisifed(); - - } - - - - @Override - protected RouteBuilder createRouteBuilder() throws Exception { - return new RouteBuilder() { - public void configure() { - - from("direct:start") - .choice() - .when(header("CBR1").isEqualTo("Yes")).to("mock:a").setHeader("Validation", "Yes") - .when(header("CBR1").isEqualTo("No")).to("mock:b").end() - .choice().when(header("Validation").isEqualTo("Yes")).to("mock:c") - .when(header("Validation").isEqualTo("No")).to("mock:d").otherwise().to("mock:e").end(); - - } - }; - } -} Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/managment/JmxInstrumentationWithConnectorTest.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/managment/JmxInstrumentationWithConnectorTest.java?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/managment/JmxInstrumentationWithConnectorTest.java (original) +++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/managment/JmxInstrumentationWithConnectorTest.java Thu Jun 19 18:26:39 2008 @@ -16,17 +16,18 @@ */ package org.apache.camel.spring.managment; +import org.apache.camel.management.DefaultInstrumentationAgent; import org.apache.camel.spi.InstrumentationAgent; import org.apache.camel.spring.EndpointReferenceTest; -import org.apache.camel.spring.SpringInstrumentationAgent; import org.springframework.context.support.ClassPathXmlApplicationContext; public class JmxInstrumentationWithConnectorTest extends EndpointReferenceTest { public void testJmxConfiguration() throws Exception { - InstrumentationAgent agent = getMandatoryBean(SpringInstrumentationAgent.class, "agent"); + InstrumentationAgent agent = getMandatoryBean(DefaultInstrumentationAgent.class, "agent"); assertNotNull("SpringInstrumentationAgent must be configured for JMX support", agent); assertNotNull("MBeanServer must be configured for JMX support", agent.getMBeanServer()); + assertEquals("org.apache.camel.test", agent.getMBeanServer().getDefaultDomain()); } @Override Modified: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/defaultJmxConfig.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/defaultJmxConfig.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/defaultJmxConfig.xml (original) +++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/defaultJmxConfig.xml Thu Jun 19 18:26:39 2008 @@ -23,7 +23,7 @@ "> <!-- START SNIPPET: example --> - <camelContext id="camel" useJmx="true" xmlns="http://activemq.apache.org/camel/schema/spring"> + <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring"> <route> <from uri="seda:start"/> <to uri="mock:result"/> Added: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/disableJmxConfig.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/disableJmxConfig.xml?rev=669756&view=auto ============================================================================== --- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/disableJmxConfig.xml (added) +++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/disableJmxConfig.xml Thu Jun 19 18:26:39 2008 @@ -0,0 +1,36 @@ +<?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: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.5.xsd + http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd + "> + + <!-- START SNIPPET: example --> + <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring"> + <jmxAgent id="agent" disabled="true"/> + + <route> + <from uri="seda:start"/> + <to uri="mock:result"/> + </route> + </camelContext> + <!-- END SNIPPET: example --> + +</beans> Propchange: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/disableJmxConfig.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/disableJmxConfig.xml ------------------------------------------------------------------------------ svn:keywords = Rev Date Propchange: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/disableJmxConfig.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/jmxConfig.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/jmxConfig.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/jmxConfig.xml (original) +++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/jmxConfig.xml Thu Jun 19 18:26:39 2008 @@ -23,8 +23,12 @@ "> <!-- START SNIPPET: example --> - <camelContext id="camel" useJmx="true" xmlns="http://activemq.apache.org/camel/schema/spring"> - <jmxAgent id="agent" connectorPort="20008" jmxDomainName="org.apache.camel.test"/> + <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring"> + <jmxAgent id="agent" registryPort="20008" + mbeanServerDefaultDomain="org.apache.camel.test" + createConnector="true" + /> + <route> <from uri="seda:start"/> <to uri="mock:result"/> Modified: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/management/jmxInstrumentationWithConnector.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/management/jmxInstrumentationWithConnector.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/management/jmxInstrumentationWithConnector.xml (original) +++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/management/jmxInstrumentationWithConnector.xml Thu Jun 19 18:26:39 2008 @@ -23,9 +23,23 @@ "> <!-- START SNIPPET: example --> + <bean id="agent" class="org.apache.camel.management.DefaultInstrumentationAgent"> + <property name="server" ref="mbeanServer"/> + </bean> + + <bean id="lifeCycleStrategy" class="org.apache.camel.management.InstrumentationLifecycleStrategy"> + <constructor-arg> + <ref bean="agent"/> + </constructor-arg> + <constructor-arg> + <ref bean="camel"/> + </constructor-arg> + </bean> + <bean id="mybean" class="org.apache.camel.spring.example.DummyBean"> <property name="endpoint" ref="endpoint1"/> </bean> + <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring"> <beanPostProcessor/> <endpoint id="endpoint1" uri="direct:start"/> @@ -37,10 +51,6 @@ </route> </camelContext> - <bean id="agent" class="org.apache.camel.spring.SpringInstrumentationAgent"> - <property name="camelContext" ref="camel"/> - <property name="MBeanServer" ref="mbeanServer"/> - </bean> <!-- this bean needs to be eagerly pre-instantiated in order for the exporting to occur; this means that it must not be marked as lazily initialized Modified: activemq/camel/trunk/components/camel-sql/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-sql/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-sql/pom.xml (original) +++ activemq/camel/trunk/components/camel-sql/pom.xml Thu Jun 19 18:26:39 2008 @@ -49,6 +49,22 @@ <type>test-jar</type> <scope>test</scope> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> Modified: activemq/camel/trunk/components/camel-stream/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-stream/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-stream/pom.xml (original) +++ activemq/camel/trunk/components/camel-stream/pom.xml Thu Jun 19 18:26:39 2008 @@ -61,6 +61,21 @@ <artifactId>log4j</artifactId> <scope>test</scope> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> Modified: activemq/camel/trunk/components/camel-xmlbeans/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-xmlbeans/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-xmlbeans/pom.xml (original) +++ activemq/camel/trunk/components/camel-xmlbeans/pom.xml Thu Jun 19 18:26:39 2008 @@ -71,6 +71,22 @@ <artifactId>log4j</artifactId> <scope>test</scope> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> @@ -81,3 +97,4 @@ </project> + Modified: activemq/camel/trunk/components/camel-xmpp/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-xmpp/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-xmpp/pom.xml (original) +++ activemq/camel/trunk/components/camel-xmpp/pom.xml Thu Jun 19 18:26:39 2008 @@ -59,6 +59,21 @@ <artifactId>smackx</artifactId> <version>2.2.1</version> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> <dependency> <groupId>junit</groupId> Modified: activemq/camel/trunk/components/camel-xstream/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-xstream/pom.xml?rev=669756&r1=669755&r2=669756&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-xstream/pom.xml (original) +++ activemq/camel/trunk/components/camel-xstream/pom.xml Thu Jun 19 18:26:39 2008 @@ -83,6 +83,22 @@ <artifactId>log4j</artifactId> <scope>test</scope> </dependency> + <!-- to allow Spring annotations (jmx) to be tested --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring-version}</version> + <optional>true</optional> + <scope>test</scope> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> @@ -93,3 +109,4 @@ </project> +
