camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r620553 - /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DelegateLifecycleStrategy.java
Date Mon, 11 Feb 2008 17:53:36 GMT
Author: jstrachan
Date: Mon Feb 11 09:53:28 2008
New Revision: 620553

URL: http://svn.apache.org/viewvc?rev=620553&view=rev
Log:
added a little helper class

Added:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DelegateLifecycleStrategy.java
      - copied, changed from r620478, activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultLifecycleStrategy.java

Copied: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DelegateLifecycleStrategy.java
(from r620478, 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/DelegateLifecycleStrategy.java?p2=activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DelegateLifecycleStrategy.java&p1=activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultLifecycleStrategy.java&r1=620478&r2=620553&rev=620553&view=diff
==============================================================================
--- 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/DelegateLifecycleStrategy.java
Mon Feb 11 09:53:28 2008
@@ -25,25 +25,35 @@
 import org.apache.camel.Route;
 import org.apache.camel.Service;
 
-public class DefaultLifecycleStrategy implements LifecycleStrategy {
+/**
+ * A helper class for folks writing delegate listener strategies
+ *
+ * @version $Revision: 1.1 $
+ */
+public class DelegateLifecycleStrategy implements LifecycleStrategy {
+    private final LifecycleStrategy delegate;
 
-	public void onContextCreate(CamelContext context) {
-		// do nothing
-	}
-	
-	public void onEndpointAdd(Endpoint<? extends Exchange> endpoint) {
-		// do nothing
-	}
-
-	public void onServiceAdd(CamelContext context, Service service) {
-		// do nothing
-	}
-
-	public void onRoutesAdd(Collection<Route> routes) {
-		// do nothing
-	}
-
-	public void onRouteContextCreate(RouteContext routeContext) {
-		// do nothing
-	}
-}
+    public DelegateLifecycleStrategy(LifecycleStrategy delegate) {
+        this.delegate = delegate;
+    }
+
+    public void onContextCreate(CamelContext context) {
+        delegate.onContextCreate(context);
+    }
+
+    public void onEndpointAdd(Endpoint<? extends Exchange> endpoint) {
+        delegate.onEndpointAdd(endpoint);
+    }
+
+    public void onRouteContextCreate(RouteContext routeContext) {
+        delegate.onRouteContextCreate(routeContext);
+    }
+
+    public void onRoutesAdd(Collection<Route> routes) {
+        delegate.onRoutesAdd(routes);
+    }
+
+    public void onServiceAdd(CamelContext context, Service service) {
+        delegate.onServiceAdd(context, service);
+    }
+}
\ No newline at end of file



Mime
View raw message