activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r530541 - in /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel: Component.java impl/DefaultEndpoint.java
Date Thu, 19 Apr 2007 20:50:48 GMT
Author: chirino
Date: Thu Apr 19 13:50:47 2007
New Revision: 530541

URL: http://svn.apache.org/viewvc?view=rev&rev=530541
Log:
removed the getExecutorService() method from Component interface since that was a leaky abstraction.

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Component.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Component.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Component.java?view=diff&rev=530541&r1=530540&r2=530541
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Component.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Component.java Thu Apr
19 13:50:47 2007
@@ -16,7 +16,6 @@
  */
 package org.apache.camel;
 
-import java.util.concurrent.ScheduledExecutorService;
 
 /**
  * Represents a component which manages a set of {@link Endpoint} objects.
@@ -36,14 +35,6 @@
      * The {@link CamelContext} is injected into the component when it is added to it
      */
     void setCamelContext(CamelContext context);
-
-
-    /**
-     * Returns the executor for this endpoint which typically defaults to the components
executor
-     *
-     * @return the executor for this endpoint
-     */
-    ScheduledExecutorService getExecutorService();
 
     /**
      * Attempt to resolve an endpoint for the given URI if the component is capable of handling
the URI

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java?view=diff&rev=530541&r1=530540&r2=530541
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
Thu Apr 19 13:50:47 2007
@@ -16,17 +16,17 @@
  */
 package org.apache.camel.impl;
 
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.atomic.AtomicBoolean;
+
 import org.apache.camel.CamelContext;
+import org.apache.camel.Component;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.Service;
-import org.apache.camel.Component;
 import org.apache.camel.util.ObjectHelper;
 
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.ScheduledExecutorService;
-
 /**
  * A default endpoint useful for implementation inheritance
  * 
@@ -76,7 +76,12 @@
     }
 
     public ScheduledExecutorService getExecutorService() {
-        return getComponent().getExecutorService();
+    	Component c = getComponent();
+    	if( c!=null && c instanceof DefaultComponent ) {
+    		DefaultComponent dc = (DefaultComponent) c;
+    		return dc.getExecutorService();
+    	}
+		return null;
     }
 
     /**



Mime
View raw message