activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r525537 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/ camel-core/src/main/java/org/apache/camel/component/pojo/ camel-core/src/main/java/org/apache/camel/component/pojo/timer/ camel-core/src/main/java/org/apache/cam...
Date Wed, 04 Apr 2007 15:23:37 GMT
Author: jstrachan
Date: Wed Apr  4 08:23:32 2007
New Revision: 525537

URL: http://svn.apache.org/viewvc?view=rev&rev=525537
Log:
removed the old EndpointResolver interface and uses of it; as its now replaced by the Component contract. Also moved a few APIs into the camel.spi package

Added:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ReflectionInjector.java   (contents, props changed)
      - copied, changed from r525477, activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/ReflectionInjector.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ComponentResolver.java   (with props)
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ExchangeConverter.java   (contents, props changed)
      - copied, changed from r525477, activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/ExchangeConverter.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/Injector.java   (contents, props changed)
      - copied, changed from r525477, activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/Injector.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/package.html   (with props)
    activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/
      - copied from r525477, activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/EndpointResolver/
    activemq/camel/trunk/camel-xmpp/src/main/resources/META-INF/services/org/apache/camel/component/
      - copied from r525477, activemq/camel/trunk/camel-xmpp/src/main/resources/META-INF/services/org/apache/camel/EndpointResolver/
Removed:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/EndpointResolver.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/ExchangeConverter.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/PojoEndpointResolver.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerEndpointResolver.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueEndpointResolver.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpointResolver.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/Injector.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/ReflectionInjector.java
    activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/EndpointResolver/
    activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpointResolver.java
    activemq/camel/trunk/camel-xmpp/src/main/resources/META-INF/services/org/apache/camel/EndpointResolver/
Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Component.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/PojoComponent.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/PojoEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerComponent.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerConsumer.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueComponent.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CachingInjector.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchangeConverter.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/TypeConverterRegistry.java
    activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/pojo
    activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/queue
    activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/timer
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/InjectorDefaultsToReflectionTest.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/timer/TimerRouteTest.java
    activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiComponent.java
    activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/Callback.java
    activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/Consumed.java
    activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/DefaultTransactionStrategy.java
    activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/DeleteHandler.java
    activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java
    activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaProducer.java
    activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaTemplateTransactionStrategy.java
    activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/QueryBuilder.java
    activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/QueryFactory.java
    activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/TransactionStrategy.java
    activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaUsingCustomPersistenceUnitTest.java
    activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java
    activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/examples/MultiSteps.java
    activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
    activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/SpringInjector.java
    activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppComponent.java
    activemq/camel/trunk/camel-xmpp/src/main/resources/META-INF/services/org/apache/camel/component/xmpp

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java Wed Apr  4 08:23:32 2007
@@ -18,7 +18,8 @@
 package org.apache.camel;
 
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.impl.converter.Injector;
+import org.apache.camel.spi.Injector;
+import org.apache.camel.spi.ExchangeConverter;
 
 import java.util.Collection;
 import java.util.List;
@@ -97,8 +98,6 @@
 
     // Properties
     //-----------------------------------------------------------------------
-    EndpointResolver getEndpointResolver();
-
     ExchangeConverter getExchangeConverter();
 
     /**

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=525537&r1=525536&r2=525537
==============================================================================
--- 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 Wed Apr  4 08:23:32 2007
@@ -46,11 +46,11 @@
     ScheduledExecutorService getExecutorService();
 
     /**
-     * Attempt to create an endpoint for the given URI if the component is capable of handling the URI
+     * Attempt to resolve an endpoint for the given URI if the component is capable of handling the URI
      *
      * @param uri the URI to create
      * @return a newly created endpoint or null if this component cannot create instances of the given
      * uri
      */
-    Endpoint<E> createEndpoint(String uri) throws Exception;
+    Endpoint<E> resolveEndpoint(String uri) throws Exception;
 }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/PojoComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/PojoComponent.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/PojoComponent.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/PojoComponent.java Wed Apr  4 08:23:32 2007
@@ -17,8 +17,10 @@
 package org.apache.camel.component.pojo;
 
 import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.Endpoint;
 
 import java.util.HashMap;
+import java.util.Map;
 
 /**
  * Represents the component that manages {@link PojoEndpoint}.  It holds the
@@ -53,5 +55,15 @@
 
     public PojoConsumer getConsumer(String uri) {
         return consumers.get(uri);
+    }
+
+    @Override
+    public String[] getUriPrefixes() {
+        return new String[] {"pojo"};
+    }
+    
+    @Override
+    protected Endpoint<PojoExchange> createEndpoint(String uri, String remaining, Map parameters) throws Exception {
+        return new PojoEndpoint(uri, this, remaining);
     }
 }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/PojoEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/PojoEndpoint.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/PojoEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/PojoEndpoint.java Wed Apr  4 08:23:32 2007
@@ -35,7 +35,7 @@
     private final PojoComponent component;
 	private final String pojoId;
 
-    public PojoEndpoint(String uri, String pojoId, PojoComponent component) {
+    public PojoEndpoint(String uri, PojoComponent component, String pojoId) {
         super(uri, component);
 		this.pojoId = pojoId;
         this.component = component;

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerComponent.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerComponent.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerComponent.java Wed Apr  4 08:23:32 2007
@@ -18,8 +18,10 @@
 
 import org.apache.camel.component.pojo.PojoExchange;
 import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.Endpoint;
 
 import java.util.ArrayList;
+import java.util.Map;
 
 /**
  * Represents the component that manages {@link TimerEndpoint}.  It holds the
@@ -36,5 +38,16 @@
 
     boolean removeConsumer(TimerConsumer consumer) {
         return timers.remove(consumer);
+    }
+
+
+    @Override
+    public String[] getUriPrefixes() {
+        return new String[] {"timer"};
+    }
+
+    @Override
+    protected Endpoint<PojoExchange> createEndpoint(String uri, String remaining, Map parameters) throws Exception {
+        return new TimerEndpoint(uri, this, remaining);
     }
 }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerConsumer.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerConsumer.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerConsumer.java Wed Apr  4 08:23:32 2007
@@ -114,4 +114,7 @@
         }
         return exchange.getOut().getBody();
 	}
+  
+
+
 }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerEndpoint.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerEndpoint.java Wed Apr  4 08:23:32 2007
@@ -46,7 +46,7 @@
     private boolean daemon=true;
 
 
-    public TimerEndpoint(String fullURI, String timerPartURI, TimerComponent component) throws URISyntaxException {
+    public TimerEndpoint(String fullURI, TimerComponent component, String timerPartURI) throws URISyntaxException {
         super(fullURI, component);
         this.component = component;
 		

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueComponent.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueComponent.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueComponent.java Wed Apr  4 08:23:32 2007
@@ -19,9 +19,11 @@
 import org.apache.camel.CamelContext;
 import org.apache.camel.Component;
 import org.apache.camel.Exchange;
+import org.apache.camel.Endpoint;
 import org.apache.camel.impl.DefaultComponent;
 
 import java.util.HashMap;
+import java.util.Map;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 
@@ -38,4 +40,13 @@
 		return new LinkedBlockingQueue<E>();
 	}
 
+    @Override
+    public String[] getUriPrefixes() {
+        return new String[] {"queue"};
+    }
+
+    @Override
+    protected Endpoint<E> createEndpoint(String uri, String remaining, Map parameters) throws Exception {
+        return new QueueEndpoint<E>(uri, this);
+    }
 }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueEndpoint.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueEndpoint.java Wed Apr  4 08:23:32 2007
@@ -37,9 +37,9 @@
 public class QueueEndpoint<E extends Exchange> extends DefaultEndpoint<E> {
     private BlockingQueue<E> queue;
 
-    public QueueEndpoint(String uri, QueueComponent<E> component, BlockingQueue<E> queue) {
+    public QueueEndpoint(String uri, QueueComponent<E> component) {
         super(uri, component);
-        this.queue = queue;
+        this.queue = component.createQueue();
     }
 
     public Producer<E> createProducer() throws Exception {

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CachingInjector.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CachingInjector.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CachingInjector.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CachingInjector.java Wed Apr  4 08:23:32 2007
@@ -17,7 +17,6 @@
  */
 package org.apache.camel.impl;
 
-import org.apache.camel.impl.converter.Injector;
 import org.apache.camel.impl.converter.TypeConverterRegistry;
 
 /**

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java Wed Apr  4 08:23:32 2007
@@ -18,10 +18,12 @@
 package org.apache.camel.impl;
 
 import org.apache.camel.*;
+import org.apache.camel.spi.ComponentResolver;
+import org.apache.camel.spi.Injector;
+import org.apache.camel.spi.ExchangeConverter;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.converter.DefaultTypeConverter;
-import org.apache.camel.impl.converter.Injector;
-import org.apache.camel.impl.converter.ReflectionInjector;
+import org.apache.camel.impl.ReflectionInjector;
 import org.apache.camel.util.FactoryFinder;
 import org.apache.camel.util.NoFactoryAvailableException;
 import org.apache.camel.util.ServiceHelper;
@@ -33,7 +35,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.Callable;
-import java.util.concurrent.CopyOnWriteArrayList;
 
 /**
  * Represents the context used to configure routes and the policies to use.
@@ -44,14 +45,12 @@
 public class DefaultCamelContext extends ServiceSupport implements CamelContext, Service {
     private Map<String, Endpoint> endpoints = new HashMap<String, Endpoint>();
     private Map<String, Component> components = new HashMap<String, Component>();
-    private List<EndpointResolver> resolvers = new CopyOnWriteArrayList<EndpointResolver>();
     private List<Route> routes;
     private List<Service> servicesToClose = new ArrayList<Service>();
     private TypeConverter typeConverter;
-    private EndpointResolver endpointResolver;
     private ExchangeConverter exchangeConverter;
     private Injector injector;
-    private DefaultComponentResolver componentResolver = new DefaultComponentResolver();
+    private ComponentResolver componentResolver = new DefaultComponentResolver();
 
     /**
      * Adds a component to the container.
@@ -63,9 +62,6 @@
             }
             component.setCamelContext(this);
             components.put(componentName, component);
-            if (component instanceof EndpointResolver) {
-                resolvers.add((EndpointResolver) component);
-            }
         }
     }
 
@@ -136,7 +132,7 @@
                     synchronized (components) {
                         Collection<Component> componentSet = components.values();
                         for (Component component : componentSet) {
-                            answer = component.createEndpoint(uri);
+                            answer = component.resolveEndpoint(uri);
                             if (answer != null) {
                                 break;
                             }
@@ -145,21 +141,9 @@
                     if (answer == null) {
                         Component component = componentResolver.resolveComponent(uri, this);
                         if (component != null) {
-                            answer = component.createEndpoint(uri);
+                            answer = component.resolveEndpoint(uri);
                         }
                     }
-                    if (answer == null) {
-                        for (EndpointResolver resolver : resolvers) {
-                            answer = resolver.resolveEndpoint(this, uri);
-                            if (answer != null) {
-                                break;
-                            }
-                        }
-                    }
-                    if (answer == null) {
-                        EndpointResolver er = getEndpointResolver();
-                        answer = er.resolveEndpoint(this, uri);
-                    }
                     if (answer != null) {
                         endpoints.put(uri, answer);
                     }
@@ -247,17 +231,6 @@
 
     // Properties
     //-----------------------------------------------------------------------
-    public EndpointResolver getEndpointResolver() {
-        if (endpointResolver == null) {
-            endpointResolver = createEndpointResolver();
-        }
-        return endpointResolver;
-    }
-
-    public void setEndpointResolver(EndpointResolver endpointResolver) {
-        this.endpointResolver = endpointResolver;
-    }
-
     public ExchangeConverter getExchangeConverter() {
         if (exchangeConverter == null) {
             exchangeConverter = createExchangeConverter();
@@ -300,13 +273,6 @@
 
     protected void doStop() throws Exception {
         deactivateEndpoints();
-    }
-
-    /**
-     * Lazily create a default implementation
-     */
-    protected EndpointResolver createEndpointResolver() {
-        return new DefaultEndpointResolver();
     }
 
     /**

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java Wed Apr  4 08:23:32 2007
@@ -51,7 +51,7 @@
         return EMPTY_ARRAY;
     }
 
-    public Endpoint<E> createEndpoint(String uri) throws Exception {
+    public Endpoint<E> resolveEndpoint(String uri) throws Exception {
         ObjectHelper.notNull(getCamelContext(), "camelContext");
         String remaining = matchesPrefixes(uri);
         if (remaining == null) {

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java Wed Apr  4 08:23:32 2007
@@ -17,28 +17,24 @@
  */
 package org.apache.camel.impl;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.Component;
-import org.apache.camel.EndpointResolver;
 import org.apache.camel.Exchange;
-import org.apache.camel.CamelContext;
-import org.apache.camel.impl.converter.Injector;
+import org.apache.camel.spi.ComponentResolver;
 import org.apache.camel.util.FactoryFinder;
-import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.NoFactoryAvailableException;
+import org.apache.camel.util.ObjectHelper;
 
 /**
- * An implementation of {@link org.apache.camel.EndpointResolver} that delegates to
- * other {@link EndpointResolver} which are selected based on the uri prefix.
- * <p/>
- * The delegate {@link EndpointResolver} are associated with uri prefixes by
- * adding a property file with the same uri prefix in the
- * META-INF/services/org/apache/camel/EndpointResolver/
+ * The default implementation of {@link ComponentResolver}
+ * which tries to find components by using the URI scheme prefix and searching for a file of the URI
+ * scheme name in the <b>META-INF/services/org/apache/camel/component/</b>
  * directory on the classpath.
  *
  * @version $Revision$
  */
-public class DefaultComponentResolver<E extends Exchange> {
-    static final private FactoryFinder componentFactory = new FactoryFinder("META-INF/services/org/apache/camel/component/");
+public class DefaultComponentResolver<E extends Exchange> implements ComponentResolver<E> {
+    protected static final FactoryFinder componentFactory = new FactoryFinder("META-INF/services/org/apache/camel/component/");
 
     public Component<E> resolveComponent(String uri, CamelContext context) {
         String splitURI[] = ObjectHelper.splitOnCharacter(uri, ":", 2);

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchangeConverter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchangeConverter.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchangeConverter.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchangeConverter.java Wed Apr  4 08:23:32 2007
@@ -18,7 +18,7 @@
 package org.apache.camel.impl;
 
 import org.apache.camel.Exchange;
-import org.apache.camel.ExchangeConverter;
+import org.apache.camel.spi.ExchangeConverter;
 
 /**
  * @version $Revision$

Copied: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ReflectionInjector.java (from r525477, activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/ReflectionInjector.java)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ReflectionInjector.java?view=diff&rev=525537&p1=activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/ReflectionInjector.java&r1=525477&p2=activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ReflectionInjector.java&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/ReflectionInjector.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ReflectionInjector.java Wed Apr  4 08:23:32 2007
@@ -15,9 +15,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.impl.converter;
+package org.apache.camel.impl;
 
 import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.spi.Injector;
 
 /**
  * A simple implementation of {@link Injector} which just uses reflection to instantiate new objects

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ReflectionInjector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ReflectionInjector.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ReflectionInjector.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java Wed Apr  4 08:23:32 2007
@@ -24,6 +24,8 @@
 
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.TypeConverter;
+import org.apache.camel.impl.ReflectionInjector;
+import org.apache.camel.spi.Injector;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/TypeConverterRegistry.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/TypeConverterRegistry.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/TypeConverterRegistry.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/TypeConverterRegistry.java Wed Apr  4 08:23:32 2007
@@ -18,6 +18,7 @@
 package org.apache.camel.impl.converter;
 
 import org.apache.camel.TypeConverter;
+import org.apache.camel.spi.Injector;
 
 /**
  * @version $Revision$

Added: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ComponentResolver.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ComponentResolver.java?view=auto&rev=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ComponentResolver.java (added)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ComponentResolver.java Wed Apr  4 08:23:32 2007
@@ -0,0 +1,41 @@
+/**
+ *
+ * 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.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spi;
+
+import org.apache.camel.Component;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.impl.DefaultComponentResolver;
+
+/**
+ * Represents a resolver of components from a URI to be able to auto-load them using some
+ * discovery mechanism like {@link DefaultComponentResolver}
+ *
+ * @version $Revision$
+ */
+public interface ComponentResolver<E extends Exchange> {
+    
+    /**
+     * Attempts to resolve the component for the given URI
+     *
+     * @param uri the URI to resolve
+     * @param context the context to load the component if it can be resolved
+     * @return the component which is added to the context or null if it can not be resolved
+     */
+    Component<E> resolveComponent(String uri, CamelContext context);
+}

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ComponentResolver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ComponentResolver.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ComponentResolver.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ExchangeConverter.java (from r525477, activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/ExchangeConverter.java)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ExchangeConverter.java?view=diff&rev=525537&p1=activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/ExchangeConverter.java&r1=525477&p2=activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ExchangeConverter.java&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/ExchangeConverter.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ExchangeConverter.java Wed Apr  4 08:23:32 2007
@@ -14,7 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel;
+package org.apache.camel.spi;
+
+import org.apache.camel.Exchange;
 
 /**
  * This converter is capable of converting from an exchange to another type

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ExchangeConverter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ExchangeConverter.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ExchangeConverter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/Injector.java (from r525477, activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/Injector.java)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/Injector.java?view=diff&rev=525537&p1=activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/Injector.java&r1=525477&p2=activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/Injector.java&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/Injector.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/Injector.java Wed Apr  4 08:23:32 2007
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.impl.converter;
+package org.apache.camel.spi;
 
 /**
  * A pluggable strategy for creating and possibly dependency injecting objects

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/Injector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/Injector.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/Injector.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/package.html
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/package.html?view=auto&rev=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/package.html (added)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/package.html Wed Apr  4 08:23:32 2007
@@ -0,0 +1,25 @@
+<!--
+    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.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (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
+   
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<html>
+<head>
+</head>
+<body>
+
+Service Provider Interfaces used internally by the Camel runtime which are plugin strategies.
+
+</body>
+</html>

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/package.html
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/package.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Modified: activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/pojo
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/pojo?view=diff&rev=525537&r1=525477&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/pojo (original)
+++ activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/pojo Wed Apr  4 08:23:32 2007
@@ -1 +1 @@
-class=org.apache.camel.component.pojo.PojoEndpointResolver
+class=org.apache.camel.component.pojo.PojoComponent
\ No newline at end of file

Modified: activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/queue
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/queue?view=diff&rev=525537&r1=525477&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/queue (original)
+++ activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/queue Wed Apr  4 08:23:32 2007
@@ -1 +1 @@
-class=org.apache.camel.component.queue.QueueEndpointResolver
+class=org.apache.camel.component.queue.QueueComponent

Modified: activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/timer
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/timer?view=diff&rev=525537&r1=525477&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/timer (original)
+++ activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/timer Wed Apr  4 08:23:32 2007
@@ -1 +1 @@
-class=org.apache.camel.component.pojo.timer.TimerEndpointResolver
+class=org.apache.camel.component.pojo.timer.TimerComponent

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/InjectorDefaultsToReflectionTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/InjectorDefaultsToReflectionTest.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/InjectorDefaultsToReflectionTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/InjectorDefaultsToReflectionTest.java Wed Apr  4 08:23:32 2007
@@ -19,8 +19,8 @@
 
 import junit.framework.TestCase;
 import org.apache.camel.impl.DefaultCamelContext;
-import org.apache.camel.impl.converter.Injector;
-import org.apache.camel.impl.converter.ReflectionInjector;
+import org.apache.camel.impl.ReflectionInjector;
+import org.apache.camel.spi.Injector;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java Wed Apr  4 08:23:32 2007
@@ -50,7 +50,7 @@
         // lets add some routes
         container.addRoutes(new RouteBuilder() {
             public void configure() {
-                from("pojo:default:hello").intercept(tracingInterceptor).target().to("pojo:default:bye");
+                from("pojo:hello").intercept(tracingInterceptor).target().to("pojo:bye");
             }
         });
 

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/timer/TimerRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/timer/TimerRouteTest.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/timer/TimerRouteTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/timer/TimerRouteTest.java Wed Apr  4 08:23:32 2007
@@ -49,7 +49,7 @@
         // lets add some routes
         container.addRoutes(new RouteBuilder() {
             public void configure() {
-                from("timer:foo?fixedRate=true&delay=0&period=500").to("pojo:default:bar");
+                from("timer://foo?fixedRate=true&delay=0&period=500").to("pojo:bar");
             }
         });
         

Modified: activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiComponent.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiComponent.java (original)
+++ activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiComponent.java Wed Apr  4 08:23:32 2007
@@ -15,16 +15,13 @@
 import org.apache.camel.CamelContext;
 import org.apache.camel.Component;
 import org.apache.camel.Endpoint;
-import org.apache.camel.EndpointResolver;
 import org.apache.camel.Processor;
 import org.apache.camel.Exchange;
 import org.apache.camel.FailedToCreateProducerException;
 import org.apache.servicemix.common.DefaultComponent;
-import org.apache.servicemix.common.ServiceUnit;
 import org.apache.servicemix.jbi.util.IntrospectionSupport;
 import org.apache.servicemix.jbi.util.URISupport;
 import org.apache.servicemix.jbi.resolver.URIResolver;
-import org.apache.servicemix.executors.Executor;
 
 import javax.jbi.servicedesc.ServiceEndpoint;
 import javax.xml.namespace.QName;
@@ -123,7 +120,7 @@
 
     // Resolve Camel Endpoints
     //-------------------------------------------------------------------------
-    public Endpoint<Exchange> createEndpoint(String uri) {
+    public Endpoint<Exchange> resolveEndpoint(String uri) {
         if (uri.startsWith("jbi:")) {
             uri = uri.substring("jbi:".length());
 

Modified: activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/Callback.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/Callback.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/Callback.java (original)
+++ activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/Callback.java Wed Apr  4 08:23:32 2007
@@ -20,7 +20,6 @@
 /**
  * @version $Revision$
  */
-public interface Callback<R,P> {
-
+public interface Callback<R, P> {
     R callback(P parameter);
 }

Modified: activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/Consumed.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/Consumed.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/Consumed.java (original)
+++ activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/Consumed.java Wed Apr  4 08:23:32 2007
@@ -1,14 +1,14 @@
 package org.apache.camel.component.jpa;
 
+import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
 
 /**
  * An annotation to mark a method to be invoked when an entity bean has been succesfully processed
  * by a Camel consumer, so that it can be updated in some way to remove it from the query set.
- *
+ * <p/>
  * For example a method may be marked to set an active flag to false or to update some status value to the next step in a workflow
  *
  * @version $Revision$

Modified: activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/DefaultTransactionStrategy.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/DefaultTransactionStrategy.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/DefaultTransactionStrategy.java (original)
+++ activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/DefaultTransactionStrategy.java Wed Apr  4 08:23:32 2007
@@ -61,7 +61,7 @@
     }
 
     public EntityManager getEntityManager() {
-        if (entityManager == null){
+        if (entityManager == null) {
             entityManager = entityManagerFactory.createEntityManager();
         }
         return entityManager;
@@ -77,5 +77,4 @@
             entityManager.close();
         }
     }
-
 }

Modified: activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/DeleteHandler.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/DeleteHandler.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/DeleteHandler.java (original)
+++ activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/DeleteHandler.java Wed Apr  4 08:23:32 2007
@@ -26,13 +26,12 @@
  * @version $Revision$
  */
 public interface DeleteHandler<T> {
-
     /**
      * Deletes the entity bean after it has been processed either by actually
      * deleting the object or updating it in a way so that future queries do not return this object again.
      *
      * @param entityManager
-     * @param entityBean the entity bean that has been processed and should be deleted
+     * @param entityBean    the entity bean that has been processed and should be deleted
      */
     void deleteObject(EntityManager entityManager, Object entityBean);
 }

Modified: activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java (original)
+++ activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java Wed Apr  4 08:23:32 2007
@@ -20,35 +20,13 @@
 import org.apache.camel.CamelContext;
 import org.apache.camel.Component;
 import org.apache.camel.Endpoint;
-import org.apache.camel.EndpointResolver;
 import org.apache.camel.Exchange;
-import org.apache.camel.Service;
 import org.apache.camel.impl.DefaultComponent;
-import org.apache.camel.impl.ServiceSupport;
-import org.apache.camel.util.ObjectHelper;
-import org.apache.camel.util.URISupport;
 import org.apache.camel.util.IntrospectionSupport;
-import org.springframework.orm.jpa.JpaTemplate;
-import org.springframework.orm.jpa.LocalEntityManagerFactoryBean;
-import org.springframework.orm.jpa.JpaTransactionManager;
-import org.springframework.orm.jpa.SharedEntityManagerCreator;
-import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
-import org.springframework.orm.jpa.JpaCallback;
-import org.springframework.jca.support.LocalConnectionFactoryBean;
-import org.springframework.transaction.PlatformTransactionManager;
-import org.springframework.transaction.TransactionStatus;
-import org.springframework.transaction.support.TransactionTemplate;
-import org.springframework.transaction.support.TransactionCallback;
-import org.springframework.transaction.jta.JtaTransactionManager;
-import org.springframework.dao.DataAccessException;
+import org.apache.camel.util.ObjectHelper;
 
-import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-import java.net.URI;
 import java.util.Map;
-import java.util.List;
-import java.util.ArrayList;
 
 /**
  * A JPA Component
@@ -77,7 +55,7 @@
 
     @Override
     public String[] getUriPrefixes() {
-        return new String[] { "jpa" };
+        return new String[]{"jpa"};
     }
 
     @Override
@@ -101,5 +79,4 @@
         }
         return endpoint;
     }
-
 }

Modified: activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaProducer.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaProducer.java (original)
+++ activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaProducer.java Wed Apr  4 08:23:32 2007
@@ -17,12 +17,10 @@
  */
 package org.apache.camel.component.jpa;
 
-import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.Expression;
 import org.apache.camel.converter.ObjectConverter;
 import org.apache.camel.impl.DefaultProducer;
-import org.springframework.orm.jpa.JpaTemplate;
 import org.springframework.orm.jpa.JpaCallback;
 
 import javax.persistence.EntityManager;

Modified: activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaTemplateTransactionStrategy.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaTemplateTransactionStrategy.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaTemplateTransactionStrategy.java (original)
+++ activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaTemplateTransactionStrategy.java Wed Apr  4 08:23:32 2007
@@ -26,8 +26,8 @@
 import org.springframework.transaction.support.TransactionTemplate;
 
 import javax.persistence.EntityManager;
-import javax.persistence.PersistenceException;
 import javax.persistence.EntityManagerFactory;
+import javax.persistence.PersistenceException;
 
 /**
  * Delegates the strategy to the {@link JpaTemplate} and {@link TransactionTemplate} for transaction handling

Modified: activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/QueryBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/QueryBuilder.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/QueryBuilder.java (original)
+++ activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/QueryBuilder.java Wed Apr  4 08:23:32 2007
@@ -17,12 +17,12 @@
  */
 package org.apache.camel.component.jpa;
 
-import javax.persistence.Query;
 import javax.persistence.EntityManager;
+import javax.persistence.Query;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.Map;
 import java.util.Set;
-import java.util.Collection;
 
 /**
  * A builder of query expressions

Modified: activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/QueryFactory.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/QueryFactory.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/QueryFactory.java (original)
+++ activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/QueryFactory.java Wed Apr  4 08:23:32 2007
@@ -17,8 +17,8 @@
  */
 package org.apache.camel.component.jpa;
 
-import javax.persistence.Query;
 import javax.persistence.EntityManager;
+import javax.persistence.Query;
 
 /**
  * A Strategy to create a query to search for objects in a database
@@ -26,7 +26,6 @@
  * @version $Revision$
  */
 public interface QueryFactory {
-
     /**
      * Creates a new query to find objects to be processed
      *

Modified: activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/TransactionStrategy.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/TransactionStrategy.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/TransactionStrategy.java (original)
+++ activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/TransactionStrategy.java Wed Apr  4 08:23:32 2007
@@ -17,15 +17,12 @@
  */
 package org.apache.camel.component.jpa;
 
-import org.springframework.orm.jpa.JpaCallback;
 import org.apache.camel.Service;
-
-import javax.persistence.EntityManager;
+import org.springframework.orm.jpa.JpaCallback;
 
 /**
  * @version $Revision$
  */
 public interface TransactionStrategy extends Service {
-
     public Object execute(JpaCallback callback);
 }

Modified: activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaUsingCustomPersistenceUnitTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaUsingCustomPersistenceUnitTest.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaUsingCustomPersistenceUnitTest.java (original)
+++ activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaUsingCustomPersistenceUnitTest.java Wed Apr  4 08:23:32 2007
@@ -23,7 +23,6 @@
  * @version $Revision$
  */
 public class JpaUsingCustomPersistenceUnitTest extends JpaTest {
-
     protected String getEndpointUri() {
         return "jpa://" + SendEmail.class.getName() + "?persistenceUnit=custom";
     }

Modified: activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java (original)
+++ activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java Wed Apr  4 08:23:32 2007
@@ -101,11 +101,10 @@
         assertNotNull("Received a POJO", result);
         assertEquals("address property", "foo@bar.com", result.getAddress());
 
-
         // lets now test that the database is updated
         // TODO we need to sleep as we will be invoked from inside the transaction!
         Thread.sleep(1000);
-        
+
         transactionStrategy.execute(new JpaCallback() {
             public Object doInJpa(EntityManager entityManager) throws PersistenceException {
 

Modified: activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/examples/MultiSteps.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/examples/MultiSteps.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/examples/MultiSteps.java (original)
+++ activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/examples/MultiSteps.java Wed Apr  4 08:23:32 2007
@@ -22,8 +22,8 @@
 import org.apache.commons.logging.LogFactory;
 
 import javax.persistence.Entity;
-import javax.persistence.Id;
 import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
 import javax.persistence.NamedQuery;
 
 /**
@@ -34,10 +34,9 @@
  * @version $Revision$
  */
 @Entity
-@NamedQuery(name = "step1", query="select x from MultiSteps x where x.step = 1")
+@NamedQuery(name = "step1", query = "select x from MultiSteps x where x.step = 1")
 public class MultiSteps {
     private static final transient Log log = LogFactory.getLog(MultiSteps.class);
-    
     private Long id;
     private String address;
     private int step;

Modified: activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java (original)
+++ activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java Wed Apr  4 08:23:32 2007
@@ -18,7 +18,7 @@
 package org.apache.camel.spring;
 
 import org.apache.camel.impl.DefaultCamelContext;
-import org.apache.camel.impl.converter.Injector;
+import org.apache.camel.spi.Injector;
 import org.apache.camel.CamelContext;
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.beans.factory.DisposableBean;

Modified: activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/SpringInjector.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/SpringInjector.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/SpringInjector.java (original)
+++ activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/SpringInjector.java Wed Apr  4 08:23:32 2007
@@ -17,8 +17,8 @@
  */
 package org.apache.camel.spring;
 
-import org.apache.camel.impl.converter.Injector;
-import org.apache.camel.impl.converter.ReflectionInjector;
+import org.apache.camel.spi.Injector;
+import org.apache.camel.impl.ReflectionInjector;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.context.ApplicationContext;

Modified: activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppComponent.java?view=diff&rev=525537&r1=525536&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppComponent.java (original)
+++ activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppComponent.java Wed Apr  4 08:23:32 2007
@@ -19,6 +19,7 @@
 
 import com.sun.jndi.toolkit.url.Uri;
 import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
 import org.apache.camel.impl.DefaultComponent;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
@@ -39,23 +40,20 @@
         return new XmppComponent();
     }
 
-    protected XmppComponent() {
+    public XmppComponent() {
     }
 
     public XmppComponent(CamelContext context) {
         super(context);
     }
 
-    public XmppEndpoint createEndpoint(Uri uri) throws URISyntaxException {
-        // lets figure out from the URI whether its a queue, topic etc
-
-        String path = uri.getPath();
-        return createEndpoint(uri.toString(), path);
+    @Override
+    public String[] getUriPrefixes() {
+        return new String[] {"xmpp"};
     }
 
-    public XmppEndpoint createEndpoint(String uri, String path) throws URISyntaxException {
-        ObjectHelper.notNull(getCamelContext(), "context");
-
+    @Override
+    protected Endpoint<XmppExchange> createEndpoint(String uri, String remaining, Map parameters) throws Exception {
         XmppEndpoint endpoint = new XmppEndpoint(uri, this);
 
         URI u = new URI(uri);
@@ -75,9 +73,6 @@
                 endpoint.setParticipant(remainingPath);
             }
         }
-
-        Map options = URISupport.parseParamters(u);
-        IntrospectionSupport.setProperties(endpoint, options);
         return endpoint;
     }
 }

Modified: activemq/camel/trunk/camel-xmpp/src/main/resources/META-INF/services/org/apache/camel/component/xmpp
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xmpp/src/main/resources/META-INF/services/org/apache/camel/component/xmpp?view=diff&rev=525537&r1=525477&r2=525537
==============================================================================
--- activemq/camel/trunk/camel-xmpp/src/main/resources/META-INF/services/org/apache/camel/component/xmpp (original)
+++ activemq/camel/trunk/camel-xmpp/src/main/resources/META-INF/services/org/apache/camel/component/xmpp Wed Apr  4 08:23:32 2007
@@ -1 +1 @@
-class=org.apache.camel.component.xmpp.XmppEndpointResolver
+class=org.apache.camel.component.xmpp.XmppComponent



Mime
View raw message