svn commit: r566242 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/ camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/main/java/org/apache/camel/management/ camel-core/src/main/java/org/apache/camel/spi/ components/c...

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r566242 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/ camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/main/java/org/apache/camel/management/ camel-core/src/main/java/org/apache/camel/spi/ components/c...

jstrachan-2
Author: jstrachan
Date: Wed Aug 15 09:14:53 2007
New Revision: 566242

URL: http://svn.apache.org/viewvc?view=rev&rev=566242
Log:
applied patch for CAMEL-99 - many thanks Hadrian!

Added:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/InstrumentationAgent.java   (with props)
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/LifecycleStrategy.java   (with props)
Removed:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/InstrumentationAgent.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/LifecycleStrategy.java
Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultLifecycleStrategy.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationAgentImpl.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationLifecycleStrategy.java
    activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/managment/JmxInstrumentationWithConnectorTest.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java?view=diff&rev=566242&r1=566241&r2=566242
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java Wed Aug 15 09:14:53 2007
@@ -24,6 +24,7 @@
 import org.apache.camel.spi.ExchangeConverter;
 import org.apache.camel.spi.Injector;
 import org.apache.camel.spi.Language;
+import org.apache.camel.spi.LifecycleStrategy;
 import org.apache.camel.spi.Registry;
 import org.apache.camel.model.RouteType;
 
@@ -158,7 +159,7 @@
      */
     void addRouteDefinitions(Collection<RouteType> routeDefinitions) throws Exception;
 
-    
+
     // Properties
     //-----------------------------------------------------------------------
 

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?view=diff&rev=566242&r1=566241&r2=566242
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java Wed Aug 15 09:14:53 2007
@@ -30,7 +30,7 @@
 import org.apache.camel.Component;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
-import org.apache.camel.LifecycleStrategy;
+import org.apache.camel.spi.LifecycleStrategy;
 import org.apache.camel.Processor;
 import org.apache.camel.ResolveEndpointFailedException;
 import org.apache.camel.Route;

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultLifecycleStrategy.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultLifecycleStrategy.java?view=diff&rev=566242&r1=566241&r2=566242
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultLifecycleStrategy.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultLifecycleStrategy.java Wed Aug 15 09:14:53 2007
@@ -20,7 +20,7 @@
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
-import org.apache.camel.LifecycleStrategy;
+import org.apache.camel.spi.LifecycleStrategy;
 import org.apache.camel.Route;
 import org.apache.camel.Service;
 

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationAgentImpl.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationAgentImpl.java?view=diff&rev=566242&r1=566241&r2=566242
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationAgentImpl.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationAgentImpl.java Wed Aug 15 09:14:53 2007
@@ -32,7 +32,7 @@
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
-import org.apache.camel.InstrumentationAgent;
+import org.apache.camel.spi.InstrumentationAgent;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource;
 import org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler;

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationLifecycleStrategy.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationLifecycleStrategy.java?view=diff&rev=566242&r1=566241&r2=566242
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationLifecycleStrategy.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationLifecycleStrategy.java Wed Aug 15 09:14:53 2007
@@ -23,8 +23,8 @@
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
-import org.apache.camel.InstrumentationAgent;
-import org.apache.camel.LifecycleStrategy;
+import org.apache.camel.spi.InstrumentationAgent;
+import org.apache.camel.spi.LifecycleStrategy;
 import org.apache.camel.Route;
 import org.apache.camel.Service;
 import org.apache.camel.impl.DefaultCamelContext;

Added: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/InstrumentationAgent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/InstrumentationAgent.java?view=auto&rev=566242
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/InstrumentationAgent.java (added)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/InstrumentationAgent.java Wed Aug 15 09:14:53 2007
@@ -0,0 +1,59 @@
+/**
+ * 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.spi;
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+public interface InstrumentationAgent {
+
+    /**
+     * Registers object with management infrastructure with a specific name. Object must be annotated or
+     * implement standard MBean interface.
+     * @param obj
+     * @param name
+     * @throws JMException
+     */
+    void register(Object obj, ObjectName name) throws JMException;
+    
+    /**
+     * Registers object with management infrastructure with a specific name. Object must be annotated or
+     * implement standard MBean interface.
+     * @param obj
+     * @param name
+     * @param forceRegistration if set to true, then component will be registered despite existing component.
+     * @throws JMException
+     */
+    void register(Object obj, ObjectName name, boolean forceRegistration) throws JMException;
+    
+    /**
+     * Unregisters component based upon registered name
+     * @param name
+     * @throws JMException
+     */
+    void unregister(ObjectName name) throws JMException;
+
+    /**
+     * Get the MBeanServer which hosts managed components
+     * NOTE: if the configuration is not set the JMXEnabled to be true, this method
+     * will return null
+     * @return the MBeanServer
+     */
+    MBeanServer getMBeanServer();
+
+}

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/InstrumentationAgent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/LifecycleStrategy.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/LifecycleStrategy.java?view=auto&rev=566242
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/LifecycleStrategy.java (added)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/LifecycleStrategy.java Wed Aug 15 09:14:53 2007
@@ -0,0 +1,47 @@
+/**
+ * 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.spi;
+
+import java.util.Collection;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Route;
+import org.apache.camel.Service;
+
+public interface LifecycleStrategy {
+
+ /**
+     * Notification on adding a {@see CamelContext}.
+     */
+ void onContextCreate(CamelContext context);
+
+ /**
+     * Notification on adding an {@see Endpoint}.
+     */
+ void onEndpointAdd(Endpoint endpoint);
+
+ /**
+     * Notification on adding a {@see Route}.
+     */
+ void onServiceAdd(CamelContext context, Service service);
+
+ /**
+     * Notification on adding {@see Route}(s).
+     */
+ void onRoutesAdd(Collection<Route> routes);
+}

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/LifecycleStrategy.java
------------------------------------------------------------------------------
    svn:eol-style = native

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?view=diff&rev=566242&r1=566241&r2=566242
==============================================================================
--- 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 Wed Aug 15 09:14:53 2007
@@ -17,7 +17,7 @@
  */
 package org.apache.camel.spring.managment;
 
-import org.apache.camel.InstrumentationAgent;
+import org.apache.camel.spi.InstrumentationAgent;
 import org.apache.camel.spring.EndpointReferenceTest;
 import org.apache.camel.spring.SpringInstrumentationAgent;
 import org.springframework.context.support.ClassPathXmlApplicationContext;