servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r526407 [2/4] - in /incubator/servicemix/trunk/deployables/serviceengines: servicemix-bean/src/main/java/org/apache/servicemix/bean/ servicemix-bean/src/main/java/org/apache/servicemix/bean/support/ servicemix-bean/src/test/java/org/apache/...
Date Sat, 07 Apr 2007 08:35:53 GMT
Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/PlainBeanEndpointTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/PlainBeanEndpointTest.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/PlainBeanEndpointTest.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/PlainBeanEndpointTest.java Sat Apr  7 01:35:49 2007
@@ -16,23 +16,24 @@
  */
 package org.apache.servicemix.bean;
 
-import org.apache.servicemix.tck.SpringTestSupport;
-import org.apache.servicemix.client.DefaultServiceMixClient;
-import org.apache.servicemix.jbi.resolver.URIResolver;
-import org.apache.servicemix.jbi.jaxp.StringSource;
-import org.apache.servicemix.jbi.jaxp.SourceTransformer;
-import org.apache.servicemix.bean.beans.PlainBean;
-import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
-import org.w3c.dom.DocumentFragment;
-import org.springframework.context.support.AbstractXmlApplicationContext;
-
-import javax.jbi.servicedesc.ServiceEndpoint;
+import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.InOnly;
 import javax.jbi.messaging.MessageExchange;
-import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.NormalizedMessage;
+import javax.jbi.servicedesc.ServiceEndpoint;
 import javax.xml.namespace.QName;
 
+import org.w3c.dom.DocumentFragment;
+
+import org.apache.servicemix.bean.beans.PlainBean;
+import org.apache.servicemix.client.DefaultServiceMixClient;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.jbi.resolver.URIResolver;
+import org.apache.servicemix.tck.SpringTestSupport;
+import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+
 public class PlainBeanEndpointTest extends SpringTestSupport {
 
     public void testSendingToDynamicEndpointForPlainBeanWithFooOperation() throws Exception {
@@ -128,7 +129,8 @@
         PlainBean bean = (PlainBean) getBean("plainBean");
         Object property = bean.getPropertyParameter();
         Object xpath = bean.getXpathParameter();
-        log.info("Bean's methodWithPropertyParameterAndXPath() method has been with property: " + property + " and xpath: " + xpath);
+        log.info("Bean's methodWithPropertyParameterAndXPath() method has been with property: "
+                + property + " and xpath: " + xpath);
 
         assertEquals("property parameter", "James", property);
         assertEquals("xpath parameter", "London", xpath);
@@ -155,7 +157,8 @@
         PlainBean bean = (PlainBean) getBean("plainBean");
         Object property = bean.getPropertyParameter();
         Object body = bean.getBody();
-        log.info("Bean's methodWithPropertyParameterAndContent() method has been with property: " + property + " and body: " + body);
+        log.info("Bean's methodWithPropertyParameterAndContent() method has been with property: "
+                + property + " and body: " + body);
 
         assertEquals("property parameter", "James", property);
         // TODO need to add a marshalling example
@@ -166,12 +169,10 @@
         if (me.getStatus() == ExchangeStatus.ERROR) {
             if (me.getError() != null) {
                 throw me.getError();
-            }
-            else {
+            } else {
                 fail("Received ERROR status");
             }
-        }
-        else if (me.getFault() != null) {
+        } else if (me.getFault() != null) {
             fail("Received fault: " + new SourceTransformer().toString(me.getFault().getContent()));
         }
     }

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/SpringComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/SpringComponentTest.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/SpringComponentTest.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/SpringComponentTest.java Sat Apr  7 01:35:49 2007
@@ -16,19 +16,19 @@
  */
 package org.apache.servicemix.bean;
 
-import org.apache.servicemix.tck.SpringTestSupport;
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOnly;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.NormalizedMessage;
+import javax.xml.namespace.QName;
+
+import org.apache.servicemix.bean.beans.ListenerBean;
 import org.apache.servicemix.client.DefaultServiceMixClient;
-import org.apache.servicemix.jbi.jaxp.StringSource;
 import org.apache.servicemix.jbi.jaxp.SourceTransformer;
-import org.apache.servicemix.bean.beans.ListenerBean;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.tck.SpringTestSupport;
 import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
 import org.springframework.context.support.AbstractXmlApplicationContext;
-
-import javax.jbi.messaging.InOnly;
-import javax.jbi.messaging.NormalizedMessage;
-import javax.jbi.messaging.MessageExchange;
-import javax.jbi.messaging.ExchangeStatus;
-import javax.xml.namespace.QName;
 
 public class SpringComponentTest extends SpringTestSupport {
 

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/UriTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/UriTest.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/UriTest.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/UriTest.java Sat Apr  7 01:35:49 2007
@@ -16,18 +16,19 @@
  */
 package org.apache.servicemix.bean;
 
+import java.net.URI;
+
 import junit.framework.TestCase;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.net.URI;
-
 /**
  * @version $Revision: $
  */
 public class UriTest extends TestCase {
 
-    private static final Log log = LogFactory.getLog(UriTest.class);
+    private static final Log LOG = LogFactory.getLog(UriTest.class);
     
     public void testSimpleURI() throws Exception {
         URI uri = new URI("bean:cheese");
@@ -61,21 +62,21 @@
     }
 
     protected void dump(URI uri) {
-        log.info("URI: " + uri);
-        log.info("getAuthority(): " + uri.getAuthority());
-        log.info("getFragment(): " + uri.getFragment());
-        log.info("getHost(): " + uri.getHost());
-        log.info("getPath(): " + uri.getPath());
-        log.info("getPort(): " + uri.getPort());
-        log.info("getQuery(): " + uri.getQuery());
-        log.info("getRawAuthority(): " + uri.getRawAuthority());
-        log.info("getRawFragment(): " + uri.getRawFragment());
-        log.info("getRawPath(): " + uri.getRawPath());
-        log.info("getRawQuery(): " + uri.getRawQuery());
-        log.info("getRawSchemeSpecificPart(): " + uri.getRawSchemeSpecificPart());
-        log.info("getRawUserInfo(): " + uri.getRawUserInfo());
-        log.info("getScheme(): " + uri.getScheme());
-        log.info("getSchemeSpecificPart(): " + uri.getSchemeSpecificPart());
-        log.info("getUserInfo(): " + uri.getUserInfo());
+        LOG.info("URI: " + uri);
+        LOG.info("getAuthority(): " + uri.getAuthority());
+        LOG.info("getFragment(): " + uri.getFragment());
+        LOG.info("getHost(): " + uri.getHost());
+        LOG.info("getPath(): " + uri.getPath());
+        LOG.info("getPort(): " + uri.getPort());
+        LOG.info("getQuery(): " + uri.getQuery());
+        LOG.info("getRawAuthority(): " + uri.getRawAuthority());
+        LOG.info("getRawFragment(): " + uri.getRawFragment());
+        LOG.info("getRawPath(): " + uri.getRawPath());
+        LOG.info("getRawQuery(): " + uri.getRawQuery());
+        LOG.info("getRawSchemeSpecificPart(): " + uri.getRawSchemeSpecificPart());
+        LOG.info("getRawUserInfo(): " + uri.getRawUserInfo());
+        LOG.info("getScheme(): " + uri.getScheme());
+        LOG.info("getSchemeSpecificPart(): " + uri.getSchemeSpecificPart());
+        LOG.info("getUserInfo(): " + uri.getUserInfo());
     }
 }

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/AnnotatedBean.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/AnnotatedBean.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/AnnotatedBean.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/AnnotatedBean.java Sat Apr  7 01:35:49 2007
@@ -29,7 +29,7 @@
  */
 public class AnnotatedBean {
 
-    private static final Log log = LogFactory.getLog(AnnotatedBean.class);
+    private static final Log LOG = LogFactory.getLog(AnnotatedBean.class);
 
     private MessageExchange myExchangeMethod;
 
@@ -37,7 +37,7 @@
     public void myExchangeMethod(MessageExchange messageExchange) {
         this.myExchangeMethod = messageExchange;
 
-        log.info("myExchangeMethod() received exchange: " + messageExchange);
+        LOG.info("myExchangeMethod() received exchange: " + messageExchange);
     }
     
     public MessageExchange getMyExchangeMethod() {

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/AutoDeployedBean.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/AutoDeployedBean.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/AutoDeployedBean.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/AutoDeployedBean.java Sat Apr  7 01:35:49 2007
@@ -1,5 +1,4 @@
-/**
- *
+/*
  * 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.
@@ -7,7 +6,7 @@
  * (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
+ *      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,
@@ -17,35 +16,27 @@
  */
 package org.apache.servicemix.bean.beans;
 
+import javax.jbi.messaging.MessageExchange;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.bean.Property;
-import org.apache.servicemix.bean.XPath;
-import org.apache.servicemix.bean.Content;
 import org.apache.servicemix.bean.Endpoint;
 
-import javax.jbi.messaging.MessageExchange;
-
 /**
  * A simple POJO which uses annotations to expose it on a JBI bus
  *
  * @version $Revision$
  */
-@Endpoint(name="cheese", targetNamespace = "urn:test", serviceName = "service")
+@Endpoint(name = "cheese", targetNamespace = "urn:test", serviceName = "service")
 public class AutoDeployedBean {
 
-    private static final Log log = LogFactory.getLog(AutoDeployedBean.class);
-
-    private MessageExchange foo;
-    private MessageExchange bar;
+    private static final Log LOG = LogFactory.getLog(AutoDeployedBean.class);
 
     public void foo(MessageExchange messageExchange) {
-        this.foo = messageExchange;
-        log.info("foo() called with exchange: " + messageExchange);
+        LOG.info("foo() called with exchange: " + messageExchange);
     }
 
     public void bar(MessageExchange messageExchange) {
-        this.bar = messageExchange;
-        log.info("bar() called with exchange: " + messageExchange);
+        LOG.info("bar() called with exchange: " + messageExchange);
     }
 }

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/ConsumerBean.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/ConsumerBean.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/ConsumerBean.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/ConsumerBean.java Sat Apr  7 01:35:49 2007
@@ -43,10 +43,10 @@
     @Resource
     private DeliveryChannel channel;
     
-    @ExchangeTarget(uri="service:urn:service1")
+    @ExchangeTarget(uri = "service:urn:service1")
     private Destination service1;
 
-    @ExchangeTarget(uri="service:urn:service2")
+    @ExchangeTarget(uri = "service:urn:service2")
     private Destination service2;  
     
     /**
@@ -80,10 +80,10 @@
         request2 = service2.send(MessageUtil.copy(message));
     }
     
-    @Callback(condition="this.request1.done && this.request2.done")
+    @Callback(condition = "this.request1.done && this.request2.done")
     public NormalizedMessage answer() throws InterruptedException, ExecutionException {
-        NormalizedMessage answer1 = request1.get();
-        NormalizedMessage answer2 = request2.get();
+        request1.get();
+        request2.get();
         return null;
     }
     

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/ConsumerListener.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/ConsumerListener.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/ConsumerListener.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/ConsumerListener.java Sat Apr  7 01:35:49 2007
@@ -16,9 +16,6 @@
  */
 package org.apache.servicemix.bean.beans;
 
-import org.apache.servicemix.MessageExchangeListener;
-import org.apache.servicemix.jbi.util.MessageUtil;
-
 import javax.annotation.Resource;
 import javax.jbi.messaging.DeliveryChannel;
 import javax.jbi.messaging.InOut;
@@ -26,6 +23,9 @@
 import javax.jbi.messaging.MessageExchangeFactory;
 import javax.jbi.messaging.MessagingException;
 
+import org.apache.servicemix.MessageExchangeListener;
+import org.apache.servicemix.jbi.util.MessageUtil;
+
 public class ConsumerListener implements MessageExchangeListener {
 
     @Resource
@@ -36,11 +36,9 @@
         InOut io = factory.createInOutExchange();
         try {
             MessageUtil.transferInToIn(exchange, io);
-        }
-        catch (MessagingException e) {
+        } catch (MessagingException e) {
             throw e;
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             throw new MessagingException(e);
         }
     }

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/ListenerBean.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/ListenerBean.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/ListenerBean.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/ListenerBean.java Sat Apr  7 01:35:49 2007
@@ -16,16 +16,16 @@
  */
 package org.apache.servicemix.bean.beans;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.MessageExchangeListener;
-
 import javax.annotation.Resource;
 import javax.jbi.messaging.DeliveryChannel;
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.MessageExchange;
 import javax.jbi.messaging.MessagingException;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.MessageExchangeListener;
+
 /**
  * A simple POJO which implements the {@link MessageExchangeListener} interface
  *
@@ -33,7 +33,7 @@
  */
 public class ListenerBean implements MessageExchangeListener {
 
-    private static final Log log = LogFactory.getLog(ListenerBean.class);
+    private static final Log LOG = LogFactory.getLog(ListenerBean.class);
 
     @Resource
     private DeliveryChannel channel;
@@ -43,7 +43,7 @@
 
     public void onMessageExchange(MessageExchange exchange) throws MessagingException {
         this.lastExchange = exchange;
-        log.info("Received exchange: " + exchange);
+        LOG.info("Received exchange: " + exchange);
         exchange.setStatus(ExchangeStatus.DONE);
         channel.send(exchange);
     }

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/PlainBean.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/PlainBean.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/PlainBean.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/PlainBean.java Sat Apr  7 01:35:49 2007
@@ -16,13 +16,13 @@
  */
 package org.apache.servicemix.bean.beans;
 
+import javax.jbi.messaging.MessageExchange;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.bean.Content;
 import org.apache.servicemix.bean.Property;
 import org.apache.servicemix.bean.XPath;
-import org.apache.servicemix.bean.Content;
-
-import javax.jbi.messaging.MessageExchange;
 
 /**
  * A simple POJO which uses no annotations
@@ -31,7 +31,7 @@
  */
 public class PlainBean {
 
-    private static final Log log = LogFactory.getLog(PlainBean.class);
+    private static final Log LOG = LogFactory.getLog(PlainBean.class);
 
     private MessageExchange foo;
     private MessageExchange bar;
@@ -41,29 +41,30 @@
 
     public void foo(MessageExchange messageExchange) {
         this.foo = messageExchange;
-        log.info("foo() called with exchange: " + messageExchange);
+        LOG.info("foo() called with exchange: " + messageExchange);
     }
 
     public void bar(MessageExchange messageExchange) {
         this.bar = messageExchange;
-        log.info("bar() called with exchange: " + messageExchange);
+        LOG.info("bar() called with exchange: " + messageExchange);
     }
 
     public void methodWithPropertyParameter(@Property(name = "person") String name) {
         this.propertyParameter = name;
-        log.info("methodWithPropertyParameter() called with parameter: " + name);
+        LOG.info("methodWithPropertyParameter() called with parameter: " + name);
     }
 
-    public void methodWithPropertyParameterAndXPath(@Property(name = "person") String name, @XPath(xpath="/hello/@address") String address) {
+    public void methodWithPropertyParameterAndXPath(@Property(name = "person") String name,
+            @XPath(xpath = "/hello/@address") String address) {
         this.propertyParameter = name;
         this.xpathParameter = address;
-        log.info("methodWithPropertyParameterAndXPath() called with parameter: " + address);
+        LOG.info("methodWithPropertyParameterAndXPath() called with parameter: " + address);
     }
 
-    public void methodWithPropertyParameterAndContent(@Property(name = "person") String name, @Content Object body) {
+    public void methodWithPropertyParameterAndContent(@Property(name = "person") String name, @Content Object content) {
         this.propertyParameter = name;
-        this.body = body;
-        log.info("methodWithPropertyParameterAndContent() called with body: " + body);
+        this.body = content;
+        LOG.info("methodWithPropertyParameterAndContent() called with body: " + content);
     }
 
 

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/DroolsComponent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/DroolsComponent.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/DroolsComponent.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/DroolsComponent.java Sat Apr  7 01:35:49 2007
@@ -34,7 +34,7 @@
     }
 
     protected Class[] getEndpointClasses() {
-        return new Class[] { DroolsEndpoint.class };
+        return new Class[] {DroolsEndpoint.class };
     }
 
     /**

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/DroolsEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/DroolsEndpoint.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/DroolsEndpoint.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/DroolsEndpoint.java Sat Apr  7 01:35:49 2007
@@ -131,12 +131,11 @@
             try {
                 if (ruleBaseResource != null) {
                     is = ruleBaseResource.getInputStream();
-                }
-                else if (ruleBaseURL != null) {
+                } else if (ruleBaseURL != null) {
                     is = ruleBaseURL.openStream();
-                }
-                else {
-                    throw new IllegalArgumentException("Property ruleBase, ruleBaseResource or ruleBaseURL must be set");
+                } else {
+                    throw new IllegalArgumentException("Property ruleBase, ruleBaseResource "
+                            + "or ruleBaseURL must be set");
                 }
                 RuleBaseLoader loader = RuleBaseLoader.getInstance();
                 ruleBase = loader.loadFromReader(new InputStreamReader(is));
@@ -151,7 +150,8 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.servicemix.common.endpoints.ProviderEndpoint#process(javax.jbi.messaging.MessageExchange, javax.jbi.messaging.NormalizedMessage)
+     * @see org.apache.servicemix.common.endpoints.ProviderEndpoint#process(
+     *      javax.jbi.messaging.MessageExchange, javax.jbi.messaging.NormalizedMessage)
      */
     public void process(MessageExchange exchange) throws Exception {
         drools(exchange);
@@ -167,8 +167,7 @@
     }
     
     protected WorkingMemory createWorkingMemory(MessageExchange exchange) throws Exception {
-        WorkingMemory memory = ruleBase.newWorkingMemory();
-        return memory;
+        return ruleBase.newWorkingMemory();
     }
 
     protected void populateWorkingMemory(WorkingMemory memory, MessageExchange exchange) throws Exception {

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/Exchange.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/Exchange.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/Exchange.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/Exchange.java Sat Apr  7 01:35:49 2007
@@ -45,7 +45,18 @@
     public Exchange(MessageExchange exchange, NamespaceContext namespaceContext) {
         this.exchange = exchange;
         this.namespaceContext = namespaceContext;
-        update();
+        if (in == null) {
+            NormalizedMessage msg = exchange.getMessage("in");
+            in = msg != null ? new Message(msg, this.namespaceContext) : null;
+        }
+        if (out == null) {
+            NormalizedMessage msg = exchange.getMessage("out");
+            out = msg != null ? new Message(msg, this.namespaceContext) : null;
+        }
+        if (fault == null) {
+            javax.jbi.messaging.Fault msg = exchange.getFault();
+            fault = msg != null ? new Fault(msg, this.namespaceContext) : null;
+        }
     }
     
     public MessageExchange getInternalExchange() {
@@ -105,21 +116,6 @@
     protected Message getMessage(String name) {
         NormalizedMessage msg = exchange.getMessage(name);
         return msg != null ? new Message(msg, this.namespaceContext) : null;
-    }
-    
-    protected void update() {
-        if (in == null) {
-            NormalizedMessage msg = exchange.getMessage("in");
-            in = msg != null ? new Message(msg, this.namespaceContext) : null;
-        }
-        if (out == null) {
-            NormalizedMessage msg = exchange.getMessage("out");
-            out = msg != null ? new Message(msg, this.namespaceContext) : null;
-        }
-        if (fault == null) {
-            javax.jbi.messaging.Fault msg = exchange.getFault();
-            fault = msg != null ? new Fault(msg,this.namespaceContext) : null;
-        }
     }
     
 }

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/JbiHelper.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/JbiHelper.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/JbiHelper.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/JbiHelper.java Sat Apr  7 01:35:49 2007
@@ -101,50 +101,50 @@
     */
 
     public void route(String uri) throws MessagingException {
-        MessageExchange exchange = this.exchange.getInternalExchange();
-        NormalizedMessage in = exchange.getMessage("in");
-        MessageExchange me = getChannel().createExchangeFactory().createExchange(exchange.getPattern());
-        URIResolver.configureExchange(me, getContext(), uri);
-        MessageUtil.transferToIn(in, me);
-        getChannel().sendSync(me);
-        if (me.getStatus() == ExchangeStatus.DONE) {
-            exchange.setStatus(ExchangeStatus.DONE);
-            getChannel().send(exchange);
-        } else if (me.getStatus() == ExchangeStatus.ERROR) {
-            exchange.setStatus(ExchangeStatus.ERROR);
-            exchange.setError(me.getError());
-            getChannel().send(exchange);
+        MessageExchange me = this.exchange.getInternalExchange();
+        NormalizedMessage in = me.getMessage("in");
+        MessageExchange newMe = getChannel().createExchangeFactory().createExchange(me.getPattern());
+        URIResolver.configureExchange(newMe, getContext(), uri);
+        MessageUtil.transferToIn(in, newMe);
+        getChannel().sendSync(newMe);
+        if (newMe.getStatus() == ExchangeStatus.DONE) {
+            me.setStatus(ExchangeStatus.DONE);
+            getChannel().send(me);
+        } else if (newMe.getStatus() == ExchangeStatus.ERROR) {
+            me.setStatus(ExchangeStatus.ERROR);
+            me.setError(newMe.getError());
+            getChannel().send(me);
         } else {
-            if (me.getFault() != null) {
-                MessageUtil.transferFaultToFault(me, exchange);
+            if (newMe.getFault() != null) {
+                MessageUtil.transferFaultToFault(newMe, me);
             } else {
-                MessageUtil.transferOutToOut(me, exchange);
+                MessageUtil.transferOutToOut(newMe, me);
             }
-            getChannel().sendSync(exchange);
+            getChannel().sendSync(me);
         }
         update();
     }
 
     public void fault(String content) throws Exception {
-        MessageExchange exchange = this.exchange.getInternalExchange();
-        if (exchange instanceof InOnly) {
-            exchange.setError(new Exception(content));
-            getChannel().send(exchange);
+        MessageExchange me = this.exchange.getInternalExchange();
+        if (me instanceof InOnly) {
+            me.setError(new Exception(content));
+            getChannel().send(me);
         } else {
-            Fault fault = exchange.createFault();
+            Fault fault = me.createFault();
             fault.setContent(new StringSource(content));
-            exchange.setFault(fault);
-            getChannel().sendSync(exchange);
+            me.setFault(fault);
+            getChannel().sendSync(me);
         }
         update();
     }
 
     public void answer(String content) throws Exception {
-        MessageExchange exchange = this.exchange.getInternalExchange();
-        NormalizedMessage out = exchange.createMessage();
+        MessageExchange me = this.exchange.getInternalExchange();
+        NormalizedMessage out = me.createMessage();
         out.setContent(new StringSource(content));
-        exchange.setMessage(out, "out");
-        getChannel().sendSync(exchange);
+        me.setMessage(out, "out");
+        getChannel().sendSync(me);
         update();
     }
 

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/Message.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/Message.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/Message.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/Message.java Sat Apr  7 01:35:49 2007
@@ -21,14 +21,15 @@
 import javax.xml.transform.Source;
 import javax.xml.transform.dom.DOMSource;
 
+import org.w3c.dom.Element;
+
 import org.apache.servicemix.expression.JAXPBooleanXPathExpression;
 import org.apache.servicemix.expression.JAXPStringXPathExpression;
 import org.apache.servicemix.jbi.jaxp.SourceTransformer;
-import org.w3c.dom.Element;
 
 public class Message {
 
-    private final static SourceTransformer TRANFORMER = new SourceTransformer();
+    private static final SourceTransformer TRANFORMER = new SourceTransformer();
     
     private final NormalizedMessage message;
     private final NamespaceContext namespaceContext;
@@ -65,10 +66,9 @@
     public String valueOf(String xpath) throws Exception {
         JAXPStringXPathExpression expression = new JAXPStringXPathExpression(xpath);
         if (this.namespaceContext != null) {
-        	expression.setNamespaceContext(this.namespaceContext);
+            expression.setNamespaceContext(this.namespaceContext);
         }
-        String res = (String)expression.evaluate(null, message);
-        return res;
+        return (String)expression.evaluate(null, message);
     }
     
     

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/support/NamespaceContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/support/NamespaceContextImpl.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/support/NamespaceContextImpl.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/main/java/org/apache/servicemix/drools/support/NamespaceContextImpl.java Sat Apr  7 01:35:49 2007
@@ -41,13 +41,14 @@
      * is used to ensure that {@link #getPrefix(String)} always returns the same
      * prefix, unless that prefix is removed.
      */
-    private Map namespaces = new LinkedHashMap();
+    private Map<String, String> namespaces;
     
     /**
      * Constructs a SimpleNamespaceContext with no parent context or namespace
      * declarations.
      */
     public NamespaceContextImpl() {
+        this.namespaces = new LinkedHashMap<String, String>();
     }
     
     /**
@@ -56,8 +57,8 @@
      * 
      * @param namespaces A Map of namespace URIs, keyed by their prefixes.
      */
-    public NamespaceContextImpl(Map namespaces) {
-        setNamespaces(namespaces);
+    public NamespaceContextImpl(Map<String, String> namespaces) {
+        this.namespaces = new LinkedHashMap<String, String>(namespaces);
     }
     
     /**
@@ -71,7 +72,7 @@
     /**
      * @param namespaces The namespaces to set.
      */
-    public void setNamespaces(Map namespaces) {
+    public void setNamespaces(Map<String, String> namespaces) {
         this.namespaces.clear();
         if (namespaces != null) {
             this.namespaces.putAll(namespaces);
@@ -131,7 +132,7 @@
     /* (non-Javadoc)
      * @see javax.xml.namespace.NamespaceContext#getPrefixes(java.lang.String)
      */
-    public Iterator getPrefixes(String nsURI) {
+    public Iterator<String> getPrefixes(String nsURI) {
         if (nsURI == null) {
             throw new IllegalArgumentException("nsURI was null");
         } else if (nsURI.length() == 0) {
@@ -141,14 +142,12 @@
         } else if (nsURI.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
             return Collections.singleton(XMLConstants.XMLNS_ATTRIBUTE).iterator();
         }
-        Set prefixes = null;
-        Iterator iter = namespaces.entrySet().iterator();
-        while (iter.hasNext()) {
-            Map.Entry entry = (Map.Entry) iter.next();
-            String uri = (String) entry.getValue();
+        Set<String> prefixes = null;
+        for (Map.Entry<String, String> entry : namespaces.entrySet()) {
+            String uri = entry.getValue();
             if (uri.equals(nsURI)) {
                 if (prefixes == null) {
-                    prefixes = new HashSet();
+                    prefixes = new HashSet<String>();
                 }
                 prefixes.add(entry.getKey());
             }
@@ -158,7 +157,8 @@
         } else if (nsURI.length() == 0) {
             return Collections.singleton("").iterator();
         } else {
-            return Collections.EMPTY_LIST.iterator();
+            prefixes = Collections.emptySet();
+            return prefixes.iterator();
         }
     }
     

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/test/java/org/apache/servicemix/drools/DroolsComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/test/java/org/apache/servicemix/drools/DroolsComponentTest.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/test/java/org/apache/servicemix/drools/DroolsComponentTest.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-drools/src/test/java/org/apache/servicemix/drools/DroolsComponentTest.java Sat Apr  7 01:35:49 2007
@@ -21,6 +21,8 @@
 import javax.jbi.messaging.InOut;
 import javax.xml.namespace.QName;
 
+import org.w3c.dom.Element;
+
 import junit.framework.TestCase;
 
 import org.apache.servicemix.client.DefaultServiceMixClient;
@@ -31,7 +33,6 @@
 import org.apache.servicemix.jbi.jaxp.StringSource;
 import org.apache.servicemix.tck.ReceiverComponent;
 import org.springframework.core.io.ClassPathResource;
-import org.w3c.dom.Element;
 
 public class DroolsComponentTest extends TestCase {
 
@@ -56,7 +57,7 @@
         DroolsEndpoint endpoint = new DroolsEndpoint(drools.getServiceUnit(),
                                                      new QName("drools"), "endpoint");
         endpoint.setRuleBaseResource(new ClassPathResource("router.drl"));
-        drools.setEndpoints(new DroolsEndpoint[] { endpoint });
+        drools.setEndpoints(new DroolsEndpoint[] {endpoint });
         jbi.activateComponent(drools, "servicemix-drools");
         
         ReceiverComponent r1 = new ReceiverComponent(new QName("target1"), "endpoint");
@@ -108,7 +109,7 @@
         DroolsEndpoint endpoint = new DroolsEndpoint(drools.getServiceUnit(),
                                                      new QName("drools"), "endpoint");
         endpoint.setRuleBaseResource(new ClassPathResource("router.drl"));
-        drools.setEndpoints(new DroolsEndpoint[] { endpoint });
+        drools.setEndpoints(new DroolsEndpoint[] {endpoint });
         jbi.activateComponent(drools, "servicemix-drools");
         
         MockServiceComponent m1 = new MockServiceComponent(new QName("target1"), "endpoint");
@@ -169,7 +170,7 @@
         DroolsEndpoint endpoint = new DroolsEndpoint(drools.getServiceUnit(),
                                                      new QName("drools"), "endpoint");
         endpoint.setRuleBaseResource(new ClassPathResource("fibonacci.drl"));
-        drools.setEndpoints(new DroolsEndpoint[] { endpoint });
+        drools.setEndpoints(new DroolsEndpoint[] {endpoint });
         jbi.activateComponent(drools, "servicemix-drools");
         
         jbi.start();

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/EIPComponent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/EIPComponent.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/EIPComponent.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/EIPComponent.java Sat Apr  7 01:35:49 2007
@@ -81,7 +81,7 @@
     }
 
     protected Class[] getEndpointClasses() {
-        return new Class[] { EIPEndpoint.class };
+        return new Class[] {EIPEndpoint.class };
     }
 
 }

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/EIPEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/EIPEndpoint.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/EIPEndpoint.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/EIPEndpoint.java Sat Apr  7 01:35:49 2007
@@ -28,6 +28,10 @@
 import javax.wsdl.factory.WSDLFactory;
 import javax.wsdl.xml.WSDLReader;
 
+import org.w3c.dom.Document;
+
+import com.ibm.wsdl.Constants;
+
 import org.apache.servicemix.JbiConstants;
 import org.apache.servicemix.common.endpoints.ProviderEndpoint;
 import org.apache.servicemix.eip.support.ExchangeTarget;
@@ -39,9 +43,6 @@
 import org.apache.servicemix.timers.TimerManager;
 import org.apache.servicemix.timers.impl.TimerManagerImpl;
 import org.springframework.core.io.Resource;
-import org.w3c.dom.Document;
-
-import com.ibm.wsdl.Constants;
 
 /**
  * @author gnodet
@@ -52,7 +53,7 @@
     /**
      * The resource pointing to the WSDL for this endpoint
      */
-    private Resource wsdlResource;
+    protected Resource wsdlResource;
     
     /**
      * The store to keep pending exchanges
@@ -165,12 +166,13 @@
      * @return Returns the description.
      */
     public Document getDescription() {
-        if( description == null ) {
+        if (description == null) {
             definition = getDefinition();
-            if( definition!=null ) {
+            if (definition != null) {
                 try {
                     description = WSDLFactory.newInstance().newWSDLWriter().getDocument(definition);
                 } catch (WSDLException e) {
+                    // Ignore
                 }
             }
         }
@@ -185,11 +187,11 @@
      * @return Returns the definition.
      */
     public Definition getDefinition() {
-        if( definition == null ) {
+        if (definition == null) {
             definition = getDefinitionFromDescription();
-            if( definition == null ) {
+            if (definition == null) {
                 definition = getDefinitionFromWsdlResource();
-                if( definition == null ) {
+                if (definition == null) {
                     definition = getDefinitionFromWsdlExchangeTarget();
                 }
             }
@@ -198,38 +200,41 @@
     }
     
     protected Definition getDefinitionFromDescription() {
-        if( description!=null ) {
+        if (description != null) {
             try {
                 WSDLReader reader = WSDLFactory.newInstance().newWSDLReader(); 
                 reader.setFeature(Constants.FEATURE_VERBOSE, false);
                 return reader.readWSDL(null, description);
             } catch (WSDLException ignore) {
+                // Ignore
             }
         }
         return null;
     }
 
     protected Definition getDefinitionFromWsdlResource() {
-        if( wsdlResource!=null ) {
+        if (wsdlResource != null) {
             try {
                 URL resource = wsdlResource.getURL();
                 WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
                 reader.setFeature(Constants.FEATURE_VERBOSE, false);
                 return reader.readWSDL(null, resource.toString());
             } catch (Throwable ignore) {
+                // Ignore
             }
         }
         return null;
     }
         
     protected Definition getDefinitionFromWsdlExchangeTarget() {
-        if( wsdlExchangeTarget != null ) {
+        if (wsdlExchangeTarget != null) {
             try {
                 Document description = getDescriptionForExchangeTarget(wsdlExchangeTarget);
                 WSDLReader reader = WSDLFactory.newInstance().newWSDLReader(); 
                 reader.setFeature(Constants.FEATURE_VERBOSE, false);
                 return reader.readWSDL(null, description);
             } catch (Throwable ignore) {
+                // Ignore
             }
         }
         return null;
@@ -270,7 +275,7 @@
             if (endpoint == null) {
                 endpoints = new ServiceEndpoint[0];
             } else {
-                endpoints = new ServiceEndpoint[] { endpoint };
+                endpoints = new ServiceEndpoint[] {endpoint };
             }
         } else if (match.getService() != null) {
             endpoints = getContext().getEndpointsForService(match.getService());

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/packaging/EipServiceUnitAnalyzer.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/packaging/EipServiceUnitAnalyzer.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/packaging/EipServiceUnitAnalyzer.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/packaging/EipServiceUnitAnalyzer.java Sat Apr  7 01:35:49 2007
@@ -36,98 +36,99 @@
 
 public class EipServiceUnitAnalyzer extends AbstractXBeanServiceUnitAnalyzer {
 
-	protected List<Consumes> getConsumes(Endpoint endpoint) {
-		if (endpoint instanceof ContentBasedRouter)
-			return resolveContentBasedRouter((ContentBasedRouter) endpoint);
-		if (endpoint instanceof MessageFilter)
-			return resolveMessageFilter((MessageFilter) endpoint);
-		if (endpoint instanceof Pipeline)
-			return resolvePipeline((Pipeline) endpoint);
-		if (endpoint instanceof SplitAggregator)
-			return resolveSplitAggregator((SplitAggregator) endpoint);
-		if (endpoint instanceof StaticRecipientList)
-			return resolveStaticRecipientList((StaticRecipientList) endpoint);
-		if (endpoint instanceof StaticRoutingSlip)
-			return resolveStaticRoutingSlip((StaticRoutingSlip) endpoint);
-		if (endpoint instanceof WireTap)
-			return resolveWireTap((WireTap) endpoint);
-		if (endpoint instanceof XPathSplitter)
-			return resolveXPathSplitter((XPathSplitter) endpoint);
-		return new ArrayList<Consumes>();
-	}
-
-	private List<Consumes> resolveXPathSplitter(XPathSplitter splitter) {
-		return generateConsumesFromTarget(splitter.getTarget(), new ArrayList<Consumes>());
-	}
-
-	private List<Consumes> resolveWireTap(WireTap tap) {
-		List<Consumes> consumes = new ArrayList<Consumes>();
-		consumes = generateConsumesFromTarget(tap.getTarget(), consumes);
-		consumes = generateConsumesFromTarget(tap.getInListener(), consumes);
-		consumes = generateConsumesFromTarget(tap.getOutListener(), consumes);
-		consumes = generateConsumesFromTarget(tap.getFaultListener(), consumes);
-		return consumes;
-	}
-
-	private List<Consumes> resolveStaticRoutingSlip(StaticRoutingSlip slip) {
-		List<Consumes> consumes = new ArrayList<Consumes>();
-		for (int i = 0; i < slip.getTargets().length; i++) {
-			consumes = generateConsumesFromTarget(slip.getTargets()[i],
-					consumes);
-		}
-		return consumes;
-	}
-
-	private List<Consumes> resolveStaticRecipientList(StaticRecipientList list) {
-		List<Consumes> consumes = new ArrayList<Consumes>();
-		for (int i = 0; i < list.getRecipients().length; i++) {
-			consumes = generateConsumesFromTarget(list.getRecipients()[i],
-					consumes);
-		}
-		return consumes;
-	}
-
-	private List<Consumes> resolveSplitAggregator(SplitAggregator aggregator) {
-		return generateConsumesFromTarget(aggregator.getTarget(),
-				new ArrayList<Consumes>());
-	}
-
-	private List<Consumes> resolvePipeline(Pipeline pipeline) {
-		List<Consumes> consumes = generateConsumesFromTarget(pipeline.getTarget(), new ArrayList<Consumes>());
-		consumes = generateConsumesFromTarget(pipeline.getTransformer(), consumes);
-		return consumes;
-	}
-
-	private List<Consumes> resolveMessageFilter(MessageFilter filter) {
-		return generateConsumesFromTarget(filter.getTarget(), new ArrayList<Consumes>());
-	}
-
-	private List<Consumes> resolveContentBasedRouter(ContentBasedRouter router) {
-		List<Consumes> consumes = new ArrayList<Consumes>();
-		for (int i = 0; i < router.getRules().length; i++) {
-			RoutingRule rule = router.getRules()[i];
-			consumes = generateConsumesFromTarget(rule.getTarget(), consumes);
-		}
-		return consumes;
-	}
-
-	private List<Consumes> generateConsumesFromTarget(ExchangeTarget target, List<Consumes> consumes) {
-		if (target != null) {
-			Consumes consume = new Consumes();
-			consume.setEndpointName(target.getEndpoint());
-			consume.setServiceName(target.getService());
-			consume.setInterfaceName(target.getInterface());
-			consumes.add(consume);
-		}
-		return consumes;
-	}
-
-	protected String getXBeanFile() {
-		return "xbean.xml";
-	}
-
-	protected boolean isValidEndpoint(Object bean) {
-		return (bean instanceof EIPEndpoint);
-	}
+    protected List<Consumes> getConsumes(Endpoint endpoint) {
+        List<Consumes> consumes;
+        if (endpoint instanceof ContentBasedRouter) {
+            consumes = resolveContentBasedRouter((ContentBasedRouter) endpoint);
+        } else if (endpoint instanceof MessageFilter) {
+            consumes = resolveMessageFilter((MessageFilter) endpoint);
+        } else if (endpoint instanceof Pipeline) {
+            consumes = resolvePipeline((Pipeline) endpoint);
+        } else if (endpoint instanceof SplitAggregator) {
+            consumes = resolveSplitAggregator((SplitAggregator) endpoint);
+        } else if (endpoint instanceof StaticRecipientList) {
+            consumes = resolveStaticRecipientList((StaticRecipientList) endpoint);
+        } else if (endpoint instanceof StaticRoutingSlip) {
+            consumes = resolveStaticRoutingSlip((StaticRoutingSlip) endpoint);
+        } else if (endpoint instanceof WireTap) {
+            consumes = resolveWireTap((WireTap) endpoint);
+        } else if (endpoint instanceof XPathSplitter) {
+            consumes = resolveXPathSplitter((XPathSplitter) endpoint);
+        } else {
+            consumes = new ArrayList<Consumes>();
+        }
+        return consumes;
+    }
+
+    private List<Consumes> resolveXPathSplitter(XPathSplitter splitter) {
+        return generateConsumesFromTarget(splitter.getTarget(), new ArrayList<Consumes>());
+    }
+
+    private List<Consumes> resolveWireTap(WireTap tap) {
+        List<Consumes> consumes = new ArrayList<Consumes>();
+        consumes = generateConsumesFromTarget(tap.getTarget(), consumes);
+        consumes = generateConsumesFromTarget(tap.getInListener(), consumes);
+        consumes = generateConsumesFromTarget(tap.getOutListener(), consumes);
+        consumes = generateConsumesFromTarget(tap.getFaultListener(), consumes);
+        return consumes;
+    }
+
+    private List<Consumes> resolveStaticRoutingSlip(StaticRoutingSlip slip) {
+        List<Consumes> consumes = new ArrayList<Consumes>();
+        for (int i = 0; i < slip.getTargets().length; i++) {
+            consumes = generateConsumesFromTarget(slip.getTargets()[i], consumes);
+        }
+        return consumes;
+    }
+
+    private List<Consumes> resolveStaticRecipientList(StaticRecipientList list) {
+        List<Consumes> consumes = new ArrayList<Consumes>();
+        for (int i = 0; i < list.getRecipients().length; i++) {
+            consumes = generateConsumesFromTarget(list.getRecipients()[i], consumes);
+        }
+        return consumes;
+    }
+
+    private List<Consumes> resolveSplitAggregator(SplitAggregator aggregator) {
+        return generateConsumesFromTarget(aggregator.getTarget(), new ArrayList<Consumes>());
+    }
+
+    private List<Consumes> resolvePipeline(Pipeline pipeline) {
+        List<Consumes> consumes = generateConsumesFromTarget(pipeline.getTarget(), new ArrayList<Consumes>());
+        consumes = generateConsumesFromTarget(pipeline.getTransformer(), consumes);
+        return consumes;
+    }
+
+    private List<Consumes> resolveMessageFilter(MessageFilter filter) {
+        return generateConsumesFromTarget(filter.getTarget(), new ArrayList<Consumes>());
+    }
+
+    private List<Consumes> resolveContentBasedRouter(ContentBasedRouter router) {
+        List<Consumes> consumes = new ArrayList<Consumes>();
+        for (int i = 0; i < router.getRules().length; i++) {
+            RoutingRule rule = router.getRules()[i];
+            consumes = generateConsumesFromTarget(rule.getTarget(), consumes);
+        }
+        return consumes;
+    }
+
+    private List<Consumes> generateConsumesFromTarget(ExchangeTarget target, List<Consumes> consumes) {
+        if (target != null) {
+            Consumes consume = new Consumes();
+            consume.setEndpointName(target.getEndpoint());
+            consume.setServiceName(target.getService());
+            consume.setInterfaceName(target.getInterface());
+            consumes.add(consume);
+        }
+        return consumes;
+    }
+
+    protected String getXBeanFile() {
+        return "xbean.xml";
+    }
+
+    protected boolean isValidEndpoint(Object bean) {
+        return bean instanceof EIPEndpoint;
+    }
 
 }

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/ContentBasedRouter.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/ContentBasedRouter.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/ContentBasedRouter.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/ContentBasedRouter.java Sat Apr  7 01:35:49 2007
@@ -75,8 +75,8 @@
      */
     protected ExchangeTarget getDestination(MessageExchange exchange) throws Exception {
         for (int i = 0; i < rules.length; i++) {
-            if (rules[i].getPredicate() == null ||
-                rules[i].getPredicate().matches(exchange)) {
+            if (rules[i].getPredicate() == null
+                || rules[i].getPredicate().matches(exchange)) {
                 return rules[i].getTarget();
             }
         }

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/ContentEnricher.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/ContentEnricher.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/ContentEnricher.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/ContentEnricher.java Sat Apr  7 01:35:49 2007
@@ -27,13 +27,14 @@
 import javax.xml.transform.Source;
 import javax.xml.transform.dom.DOMSource;
 
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
 import org.apache.servicemix.eip.EIPEndpoint;
 import org.apache.servicemix.eip.support.ExchangeTarget;
 import org.apache.servicemix.jbi.jaxp.SourceTransformer;
 import org.apache.servicemix.jbi.util.MessageUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
 
 /**
  * Implementation of the 
@@ -49,85 +50,87 @@
      * The address of the target endpoint
      */
     private ExchangeTarget target;
-    
+
     /**
      * the target to enrich the request
      */
     private ExchangeTarget enricherTarget;
-    
+
     /**
      * the QName of the resulting root node
      */
     private QName enricherElementName = new QName("enricher");
+
     /**
      * the QName of the element which contains the 'IN Message'
      * within the response message
      */
     private QName requestElementName = new QName("request");
+
     /**
      * the QName of the element which contains the message 
      * which was produced by the enricherTarget within the 
      * response message
      */
     private QName resultElementName = new QName("result");
-    
+
     /**
      * returns the QName of the resulting root node
      * @return QName of the resulting root node
      */
     public QName getEnricherElementName() {
-		return enricherElementName;
-	}
+        return enricherElementName;
+    }
 
     /**
      * Sets the QName of the resulting root node
      * @param enricherElementName QName of the resulting root node
      */
-	public void setEnricherElementName(QName enricherElementName) {
-		this.enricherElementName = enricherElementName;
-	}
+    public void setEnricherElementName(QName enricherElementName) {
+        this.enricherElementName = enricherElementName;
+    }
 
-	/**
-	 * Returns the QName of the element which contains the 'IN Message'
+    /**
+     * Returns the QName of the element which contains the 'IN Message'
      * within the response message
      * 
-	 * @return QName 
-	 */
-	public QName getRequestElementName() {
-		return requestElementName;
-	}
+     * @return QName 
+     */
+    public QName getRequestElementName() {
+        return requestElementName;
+    }
 
-	/**
-	 * Sets the QName of the element which contains the 'IN Message'
+    /**
+     * Sets the QName of the element which contains the 'IN Message'
      * within the response message
      * 
-	 * @param requestElementName QName
-	 */
-	public void setRequestElementName(QName requestElementName) {
-		this.requestElementName = requestElementName;
-	}
+     * @param requestElementName QName
+     */
+    public void setRequestElementName(QName requestElementName) {
+        this.requestElementName = requestElementName;
+    }
 
-	/**
-	 * Returns the QName of the element which contains the message 
+    /**
+     * Returns the QName of the element which contains the message 
      * which was produced by the enricherTarget within the 
      * response message
      * 
-	 * @return QName
-	 */
-	public QName getResultElementName() {
-		return resultElementName;
-	}
+     * @return QName
+     */
+    public QName getResultElementName() {
+        return resultElementName;
+    }
 
-	/**
-	 * Sets the QName of the element which contains the message 
+    /**
+     * Sets the QName of the element which contains the message 
      * which was produced by the enricherTarget within the 
      * response message
      * 
-	 * @param resultElementName QName
-	 */
-	public void setResultElementName(QName resultElementName) {
-		this.resultElementName = resultElementName;
-	}
+     * @param resultElementName QName
+     */
+    public void setResultElementName(QName resultElementName) {
+        this.resultElementName = resultElementName;
+    }
 
     protected void processAsync(MessageExchange exchange) throws Exception {
         throw new IllegalStateException();
@@ -138,49 +141,44 @@
     }
 
     public void process(MessageExchange exchange) throws Exception {
-    	    	
-        if (exchange instanceof InOnly == false &&
-                exchange instanceof RobustInOnly == false) {
-                fail(exchange, 
-                		new UnsupportedOperationException(
-                				"Use an InOnly or RobustInOnly MEP"));
+
+        if (!(exchange instanceof InOnly) && !(exchange instanceof RobustInOnly)) {
+            fail(exchange, new UnsupportedOperationException("Use an InOnly or RobustInOnly MEP"));
         }
-    	
+
         // Skip done exchanges
         if (exchange.getStatus() == ExchangeStatus.DONE) {
             return;
-        // Handle error exchanges
+            // Handle error exchanges
         } else if (exchange.getStatus() == ExchangeStatus.ERROR) {
             return;
         }
-        	        
-    	InOut enricherTargetME = getExchangeFactory().createInOutExchange();
+
+        InOut enricherTargetME = getExchangeFactory().createInOutExchange();
         enricherTarget.configureTarget(enricherTargetME, getContext());
         MessageUtil.transferInToIn(exchange, enricherTargetME);
-                
+
         sendSync(enricherTargetME);
 
         if (enricherTargetME.getStatus() == ExchangeStatus.ERROR) {
             fail(exchange, enricherTargetME.getError());
             return;
         }
-     
-        Document document = combineToDOMDocument(exchange.getMessage("in"), 
-        		enricherTargetME.getMessage("out"));
-                
+
+        Document document = combineToDOMDocument(exchange.getMessage("in"), enricherTargetME.getMessage("out"));
+
         done(enricherTargetME);
 
-    	MessageExchange outExchange = 
-    		getExchangeFactory().createInOnlyExchange();
-    	NormalizedMessage out = outExchange.createMessage();
-    	target.configureTarget(outExchange, getContext());
+        MessageExchange outExchange = getExchangeFactory().createInOnlyExchange();
+        NormalizedMessage out = outExchange.createMessage();
+        target.configureTarget(outExchange, getContext());
         out.setContent(new DOMSource(document));
-        
+
         outExchange.setMessage(out, "in");
-                
+
         sendSync(outExchange);
         done(exchange);
-        
+
     }
 
     /**
@@ -195,70 +193,70 @@
      *        
      *    Content of Message 2:
      *    
-     *    	  <message2/>
+     *        <message2/>
      * 
      *    Result of this method a DOM Document containing the following:
      *    
-     *    <enricher>
-     *      <request>
-     *      	<hello/>
-     *      </request>
-     *      <result>
-     *      	<message2/>
-     *      </result>
-     *    </enricher>
+     *         <enricher>
+     *           <request>
+     *             <hello/>
+     *           </request>
+     *           <result>
+     *             <message2/>
+     *           </result>
+     *         </enricher>
      * 
      */
-	private Document combineToDOMDocument(NormalizedMessage requestMessage, NormalizedMessage targetResultMessage) 
-		throws Exception, ParserConfigurationException {
-		
+    private Document combineToDOMDocument(NormalizedMessage requestMessage, NormalizedMessage targetResultMessage)
+        throws Exception, ParserConfigurationException {
+
         Node originalDocumentNode = getDOMNode(requestMessage.getContent());
         Node targetResultNode = getDOMNode(targetResultMessage.getContent());
-                
+
         Document document = new SourceTransformer().createDocument();
         Element enricherElement = createChildElement(enricherElementName, document);
         Element requestElement = createChildElement(requestElementName, document);
-        
+
         Node node = document.importNode(originalDocumentNode, true);
         requestElement.appendChild(node);
         enricherElement.appendChild(requestElement);
         document.appendChild(enricherElement);
-        
+
         Element resultElement = createChildElement(resultElementName, document);
-        
+
         Node node2 = document.importNode(targetResultNode, true);
-        
+
         resultElement.appendChild(node2);
         enricherElement.appendChild(resultElement);
-		return document;
-		
-	}
-    
+        return document;
+
+    }
+
     private Element createChildElement(QName name, Document document) {
         Element elem;
         if ("".equals(name.getNamespaceURI())) {
-            elem = document.createElement(name.getLocalPart());   
+            elem = document.createElement(name.getLocalPart());
         } else {
-            elem = document.createElementNS(name.getNamespaceURI(),
-            		name.getPrefix() + ":" + name.getLocalPart());
+            elem = document.createElementNS(name.getNamespaceURI(), name.getPrefix() + ":" + name.getLocalPart());
         }
         return elem;
     }
-	
+
     private Node getDOMNode(Source source) throws Exception {
-    	SourceTransformer sourceTransformer = new SourceTransformer();
-    	Node node = sourceTransformer.toDOMNode(source);
+        SourceTransformer sourceTransformer = new SourceTransformer();
+        Node node = sourceTransformer.toDOMNode(source);
         if (node.getNodeType() == Node.DOCUMENT_NODE) {
-        	node = ((Document)node).getDocumentElement();
+            node = ((Document) node).getDocumentElement();
         }
         return node;
     }
-        
+
     public void setTarget(ExchangeTarget target) {
         this.target = target;
     }
-    
+
     public void setEnricherTarget(ExchangeTarget enricherTarget) {
         this.enricherTarget = enricherTarget;
     }
+
 }

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/MessageFilter.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/MessageFilter.java?view=diff&rev=526407&r1=526406&r2=526407
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/MessageFilter.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/MessageFilter.java Sat Apr  7 01:35:49 2007
@@ -53,7 +53,7 @@
     /**
      * The correlation property used by this component
      */
-    private String correlation;
+    //private String correlation;
     /**
      * Indicates if faults and errors from recipients should be sent
      * back to the consumer.  In such a case, only the first fault or
@@ -121,15 +121,15 @@
             throw new IllegalArgumentException("filter property should be set");
         }
         // Create correlation property
-        correlation = "MessageFilter.Correlation." + getService() + "." + getEndpoint();
+        //correlation = "MessageFilter.Correlation." + getService() + "." + getEndpoint();
     }
 
     /* (non-Javadoc)
      * @see org.apache.servicemix.eip.EIPEndpoint#processSync(javax.jbi.messaging.MessageExchange)
      */
     protected void processSync(MessageExchange exchange) throws Exception {
-        if (exchange instanceof InOnly == false &&
-            exchange instanceof RobustInOnly == false) {
+        if (!(exchange instanceof InOnly)
+            && !(exchange instanceof RobustInOnly)) {
             fail(exchange, new UnsupportedOperationException("Use an InOnly or RobustInOnly MEP"));
         } else {
             NormalizedMessage in = MessageUtil.copyIn(exchange);
@@ -172,8 +172,8 @@
                 return;
             } else if (exchange.getStatus() == ExchangeStatus.ERROR) {
                 return;
-            } else if (exchange instanceof InOnly == false &&
-                       exchange instanceof RobustInOnly == false) {
+            } else if (!(exchange instanceof InOnly)
+                       && !(exchange instanceof RobustInOnly)) {
                 fail(exchange, new UnsupportedOperationException("Use an InOnly or RobustInOnly MEP"));
             } else if (exchange.getFault() != null) {
                 done(exchange);



Mime
View raw message