[jboss-svn-commits] JBL Code SVN: r33598 - labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Jun 22 14:15:14 EDT 2010


Author: mark.proctor at jboss.com
Date: 2010-06-22 14:15:13 -0400 (Tue, 22 Jun 2010)
New Revision: 33598

Modified:
   labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsComponent.java
Log:
JBRULES-2347 Drools Camel
-removed embedded context, as it's no longer used.

Modified: labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsComponent.java
===================================================================
--- labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsComponent.java	2010-06-22 15:58:51 UTC (rev 33597)
+++ labs/jbossrules/trunk/drools-pipeline/drools-camel/src/main/java/org/drools/camel/component/DroolsComponent.java	2010-06-22 18:15:13 UTC (rev 33598)
@@ -34,7 +34,6 @@
     private static final String UUID_PREFIX = "drools-";
     private static final AtomicInteger counter = new AtomicInteger();
     
-    private CamelContext embeddedContext;
     private ExecutionNode node;
     private String nodeId = "";
 
@@ -45,17 +44,6 @@
         super(context);
     }
 
-    public CamelContext getEmbeddedContext() {
-        if (embeddedContext == null) {
-            createEmbeddedContext();
-        }
-        return embeddedContext;
-    }
-
-    public void setEmbeddedContext(CamelContext context) {
-        embeddedContext = context;
-    }
-
     public String getExecutionNodeId() {
         return nodeId;
     }
@@ -72,18 +60,6 @@
         this.node = node;
     }
 
-    /**
-     * There are two kinds of drools endpoints. One is the regular endpoint, one would refer two in 
-     * a camel route and is the only one a user should be aware of. However such drools endpoint
-     * are actually proxies for an entire hidden route (see documentation) because of many things that
-     * have to happen within a drools context that is normally not available on a regular camel route.
-     * This kind of endpoints would set up a new drools context aware route in a separate, hidden
-     * CamelContext embedded in the DroolsComponent. The second kind of endpoint is the one
-     * referred to in such an embedded route and must have a 'pipeline' parameter set.
-     * 
-     * The choice of using a pipeline parameter may be revisited. Another option would be to have the url
-     * contain a keyword something like drools:proxy://node/ksession1.
-     */
     @Override
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
         Endpoint endpoint;
@@ -91,23 +67,6 @@
         setProperties(endpoint, parameters);
         return endpoint;
     }
-
-    protected void createEmbeddedContext() {
-        // TODO: fix this temporary solution. Should be able to create a context from spring configuration as well
-        if (embeddedContext == null) {
-            CamelContext context;
-            try {
-                context = new DefaultCamelContext(getCamelContext().getRegistry());
-                context.disableJMX();
-                context.start();
-            } catch (Exception e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-                return;
-            }
-            embeddedContext = context;
-        }
-    }
     
     public static final String getSessionManagerId(String uri) {
         int pos = uri.indexOf('/');



More information about the jboss-svn-commits mailing list