camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r931612 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/builder/ camel-core/src/main/java/org/apache/camel/component/bean/ camel-core/src/test/java/org/apache/camel/component/bean/ components/camel-cxf/src/test/java/org/apache/...
Date Wed, 07 Apr 2010 16:26:49 GMT
Author: davsclaus
Date: Wed Apr  7 16:26:49 2010
New Revision: 931612

URL: http://svn.apache.org/viewvc?rev=931612&view=rev
Log:
CAMEL-2613: Reverted CAMEL-2613, but kept ProxyBuilder.

Removed:
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CamelProxyVoidAsInOnlyTest.java
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CamelProxyVoidAsInOutTest.java
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/MyOtherProxySender.java
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CamelProxyVoidAsInOnlyTest.xml
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CamelProxyVoidAsInOutTest.xml
Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ProxyBuilder.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfoCache.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/ProxyHelper.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanProxyTest.java
    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfMessageHelperTest.java
  (props changed)
    camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/util/RequestBody.xml
  (props changed)
    camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelProxyFactoryDefinition.java
    camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerDefinition.java
  (props changed)
    camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/remoting/CamelProxyFactoryBean.java
    camel/trunk/examples/camel-example-cxf-async/src/main/resources/META-INF/camel-client.xml
  (props changed)

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ProxyBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ProxyBuilder.java?rev=931612&r1=931611&r2=931612&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ProxyBuilder.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ProxyBuilder.java Wed Apr
 7 16:26:49 2010
@@ -29,7 +29,6 @@ public final class ProxyBuilder {
 
     private final CamelContext camelContext;
     private Endpoint endpoint;
-    private boolean voidAsInOnly;
 
     public ProxyBuilder(CamelContext camelContext) {
         this.camelContext = camelContext;
@@ -58,16 +57,6 @@ public final class ProxyBuilder {
     }
 
     /**
-     * Let methods which return <tt>void</tt> be regarded as <tt>InOnly</tt>
methods (eg Fire and forget).
-     *
-     * @return the builder
-     */
-    public ProxyBuilder voidAsInOnly() {
-        voidAsInOnly = true;
-        return this;
-    }
-
-    /**
      * Builds the proxy.
      *
      * @param interfaceClasses  the service interface(s)
@@ -75,7 +64,7 @@ public final class ProxyBuilder {
      * @throws Exception is thrown if error creating the proxy
      */
     public <T> T build(Class<T>... interfaceClasses) throws Exception {
-        return ProxyHelper.createProxy(endpoint, voidAsInOnly, interfaceClasses);
+        return ProxyHelper.createProxy(endpoint, interfaceClasses);
     }
 
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java?rev=931612&r1=931611&r2=931612&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java Wed
Apr  7 16:26:49 2010
@@ -72,25 +72,15 @@ public class BeanInfo {
     private final Map<Method, MethodInfo> methodMap = new ConcurrentHashMap<Method,
MethodInfo>();
     private MethodInfo defaultMethod;
     private BeanInfo superBeanInfo;
-    private final boolean voidAsInOnly;
 
     public BeanInfo(CamelContext camelContext, Class<?> type) {
-        this(camelContext, type, false);
-    }
-
-    public BeanInfo(CamelContext camelContext, Class<?> type, boolean voidAsInOnly)
{
-        this(camelContext, type, createParameterMappingStrategy(camelContext), voidAsInOnly);
+        this(camelContext, type, createParameterMappingStrategy(camelContext));
     }
 
     public BeanInfo(CamelContext camelContext, Class<?> type, ParameterMappingStrategy
strategy) {
-        this(camelContext, type, strategy, false);
-    }
-
-    public BeanInfo(CamelContext camelContext, Class<?> type, ParameterMappingStrategy
strategy, boolean voidAsInOnly) {
         this.camelContext = camelContext;
         this.type = type;
         this.strategy = strategy;
-        this.voidAsInOnly = voidAsInOnly;
 
         // configure the default excludes methods
         synchronized (EXCLUDED_METHODS) {
@@ -350,7 +340,7 @@ public class BeanInfo {
         }
 
         // now lets add the method to the repository
-        return new MethodInfo(camelContext, clazz, method, parameters, bodyParameters, hasCustomAnnotation,
hasHandlerAnnotation, voidAsInOnly);
+        return new MethodInfo(camelContext, clazz, method, parameters, bodyParameters, hasCustomAnnotation,
hasHandlerAnnotation);
     }
 
     /**

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java?rev=931612&r1=931611&r2=931612&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java Wed
Apr  7 16:26:49 2010
@@ -62,7 +62,7 @@ public class MethodInfo {
     private RecipientList recipientList;
 
     public MethodInfo(CamelContext camelContext, Class<?> type, Method method, List<ParameterInfo>
parameters, List<ParameterInfo> bodyParameters,
-                      boolean hasCustomAnnotation, boolean hasHandlerAnnotation, boolean
voidAsInOnly) {
+                      boolean hasCustomAnnotation, boolean hasHandlerAnnotation) {
         this.camelContext = camelContext;
         this.type = type;
         this.method = method;
@@ -72,14 +72,10 @@ public class MethodInfo {
         this.hasHandlerAnnotation = hasHandlerAnnotation;
         this.parametersExpression = createParametersExpression();
 
-        // prefer annotations
         Pattern oneway = findOneWayAnnotation(method);
         if (oneway != null) {
             pattern = oneway.value();
-        } else if (voidAsInOnly && isReturnTypeVoid()) {
-            // okay its a void method and we are configured to let that be InOnly
-            pattern = ExchangePattern.InOnly;
-        } 
+        }
 
         if (method.getAnnotation(org.apache.camel.RecipientList.class) != null
                 && matchContext(method.getAnnotation(org.apache.camel.RecipientList.class).context()))
{

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfoCache.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfoCache.java?rev=931612&r1=931611&r2=931612&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfoCache.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfoCache.java
Wed Apr  7 16:26:49 2010
@@ -33,7 +33,6 @@ public class MethodInfoCache {
     private final CamelContext camelContext;
     private Map<Method, MethodInfo> methodCache;
     private Map<Class<?>, BeanInfo> classCache;
-    private boolean voidAsInOnly;
 
     public MethodInfoCache(CamelContext camelContext) {
         this(camelContext, 1000, 10000);
@@ -75,7 +74,7 @@ public class MethodInfoCache {
     }
 
     protected BeanInfo createBeanInfo(Class<?> declaringClass) {
-        return new BeanInfo(camelContext, declaringClass, voidAsInOnly);
+        return new BeanInfo(camelContext, declaringClass);
     }
 
     protected static Map<Object, Object> createLruCache(int size) {
@@ -89,12 +88,4 @@ public class MethodInfoCache {
     private static Map<Method, MethodInfo> createMethodCache(int size) {
         return CastUtils.cast(createLruCache(size));
     }
-
-    public boolean isVoidAsInOnly() {
-        return voidAsInOnly;
-    }
-
-    public void setVoidAsInOnly(boolean voidAsInOnly) {
-        this.voidAsInOnly = voidAsInOnly;
-    }
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/ProxyHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/ProxyHelper.java?rev=931612&r1=931611&r2=931612&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/ProxyHelper.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/ProxyHelper.java
Wed Apr  7 16:26:49 2010
@@ -59,13 +59,6 @@ public final class ProxyHelper {
         return (T) createProxy(endpoint, cl, interfaceClasses, createMethodInfoCache(endpoint));
     }
 
-    /**
-     * Creates a Proxy which sends PojoExchange to the endpoint.
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> T createProxy(Endpoint endpoint, boolean voidAsInOnly, ClassLoader
cl, Class<T>... interfaceClasses) throws Exception {
-        return (T) createProxy(endpoint, cl, interfaceClasses, createMethodInfoCache(endpoint,
voidAsInOnly));
-    }
 
     /**
      * Creates a Proxy which sends PojoExchange to the endpoint.
@@ -79,27 +72,11 @@ public final class ProxyHelper {
      * Creates a Proxy which sends PojoExchange to the endpoint.
      */
     @SuppressWarnings("unchecked")
-    public static <T> T createProxy(Endpoint endpoint, boolean voidAsInOnly, Class<T>...
interfaceClasses) throws Exception {
-        return (T) createProxy(endpoint, voidAsInOnly, getClassLoader(interfaceClasses),
interfaceClasses);
-    }
-
-    /**
-     * Creates a Proxy which sends PojoExchange to the endpoint.
-     */
-    @SuppressWarnings("unchecked")
     public static <T> T createProxy(Endpoint endpoint, Producer producer, Class<T>...
interfaceClasses) throws Exception {
         return (T) createProxyObject(endpoint, producer, getClassLoader(interfaceClasses),
interfaceClasses, createMethodInfoCache(endpoint));
     }
 
     /**
-     * Creates a Proxy which sends PojoExchange to the endpoint.
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> T createProxy(Endpoint endpoint, Producer producer, boolean voidAsInOnly,
Class<T>... interfaceClasses) throws Exception {
-        return (T) createProxyObject(endpoint, producer, getClassLoader(interfaceClasses),
interfaceClasses, createMethodInfoCache(endpoint, voidAsInOnly));
-    }
-
-    /**
      * Returns the class loader of the first interface or throws {@link IllegalArgumentException}
if there are no interfaces specified
      */
     protected static ClassLoader getClassLoader(Class<?>... interfaces) {
@@ -112,10 +89,4 @@ public final class ProxyHelper {
     protected static MethodInfoCache createMethodInfoCache(Endpoint endpoint) {
         return new MethodInfoCache(endpoint.getCamelContext());
     }
-
-    protected static MethodInfoCache createMethodInfoCache(Endpoint endpoint, boolean voidAsInOnly)
{
-        MethodInfoCache cache = new MethodInfoCache(endpoint.getCamelContext());
-        cache.setVoidAsInOnly(voidAsInOnly);
-        return cache;
-    }
 }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanProxyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanProxyTest.java?rev=931612&r1=931611&r2=931612&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanProxyTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanProxyTest.java
Wed Apr  7 16:26:49 2010
@@ -183,19 +183,6 @@ public class BeanProxyTest extends Conte
         assertMockEndpointsSatisfied();
     }
 
-    public void testBeanProxyVoidAsInOnly() throws Exception {
-        // let void be InOnly which is a fire and forget method
-        OrderService service = new ProxyBuilder(context).endpoint("seda:delay").voidAsInOnly().build(OrderService.class);
-
-        getMockEndpoint("mock:delay").expectedBodiesReceived("Bye World", "Hello World");
-        service.doNothing("Hello World");
-        // since its a fire and forget it should return faster so we can send
-        // a Bye World message to the mock which arrives before the Hello World msg
-        template.sendBody("mock:delay", "Bye World");
-
-        assertMockEndpointsSatisfied();
-    }
-
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {

Propchange: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfMessageHelperTest.java
            ('svn:mergeinfo' removed)

Propchange: camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/util/RequestBody.xml
            ('svn:mergeinfo' removed)

Modified: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelProxyFactoryDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelProxyFactoryDefinition.java?rev=931612&r1=931611&r2=931612&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelProxyFactoryDefinition.java
(original)
+++ camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelProxyFactoryDefinition.java
Wed Apr  7 16:26:49 2010
@@ -25,7 +25,7 @@ import org.apache.camel.model.Identified
  * The &lt;proxy&gt; tag element.
  *
  * @version $Revision$
- */
+*/ // to fudge the XSD generation
 @XmlRootElement(name = "proxy")
 public class CamelProxyFactoryDefinition extends IdentifiedType {
     @XmlAttribute
@@ -36,7 +36,5 @@ public class CamelProxyFactoryDefinition
     private Class serviceInterface;
     @XmlAttribute
     private String camelContextId;
-    @XmlAttribute
-    private Boolean voidAsInOnly = Boolean.FALSE;
 
 }

Propchange: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerDefinition.java
            ('svn:mergeinfo' removed)

Modified: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/remoting/CamelProxyFactoryBean.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/remoting/CamelProxyFactoryBean.java?rev=931612&r1=931611&r2=931612&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/remoting/CamelProxyFactoryBean.java
(original)
+++ camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/remoting/CamelProxyFactoryBean.java
Wed Apr  7 16:26:49 2010
@@ -41,7 +41,6 @@ public class CamelProxyFactoryBean exten
     private Endpoint endpoint;
     private Object serviceProxy;
     private Producer producer;
-    private boolean voidAsInOnly;
 
     @Override
     @SuppressWarnings("unchecked")
@@ -74,7 +73,7 @@ public class CamelProxyFactoryBean exten
         try {
             this.producer = endpoint.createProducer();
             this.producer.start();
-            this.serviceProxy = ProxyHelper.createProxy(endpoint, producer, voidAsInOnly,
getServiceInterface());
+            this.serviceProxy = ProxyHelper.createProxy(endpoint, producer, getServiceInterface());
         } catch (Exception e) {
             throw new FailedToCreateProducerException(endpoint, e);
         }
@@ -134,11 +133,4 @@ public class CamelProxyFactoryBean exten
         this.applicationContext = applicationContext;
     }
 
-    public boolean isVoidAsInOnly() {
-        return voidAsInOnly;
-    }
-
-    public void setVoidAsInOnly(boolean voidAsInOnly) {
-        this.voidAsInOnly = voidAsInOnly;
-    }
 }

Propchange: camel/trunk/examples/camel-example-cxf-async/src/main/resources/META-INF/camel-client.xml
            ('svn:mergeinfo' removed)



Mime
View raw message