camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r655516 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/ camel-core/src/main/java/org/apache/camel/component/bean/ camel-core/src/main/java/org/apache/camel/component/dataset/ camel-core/src/main/java/org/apache/camel/...
Date Mon, 12 May 2008 15:18:54 GMT
Author: jstrachan
Date: Mon May 12 08:18:52 2008
New Revision: 655516

URL: http://svn.apache.org/viewvc?rev=655516&view=rev
Log:
added refactor to make it easier to create endpoint instances from a spring.xml with minimal constructors for https://issues.apache.org/activemq/browse/CAMEL-505

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/CamelInvocationHandler.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/list/ListEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPollingEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProcessorEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/CamelNamingStrategy.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/ProducerTest.java
    activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomEndpoint.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapEndpoint.java
    activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpEndpoint.java
    activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java
    activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java
    activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpExchange.java
    activemq/camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisEndpoint.java
    activemq/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcEndpoint.java
    activemq/camel/trunk/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrEndpoint.java
    activemq/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcEndpoint.java
    activemq/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
    activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java
    activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java
    activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
    activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsQueueEndpoint.java
    activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryQueueEndpoint.java
    activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryTopicEndpoint.java
    activemq/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java
    activemq/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java
    activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java
    activemq/camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java
    activemq/camel/trunk/components/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiEndpoint.java
    activemq/camel/trunk/components/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiProducer.java
    activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationConsumer.java
    activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationEndpoint.java
    activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationProducer.java
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/ResourceBasedEndpoint.java
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/event/EventEndpoint.java
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/test/TestEndpoint.java
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
    activemq/camel/trunk/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlEndpoint.java
    activemq/camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java
    activemq/camel/trunk/components/camel-stringtemplate/src/main/java/org/apache/camel/component/stringtemplate/StringTemplateEndpoint.java
    activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component/uface/UFaceEndpoint.java
    activemq/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java Mon May 12 08:18:52 2008
@@ -69,7 +69,7 @@
      *
      * @return the context which created the endpoint
      */
-    CamelContext getContext();
+    CamelContext getCamelContext();
 
     /**
      * Creates a new producer which is used send messages into the endpoint
@@ -106,5 +106,5 @@
 
     void configureProperties(Map options);
 
-    void setContext(CamelContext context);
+    void setCamelContext(CamelContext context);
 }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/CamelInvocationHandler.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/CamelInvocationHandler.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/CamelInvocationHandler.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/CamelInvocationHandler.java Mon May 12 08:18:52 2008
@@ -41,7 +41,7 @@
 
     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
         BeanInvocation invocation = new BeanInvocation(method, args);
-        BeanExchange exchange = new BeanExchange(endpoint.getContext(), ExchangePattern.InOut);
+        BeanExchange exchange = new BeanExchange(endpoint.getCamelContext(), ExchangePattern.InOut);
         exchange.setInvocation(invocation);
 
         producer.process(exchange);

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java Mon May 12 08:18:52 2008
@@ -49,6 +49,11 @@
         this.dataSet = dataSet;
     }
 
+    public DataSetEndpoint(String endpointUri, DataSet dataSet) {
+        super(endpointUri);
+        this.dataSet = dataSet;
+    }
+
     public static void assertEquals(String description, Object expected, Object actual, Exchange exchange) {
         if (!ObjectHelper.equal(expected, actual)) {
             throw new AssertionError(description + " does not match. Expected: " + expected + " but was: " + actual + " on  " + exchange + " with headers: " + exchange.getIn().getHeaders());

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java Mon May 12 08:18:52 2008
@@ -44,6 +44,10 @@
         super(uri, component);
     }
 
+    public DirectEndpoint(String endpointUri) {
+        super(endpointUri);
+    }
+
     public Producer createProducer() throws Exception {
         return new DirectProducer<E>(this);
     }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java Mon May 12 08:18:52 2008
@@ -57,6 +57,11 @@
         this.file = file;
     }
 
+    public FileEndpoint(String endpointUri, File file) {
+        super(endpointUri);
+        this.file = file;
+    }
+
     public Producer<FileExchange> createProducer() throws Exception {
         Producer<FileExchange> result = new FileProducer(this);
         return result;
@@ -75,7 +80,7 @@
      * @return the created exchange
      */
     public FileExchange createExchange(File file) {
-        return new FileExchange(getContext(), getExchangePattern(), file);
+        return new FileExchange(getCamelContext(), getExchangePattern(), file);
     }
 
     public FileExchange createExchange() {
@@ -83,7 +88,7 @@
     }
 
     public FileExchange createExchange(ExchangePattern pattern) {
-        return new FileExchange(getContext(), pattern, file);
+        return new FileExchange(getCamelContext(), pattern, file);
     }
 
     /**

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXEndpoint.java Mon May 12 08:18:52 2008
@@ -52,6 +52,10 @@
         observedObjectName = endpointUri;
     }
 
+    public JMXEndpoint(String endpointUri) {
+        super(endpointUri);
+    }
+
     /**
      * @return a Producer
      * @throws Exception
@@ -93,15 +97,15 @@
     }
 
     public JMXExchange createExchange(Notification notification) {
-        return new JMXExchange(getContext(), getExchangePattern(), notification);
+        return new JMXExchange(getCamelContext(), getExchangePattern(), notification);
     }
 
     public JMXExchange createExchange() {
-        return new JMXExchange(getContext(), getExchangePattern(), null);
+        return new JMXExchange(getCamelContext(), getExchangePattern(), null);
     }
 
     public JMXExchange createExchange(ExchangePattern pattern) {
-        return new JMXExchange(getContext(), pattern, null);
+        return new JMXExchange(getCamelContext(), pattern, null);
     }
 
     public String getAttributeName() {

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/list/ListEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/list/ListEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/list/ListEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/list/ListEndpoint.java Mon May 12 08:18:52 2008
@@ -54,6 +54,11 @@
         reset();
     }
 
+    public ListEndpoint(String endpointUri) {
+        super(endpointUri);
+        reset();
+    }
+
     public boolean isSingleton() {
         return true;
     }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java Mon May 12 08:18:52 2008
@@ -76,6 +76,11 @@
         init();
     }
 
+    public MockEndpoint(String endpointUri) {
+        super(endpointUri);
+        init();
+    }
+
     public static void assertWait(long timeout, TimeUnit unit, MockEndpoint... endpoints) throws InterruptedException {
         long start = System.currentTimeMillis();
         long left = unit.toMillis(timeout);

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java Mon May 12 08:18:52 2008
@@ -48,6 +48,11 @@
         this(uri, component, component.createQueue(uri, parameters));
     }
 
+    public SedaEndpoint(String endpointUri, BlockingQueue<Exchange> queue) {
+        super(endpointUri);
+        this.queue = queue;
+    }
+
     public Producer createProducer() throws Exception {
         return new CollectionProducer(this, getQueue());
     }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java Mon May 12 08:18:52 2008
@@ -33,8 +33,7 @@
  */
 public class TimerEndpoint extends DefaultEndpoint<Exchange> {
 
-    private final TimerComponent component;
-    private final String timerName;
+    private String timerName;
     private Date time;
     private long period = 1000;
     private long delay;
@@ -44,10 +43,19 @@
 
     public TimerEndpoint(String fullURI, TimerComponent component, String timerName) {
         super(fullURI, component);
-        this.component = component;
+        this.timer = component.getTimer(this);
         this.timerName = timerName;
     }
 
+    public TimerEndpoint(String endpointUri, Timer timer) {
+        this(endpointUri);
+        this.timer = timer;
+    }
+
+    public TimerEndpoint(String endpointUri) {
+        super(endpointUri);
+    }
+
     public Producer<Exchange> createProducer() throws Exception {
         throw new RuntimeCamelException("Cannot produce to a TimerEndpoint: " + getEndpointUri());
     }
@@ -56,14 +64,17 @@
         return new TimerConsumer(this, processor);
     }
 
-    public TimerComponent getComponent() {
-        return component;
-    }
-
     public String getTimerName() {
+        if (timerName == null) {
+            timerName = getEndpointUri();
+        }
         return timerName;
     }
 
+    public void setTimerName(String timerName) {
+        this.timerName = timerName;
+    }
+
     public boolean isDaemon() {
         return daemon;
     }
@@ -110,8 +121,12 @@
 
     public Timer getTimer() {
         if (timer == null) {
-            timer = component.getTimer(this);
+            timer = new Timer();
         }
         return timer;
     }
+
+    public void setTimer(Timer timer) {
+        this.timer = timer;
+    }
 }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java Mon May 12 08:18:52 2008
@@ -28,6 +28,7 @@
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.PollingConsumer;
+import org.apache.camel.CamelContextAware;
 import org.apache.camel.util.ObjectHelper;
 
 /**
@@ -35,9 +36,9 @@
  *
  * @version $Revision$
  */
-public abstract class DefaultEndpoint<E extends Exchange> implements Endpoint<E> {
+public abstract class DefaultEndpoint<E extends Exchange> implements Endpoint<E>, CamelContextAware {
     private String endpointUri;
-    private CamelContext context;
+    private CamelContext camelContext;
     private Component component;
     private ScheduledExecutorService executorService;
     private ExchangePattern exchangePattern = ExchangePattern.InOnly;
@@ -47,9 +48,13 @@
         this.component = component;
     }
 
-    protected DefaultEndpoint(String endpointUri, CamelContext context) {
+    protected DefaultEndpoint(String endpointUri, CamelContext camelContext) {
+        this(endpointUri);
+        this.camelContext = camelContext;
+    }
+
+    protected DefaultEndpoint(String endpointUri) {
         this.endpointUri = endpointUri;
-        this.context = context;
     }
 
     public int hashCode() {
@@ -74,16 +79,16 @@
         return endpointUri;
     }
 
-    public CamelContext getContext() {
-        return context;
+    public CamelContext getCamelContext() {
+        return camelContext;
     }
 
     public Component getComponent() {
         return component;
     }
 
-    public void setContext(CamelContext context) {
-        this.context = context;
+    public void setCamelContext(CamelContext camelContext) {
+        this.camelContext = camelContext;
     }
 
     /**
@@ -122,7 +127,7 @@
         if (type.isInstance(exchange)) {
             return type.cast(exchange);
         }
-        return getContext().getExchangeConverter().convertTo(type, exchange);
+        return getCamelContext().getExchangeConverter().convertTo(type, exchange);
     }
 
     public E createExchange(Exchange exchange) {
@@ -160,7 +165,7 @@
     }
 
     public E createExchange(ExchangePattern pattern) {
-        return (E) new DefaultExchange(getContext(), pattern);
+        return (E) new DefaultExchange(getCamelContext(), pattern);
     }
 
     public ExchangePattern getExchangePattern() {

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPollingEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPollingEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPollingEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPollingEndpoint.java Mon May 12 08:18:52 2008
@@ -38,6 +38,10 @@
         super(endpointUri, context);
     }
 
+    protected DefaultPollingEndpoint(String endpointUri) {
+        super(endpointUri);
+    }
+
     public Consumer<E> createConsumer(Processor processor) throws Exception {
         DefaultScheduledPollConsumer result = new DefaultScheduledPollConsumer(this, processor);
         configureConsumer(result);

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProcessorEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProcessorEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProcessorEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProcessorEndpoint.java Mon May 12 08:18:52 2008
@@ -43,6 +43,10 @@
         this.processor = processor;
     }
 
+    public ProcessorEndpoint(String endpointUri, Processor processor) {
+        super(endpointUri);
+        this.processor = processor;
+    }
 
     public Producer<Exchange> createProducer() throws Exception {
         return new DefaultProducer<Exchange>(this) {

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollEndpoint.java Mon May 12 08:18:52 2008
@@ -41,6 +41,10 @@
         super(endpointUri, context);
     }
 
+    protected ScheduledPollEndpoint(String endpointUri) {
+        super(endpointUri);
+    }
+
     public Map getConsumerProperties() {
         return consumerProperties;
     }
@@ -52,7 +56,7 @@
     protected void configureConsumer(Consumer<E> consumer) throws Exception {
         if (consumerProperties != null) {
             // TODO pass in type converter
-            IntrospectionSupport.setProperties(getContext().getTypeConverter(), consumer, consumerProperties);
+            IntrospectionSupport.setProperties(getCamelContext().getTypeConverter(), consumer, consumerProperties);
         }
     }
 

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/CamelNamingStrategy.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/CamelNamingStrategy.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/CamelNamingStrategy.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/CamelNamingStrategy.java Mon May 12 08:18:52 2008
@@ -96,7 +96,7 @@
 
         StringBuffer buffer = new StringBuffer();
         buffer.append(domainName + ":");
-        buffer.append(KEY_CONTEXT + "=" + getContextId(ep.getContext()) + ",");
+        buffer.append(KEY_CONTEXT + "=" + getContextId(ep.getCamelContext()) + ",");
         buffer.append(KEY_GROUP + "=" + GROUP_ENDPOINTS + ",");
         buffer.append(KEY_COMPONENT + "=" + getComponentId(ep) + ",");
         buffer.append(KEY_NAME + "=" + getEndpointId(ep));
@@ -136,7 +136,7 @@
         Route<? extends Exchange> route = mbean.getRoute();
         Endpoint<? extends Exchange> ep = route.getEndpoint();
 
-        String ctxid = ep != null ? getContextId(ep.getContext()) : VALUE_UNKNOWN;
+        String ctxid = ep != null ? getContextId(ep.getCamelContext()) : VALUE_UNKNOWN;
         String cid = getComponentId(ep);
         String id = VALUE_UNKNOWN.equals(cid) ? getEndpointId(ep)
             : "[" + cid + "]" + getEndpointId(ep);
@@ -169,7 +169,7 @@
 
         RouteType route = routeContext.getRoute();
         Endpoint<? extends Exchange> ep = routeContext.getEndpoint();
-        String ctxid = ep != null ? getContextId(ep.getContext()) : VALUE_UNKNOWN;
+        String ctxid = ep != null ? getContextId(ep.getCamelContext()) : VALUE_UNKNOWN;
         String cid = getComponentId(ep);
         String id = VALUE_UNKNOWN.equals(cid) ? getEndpointId(ep) : "[" + cid + "]" + getEndpointId(ep);
         String group = route.getGroup();

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/ProducerTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/ProducerTest.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/ProducerTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/ProducerTest.java Mon May 12 08:18:52 2008
@@ -48,7 +48,7 @@
 
 
             public MyExchange createExchange(ExchangePattern pattern) {
-                return new MyExchange(getContext(), pattern);
+                return new MyExchange(getCamelContext(), pattern);
             }
 
             public Producer<MyExchange> createProducer() throws Exception {

Modified: activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomEndpoint.java Mon May 12 08:18:52 2008
@@ -32,6 +32,7 @@
 import org.apache.camel.Exchange;
 import org.apache.camel.PollingConsumer;
 import org.apache.camel.Producer;
+import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.impl.DefaultPollingEndpoint;
 
 /**
@@ -49,16 +50,27 @@
         this.atomUri = atomUri;
     }
 
+    public AtomEndpoint(String endpointUri, String atomUri) {
+        this(endpointUri);
+        this.atomUri = atomUri;
+    }
+
+    public AtomEndpoint(String endpointUri) {
+        super(endpointUri);
+    }
+
     public boolean isSingleton() {
         return true;
     }
 
     public Producer createProducer() throws Exception {
+        validate();
         return new AtomProducer(this);
     }
 
     @Override
     public PollingConsumer createPollingConsumer() throws Exception {
+        validate();
         if (isSplitEntries()) {
             return new AtomEntryPollingConsumer(this);
         } else {
@@ -118,6 +130,14 @@
 
     // Implementation methods
     //-------------------------------------------------------------------------
+
+    /**
+     * Validates the endpoint is configured properly
+     */
+    protected void validate() {
+        ObjectHelper.notNull(getAtomUri(), "atomUri property");
+    }
+
     protected Factory createAtomFactory() {
         return Abdera.getNewFactory();
     }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java Mon May 12 08:18:52 2008
@@ -60,7 +60,7 @@
             if (beanId.startsWith("//")) {
                 beanId = beanId.substring(2);
             }
-            SpringCamelContext context = (SpringCamelContext) this.getContext();
+            SpringCamelContext context = (SpringCamelContext) this.getCamelContext();
             configurer = new ConfigurerImpl(context.getApplicationContext());
             cxfEndpointBean = (CxfEndpointBean) context.getApplicationContext().getBean(beanId);
             assert cxfEndpointBean != null;
@@ -76,15 +76,15 @@
     }
 
     public CxfExchange createExchange() {
-        return new CxfExchange(getContext(), getExchangePattern());
+        return new CxfExchange(getCamelContext(), getExchangePattern());
     }
 
     public CxfExchange createExchange(ExchangePattern pattern) {
-        return new CxfExchange(getContext(), pattern);
+        return new CxfExchange(getCamelContext(), pattern);
     }
 
     public CxfExchange createExchange(Message inMessage) {
-        return new CxfExchange(getContext(), getExchangePattern(), inMessage);
+        return new CxfExchange(getCamelContext(), getExchangePattern(), inMessage);
     }
 
     public String getDataFormat() {

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapEndpoint.java Mon May 12 08:18:52 2008
@@ -81,8 +81,8 @@
         return endpoint.createExchange(exchange);
     }
 
-    public CamelContext getContext() {
-        return endpoint.getContext();
+    public CamelContext getCamelContext() {
+        return endpoint.getCamelContext();
     }
 
     public Producer createProducer() throws Exception {
@@ -155,7 +155,7 @@
         return serviceName;
     }
 
-    public void setContext(CamelContext context) {
-        endpoint.setContext(context);
+    public void setCamelContext(CamelContext context) {
+        endpoint.setCamelContext(context);
     }
 }

Modified: activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpEndpoint.java Mon May 12 08:18:52 2008
@@ -30,6 +30,10 @@
         super(uri, remoteFileComponent, configuration);
     }
 
+    public FtpEndpoint(String endpointUri) {
+        super(endpointUri);
+    }
+
     public FtpProducer createProducer() throws Exception {
         return new FtpProducer(this, createFtpClient());
     }

Modified: activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java Mon May 12 08:18:52 2008
@@ -30,20 +30,29 @@
         this.configuration = configuration;
     }
 
+    protected RemoteFileEndpoint(String endpointUri, RemoteFileConfiguration configuration) {
+        super(endpointUri);
+        this.configuration = configuration;
+    }
+
+    protected RemoteFileEndpoint(String endpointUri) {
+        this(endpointUri, new RemoteFileConfiguration());
+    }
+
     protected RemoteFileBinding createRemoteFileBinding() {
         return new RemoteFileBinding();
     }
 
     public T createExchange() {
-        return (T) new RemoteFileExchange(getContext(), getExchangePattern(), getBinding());
+        return (T) new RemoteFileExchange(getCamelContext(), getExchangePattern(), getBinding());
     }
 
     public T createExchange(ExchangePattern pattern) {
-        return (T) new RemoteFileExchange(getContext(), pattern, getBinding());
+        return (T) new RemoteFileExchange(getCamelContext(), pattern, getBinding());
     }
 
     public T createExchange(String fullFileName, ByteArrayOutputStream outputStream) {
-        return (T) new RemoteFileExchange(getContext(), getExchangePattern(), getBinding(), getConfiguration().getHost(), fullFileName, outputStream);
+        return (T) new RemoteFileExchange(getCamelContext(), getExchangePattern(), getBinding(), getConfiguration().getHost(), fullFileName, outputStream);
     }
 
     public RemoteFileBinding getBinding() {
@@ -64,4 +73,8 @@
     public RemoteFileConfiguration getConfiguration() {
         return configuration;
     }
+
+    public void setConfiguration(RemoteFileConfiguration configuration) {
+        this.configuration = configuration;
+    }
 }

Modified: activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java Mon May 12 08:18:52 2008
@@ -29,6 +29,10 @@
         super(uri, remoteFileComponent, configuration);
     }
 
+    public SftpEndpoint(String endpointUri) {
+        super(endpointUri);
+    }
+
     public SftpProducer createProducer() throws Exception {
         return new SftpProducer(this, createSession());
     }

Modified: activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpExchange.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpExchange.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpExchange.java (original)
+++ activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpExchange.java Mon May 12 08:18:52 2008
@@ -34,7 +34,7 @@
     private HttpServletResponse response;
 
     public HttpExchange(HttpEndpoint endpoint, ExchangePattern pattern) {
-        super(endpoint.getContext(), pattern);
+        super(endpoint.getCamelContext(), pattern);
         this.endpoint = endpoint;
     }
 

Modified: activemq/camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisEndpoint.java Mon May 12 08:18:52 2008
@@ -41,6 +41,11 @@
         this.entityName = entityName;
     }
 
+    public IBatisEndpoint(String endpointUri, String entityName) {
+        super(endpointUri);
+        this.entityName = entityName;
+    }
+
     @Override
     public IBatisComponent getComponent() {
         return (IBatisComponent) super.getComponent();

Modified: activemq/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcEndpoint.java Mon May 12 08:18:52 2008
@@ -43,39 +43,39 @@
     }
 
     public IrcExchange createExchange(ExchangePattern pattern) {
-        return new IrcExchange(getContext(), pattern, getBinding());
+        return new IrcExchange(getCamelContext(), pattern, getBinding());
     }
 
     public IrcExchange createOnPrivmsgExchange(String target, IRCUser user, String msg) {
-        return new IrcExchange(getContext(), getExchangePattern(), getBinding(), new IrcMessage("PRIVMSG", target, user, msg));
+        return new IrcExchange(getCamelContext(), getExchangePattern(), getBinding(), new IrcMessage("PRIVMSG", target, user, msg));
     }
 
     public IrcExchange createOnNickExchange(IRCUser user, String newNick) {
-        return new IrcExchange(getContext(), getExchangePattern(), getBinding(), new IrcMessage("NICK", user, newNick));
+        return new IrcExchange(getCamelContext(), getExchangePattern(), getBinding(), new IrcMessage("NICK", user, newNick));
     }
 
     public IrcExchange createOnQuitExchange(IRCUser user, String msg) {
-        return new IrcExchange(getContext(), getExchangePattern(), getBinding(), new IrcMessage("QUIT", user, msg));
+        return new IrcExchange(getCamelContext(), getExchangePattern(), getBinding(), new IrcMessage("QUIT", user, msg));
     }
 
     public IrcExchange createOnJoinExchange(String channel, IRCUser user) {
-        return new IrcExchange(getContext(), getExchangePattern(), getBinding(), new IrcMessage("JOIN", channel, user));
+        return new IrcExchange(getCamelContext(), getExchangePattern(), getBinding(), new IrcMessage("JOIN", channel, user));
     }
 
     public IrcExchange createOnKickExchange(String channel, IRCUser user, String whoWasKickedNick, String msg) {
-        return new IrcExchange(getContext(), getExchangePattern(), getBinding(), new IrcMessage("KICK", channel, user, whoWasKickedNick, msg));
+        return new IrcExchange(getCamelContext(), getExchangePattern(), getBinding(), new IrcMessage("KICK", channel, user, whoWasKickedNick, msg));
     }
 
     public IrcExchange createOnModeExchange(String channel, IRCUser user, IRCModeParser modeParser) {
-        return new IrcExchange(getContext(), getExchangePattern(), getBinding(), new IrcMessage("MODE", channel, user, modeParser.getLine()));
+        return new IrcExchange(getCamelContext(), getExchangePattern(), getBinding(), new IrcMessage("MODE", channel, user, modeParser.getLine()));
     }
 
     public IrcExchange createOnPartExchange(String channel, IRCUser user, String msg) {
-        return new IrcExchange(getContext(), getExchangePattern(), getBinding(), new IrcMessage("PART", channel, user, msg));
+        return new IrcExchange(getCamelContext(), getExchangePattern(), getBinding(), new IrcMessage("PART", channel, user, msg));
     }
 
     public IrcExchange createOnTopicExchange(String channel, IRCUser user, String topic) {
-        return new IrcExchange(getContext(), getExchangePattern(), getBinding(), new IrcMessage("TOPIC", channel, user, topic));
+        return new IrcExchange(getCamelContext(), getExchangePattern(), getBinding(), new IrcMessage("TOPIC", channel, user, topic));
     }
 
     public IrcProducer createProducer() throws Exception {

Modified: activemq/camel/trunk/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrEndpoint.java Mon May 12 08:18:52 2008
@@ -57,6 +57,13 @@
         }
     }
 
+    public JcrEndpoint(String endpointUri, String base, Credentials credentials, Repository repository) {
+        super(endpointUri);
+        this.base = base;
+        this.credentials = credentials;
+        this.repository = repository;
+    }
+
     /**
      * Currently unsupported
      * @throws RuntimeCamelException

Modified: activemq/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcEndpoint.java Mon May 12 08:18:52 2008
@@ -42,6 +42,12 @@
         this.remaining = remaining;
     }
 
+    public JdbcEndpoint(String endpointUri, String remaining) throws URISyntaxException {
+        super(endpointUri);
+        this.remaining = remaining;
+        this.uri = new URI(endpointUri);
+    }
+
     public boolean isSingleton() {
         return false;
     }

Modified: activemq/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java (original)
+++ activemq/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java Mon May 12 08:18:52 2008
@@ -44,7 +44,7 @@
     public JdbcProducer(JdbcEndpoint endpoint, String remaining, int readSize) throws Exception {
         super(endpoint);
         this.readSize = readSize;
-        source = (DataSource) getEndpoint().getContext().getRegistry().lookup(remaining);
+        source = (DataSource) getEndpoint().getCamelContext().getRegistry().lookup(remaining);
     }
 
     /**

Modified: activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java Mon May 12 08:18:52 2008
@@ -43,6 +43,12 @@
         this.httpUri = httpUri;
     }
 
+    public JhcEndpoint(String endpointUri, URI httpUri, HttpParams params) {
+        super(endpointUri);
+        this.httpUri = httpUri;
+        this.params = params;
+    }
+
     public HttpParams getParams() {
         return params;
     }

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java Mon May 12 08:18:52 2008
@@ -25,7 +25,6 @@
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.Processor;
 import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.util.ObjectHelper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.jms.core.JmsOperations;
@@ -77,7 +76,7 @@
     }
 
     public JmsExchange createExchange(Message message, Destination replyDestination) {
-        JmsExchange exchange = new JmsExchange(endpoint.getContext(), endpoint.getExchangePattern(), getBinding(), message);
+        JmsExchange exchange = new JmsExchange(endpoint.getCamelContext(), endpoint.getExchangePattern(), getBinding(), message);
         // lets set to an InOut if we have some kind of reply-to destination
         if (replyDestination != null && !disableReplyTo) {
             exchange.setProperty("org.apache.camel.jms.replyDestination", replyDestination);

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java Mon May 12 08:18:52 2008
@@ -35,7 +35,6 @@
  * @version $Revision:520964 $
  */
 public class JmsEndpoint extends DefaultEndpoint<JmsExchange> {
-    private final JmsComponent component;
     private final boolean pubSubDomain;
     private JmsBinding binding;
     private String destination;
@@ -46,13 +45,32 @@
 
     public JmsEndpoint(String uri, JmsComponent component, String destination, boolean pubSubDomain, JmsConfiguration configuration) {
         super(uri, component);
-        this.component = component;
         this.configuration = configuration;
         this.destination = destination;
         this.pubSubDomain = pubSubDomain;
         this.requestTimeout = configuration.getRequestTimeout();
     }
 
+    public JmsEndpoint(String endpointUri, JmsBinding binding, JmsConfiguration configuration, String destination, boolean pubSubDomain) {
+        super(endpointUri);
+        this.binding = binding;
+        this.configuration = configuration;
+        this.destination = destination;
+        this.pubSubDomain = pubSubDomain;
+        this.requestTimeout = configuration.getRequestTimeout();
+    }
+
+    public JmsEndpoint(String endpointUri, String destination, boolean pubSubDomain) {
+        this(endpointUri, new JmsBinding(), new JmsConfiguration(), destination, pubSubDomain);
+    }
+
+    /**
+     * Creates a pub-sub endpoint with the given destination
+     */
+    public JmsEndpoint(String endpointUri, String destination) {
+        this(endpointUri, destination, true);
+    }
+
     public JmsProducer createProducer() throws Exception {
         return new JmsProducer(this);
     }
@@ -98,11 +116,11 @@
 
     @Override
     public JmsExchange createExchange(ExchangePattern pattern) {
-        return new JmsExchange(getContext(), pattern, getBinding());
+        return new JmsExchange(getCamelContext(), pattern, getBinding());
     }
 
     public JmsExchange createExchange(Message message) {
-        return new JmsExchange(getContext(), getExchangePattern(), getBinding(), message);
+        return new JmsExchange(getCamelContext(), getExchangePattern(), getBinding(), message);
     }
 
     /**

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsQueueEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsQueueEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsQueueEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsQueueEndpoint.java Mon May 12 08:18:52 2008
@@ -51,6 +51,19 @@
         }
     }
 
+    public JmsQueueEndpoint(String endpointUri, String destination, QueueBrowseStrategy queueBrowseStrategy) {
+        super(endpointUri, destination, false);
+        this.queueBrowseStrategy = queueBrowseStrategy;
+        if (queueBrowseStrategy == null) {
+            queueBrowseStrategy = createQueueBrowseStrategy();
+        }
+    }
+
+    public JmsQueueEndpoint(String endpointUri, String destination) {
+        super(endpointUri, destination, false);
+        queueBrowseStrategy = createQueueBrowseStrategy();
+    }
+
     public int getMaximumBrowseSize() {
         return maximumBrowseSize;
     }

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryQueueEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryQueueEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryQueueEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryQueueEndpoint.java Mon May 12 08:18:52 2008
@@ -42,6 +42,10 @@
         super(uri, component, destination, configuration, queueBrowseStrategy);
     }
 
+    public JmsTemporaryQueueEndpoint(String endpointUri, String destination) {
+        super(endpointUri, destination);
+    }
+
     /**
      * This endpoint is a singleton so that the temporary destination instances are shared across all
      * producers and consumers of the same endpoint URI

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryTopicEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryTopicEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryTopicEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsTemporaryTopicEndpoint.java Mon May 12 08:18:52 2008
@@ -38,6 +38,10 @@
         super(uri, component, destination, true, configuration);
     }
 
+    public JmsTemporaryTopicEndpoint(String endpointUri, String destination) {
+        super(endpointUri, destination);
+    }
+
     /**
      * This endpoint is a singleton so that the temporary destination instances are shared across all
      * producers and consumers of the same endpoint URI

Modified: activemq/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java Mon May 12 08:18:52 2008
@@ -32,7 +32,7 @@
 import org.apache.camel.impl.DefaultExchange;
 import org.apache.camel.impl.ScheduledPollEndpoint;
 import org.apache.camel.util.IntrospectionSupport;
-
+import org.apache.camel.util.ObjectHelper;
 import org.springframework.orm.jpa.JpaTemplate;
 
 /**
@@ -55,11 +55,22 @@
         entityManagerFactory = component.getEntityManagerFactory();
     }
 
+    public JpaEndpoint(String endpointUri, EntityManagerFactory entityManagerFactory) {
+        super(endpointUri);
+        this.entityManagerFactory = entityManagerFactory;
+    }
+
+    public JpaEndpoint(String endpointUri) {
+        super(endpointUri);
+    }
+
     public Producer<Exchange> createProducer() throws Exception {
+        validate();
         return new JpaProducer(this, getProducerExpression());
     }
 
     public Consumer<Exchange> createConsumer(Processor processor) throws Exception {
+        validate();
         JpaConsumer consumer = new JpaConsumer(this, processor);
         configureConsumer(consumer);
         return consumer;
@@ -174,6 +185,10 @@
 
     // Implementation methods
     // -------------------------------------------------------------------------
+    protected void validate() {
+        ObjectHelper.notNull(getEntityManagerFactory(), "entityManagerFactory property");
+    }
+
     protected JpaTemplate createTemplate() {
         return new JpaTemplate(getEntityManagerFactory());
     }

Modified: activemq/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java Mon May 12 08:18:52 2008
@@ -40,6 +40,15 @@
         this.configuration = configuration;
     }
 
+    public MailEndpoint(String endpointUri, MailConfiguration configuration) {
+        super(endpointUri);
+        this.configuration = configuration;
+    }
+
+    public MailEndpoint(String endpointUri) {
+        this(endpointUri, new MailConfiguration());
+    }
+
     public Producer<MailExchange> createProducer() throws Exception {
         JavaMailSender sender = configuration.createJavaMailSender();
         return createProducer(sender);
@@ -79,11 +88,11 @@
 
     @Override
     public MailExchange createExchange(ExchangePattern pattern) {
-        return new MailExchange(getContext(), pattern, getBinding());
+        return new MailExchange(getCamelContext(), pattern, getBinding());
     }
 
     public MailExchange createExchange(Message message) {
-        return new MailExchange(getContext(), getExchangePattern(), getBinding(), message);
+        return new MailExchange(getCamelContext(), getExchangePattern(), getBinding(), message);
     }
 
     // Properties

Modified: activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java Mon May 12 08:18:52 2008
@@ -76,11 +76,11 @@
 
     @Override
     public MinaExchange createExchange(ExchangePattern pattern) {
-        return new MinaExchange(getContext(), pattern, null);
+        return new MinaExchange(getCamelContext(), pattern, null);
     }
 
     public MinaExchange createExchange(IoSession session, Object payload) {
-        MinaExchange exchange = new MinaExchange(getContext(), getExchangePattern(), session);
+        MinaExchange exchange = new MinaExchange(getCamelContext(), getExchangePattern(), session);
         MinaPayloadHelper.setIn(exchange, payload);
         return exchange;
     }

Modified: activemq/camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java Mon May 12 08:18:52 2008
@@ -56,6 +56,11 @@
         this.scheduler = scheduler;
     }
 
+    public QuartzEndpoint(String endpointUri, Scheduler scheduler) {
+        super(endpointUri);
+        this.scheduler = scheduler;
+    }
+
     public void addTriggers(Map<Trigger, JobDetail> triggerMap) throws SchedulerException {
         if (triggerMap != null) {
             Set<Map.Entry<Trigger, JobDetail>> entries = triggerMap.entrySet();
@@ -119,11 +124,11 @@
 
     @Override
     public QuartzExchange createExchange(ExchangePattern pattern) {
-        return new QuartzExchange(getContext(), pattern, null);
+        return new QuartzExchange(getCamelContext(), pattern, null);
     }
 
     public QuartzExchange createExchange(JobExecutionContext jobExecutionContext) {
-        return new QuartzExchange(getContext(), getExchangePattern(), jobExecutionContext);
+        return new QuartzExchange(getCamelContext(), getExchangePattern(), jobExecutionContext);
     }
 
     public Producer<QuartzExchange> createProducer() throws Exception {

Modified: activemq/camel/trunk/components/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiEndpoint.java Mon May 12 08:18:52 2008
@@ -48,13 +48,18 @@
         this.uri = new URI(endpointUri);
     }
 
+    public RmiEndpoint(String endpointUri) throws URISyntaxException {
+        super(endpointUri);
+        this.uri = new URI(endpointUri);
+    }
+
     public boolean isSingleton() {
         return false;
     }
 
     @Override
     public BeanExchange createExchange(ExchangePattern pattern) {
-        return new BeanExchange(getContext(), pattern);
+        return new BeanExchange(getCamelContext(), pattern);
     }
 
     public Consumer<BeanExchange> createConsumer(Processor processor) throws Exception {

Modified: activemq/camel/trunk/components/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiProducer.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiProducer.java (original)
+++ activemq/camel/trunk/components/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiProducer.java Mon May 12 08:18:52 2008
@@ -34,7 +34,7 @@
 
     public RmiProducer(RmiEndpoint endpoint) throws RemoteException, NotBoundException {
         super(endpoint);
-        BeanHolder holder = new RmiRegistryBean(endpoint.getContext(), endpoint.getName(), endpoint.getRegistry());
+        BeanHolder holder = new RmiRegistryBean(endpoint.getCamelContext(), endpoint.getName(), endpoint.getRegistry());
         beanProcessor = new BeanProcessor(holder);
         String method = endpoint.getMethod();
         if (method != null) {

Modified: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationConsumer.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationConsumer.java (original)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationConsumer.java Mon May 12 08:18:52 2008
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.spring.integration;
 
-import org.apache.camel.CamelExchangeException;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.Processor;
 import org.apache.camel.RuntimeCamelException;
@@ -26,7 +25,6 @@
 import org.springframework.integration.channel.ChannelRegistry;
 import org.springframework.integration.channel.MessageChannel;
 import org.springframework.integration.config.MessageBusParser;
-import org.springframework.integration.message.GenericMessage;
 
 /**
  * A consumer of exchanges for the Spring Integration
@@ -47,7 +45,7 @@
     public SpringIntegrationConsumer(SpringIntegrationEndpoint endpoint, Processor processor) {
         super(endpoint, processor);
         this.endpoint = endpoint;
-        context = (SpringCamelContext) endpoint.getContext();
+        context = (SpringCamelContext) endpoint.getCamelContext();
         if (context != null && endpoint.getMessageChannel() == null) {
             channelRegistry = (ChannelRegistry) context.getApplicationContext().getBean(MessageBusParser.MESSAGE_BUS_BEAN_NAME);
             inputChannelName = endpoint.getDefaultChannel();

Modified: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationEndpoint.java Mon May 12 08:18:52 2008
@@ -49,6 +49,11 @@
         messageChannel = channel;
     }
 
+    public SpringIntegrationEndpoint(String endpointUri, MessageChannel messageChannel) {
+        super(endpointUri);
+        this.messageChannel = messageChannel;
+    }
+
     public Producer<SpringIntegrationExchange> createProducer() throws Exception {
         return new SpringIntegrationProducer(this);
     }
@@ -62,7 +67,7 @@
     }
 
     public SpringIntegrationExchange createExchange(ExchangePattern pattern) {
-        return new SpringIntegrationExchange(getContext(), pattern);
+        return new SpringIntegrationExchange(getCamelContext(), pattern);
     }
 
     public void setInputChannel(String input) {

Modified: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationProducer.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationProducer.java (original)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationProducer.java Mon May 12 08:18:52 2008
@@ -47,7 +47,7 @@
     public SpringIntegrationProducer(SpringIntegrationEndpoint endpoint) {
         super(endpoint);
         this.endpoint = endpoint;
-        context = (SpringCamelContext) endpoint.getContext();
+        context = (SpringCamelContext) endpoint.getCamelContext();
         if (context != null && endpoint.getMessageChannel() == null) {
             outputChannelName = endpoint.getDefaultChannel();
             channelRegistry = (ChannelRegistry) context.getApplicationContext().getBean(MessageBusParser.MESSAGE_BUS_BEAN_NAME);

Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/ResourceBasedEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/ResourceBasedEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/ResourceBasedEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/ResourceBasedEndpoint.java Mon May 12 08:18:52 2008
@@ -42,6 +42,11 @@
         this.resourceUri = resourceUri;
     }
 
+    protected ResourceBasedEndpoint(String endpointUri, Processor processor, String resourceUri) {
+        super(endpointUri, processor);
+        this.resourceUri = resourceUri;
+    }
+
     public Resource getResource() {
         if (resource == null) {
             resource = getResourceLoader().getResource(resourceUri);

Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/event/EventEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/event/EventEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/event/EventEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/event/EventEndpoint.java Mon May 12 08:18:52 2008
@@ -28,6 +28,8 @@
 
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationEvent;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.beans.BeansException;
 
 /**
  * An <a href="http://activemq.apache.org/camel/event.html">Event Endpoint</a>
@@ -35,22 +37,25 @@
  * 
  * @version $Revision$
  */
-public class EventEndpoint extends DefaultEndpoint<Exchange> {
-    private final EventComponent component;
+public class EventEndpoint extends DefaultEndpoint<Exchange> implements ApplicationContextAware {
     private LoadBalancer loadBalancer;
+    private ApplicationContext applicationContext;
 
     public EventEndpoint(String endpointUri, EventComponent component) {
         super(endpointUri, component);
-        this.component = component;
+        this.applicationContext = component.getApplicationContext();
     }
 
-    @Override
-    public EventComponent getComponent() {
-        return component;
+    public EventEndpoint(String endpointUri) {
+        super(endpointUri);
+    }
+
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+        this.applicationContext = applicationContext;
     }
 
     public ApplicationContext getApplicationContext() {
-        return getComponent().getApplicationContext();
+        return applicationContext;
     }
 
     public boolean isSingleton() {
@@ -112,4 +117,5 @@
         }
         return event;
     }
+
 }

Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/test/TestEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/test/TestEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/test/TestEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/test/TestEndpoint.java Mon May 12 08:18:52 2008
@@ -46,6 +46,11 @@
         this.expectedMessageEndpoint = expectedMessageEndpoint;
     }
 
+    public TestEndpoint(String endpointUri, Endpoint expectedMessageEndpoint) {
+        super(endpointUri);
+        this.expectedMessageEndpoint = expectedMessageEndpoint;
+    }
+
     public void start() throws Exception {
         if (LOG.isDebugEnabled()) {
             LOG.debug("Consuming expected messages from: " + expectedMessageEndpoint);

Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java Mon May 12 08:18:52 2008
@@ -172,7 +172,7 @@
         //We will use the type convert to build the endpoint first
         Endpoint endpoint = getTypeConverter().convertTo(Endpoint.class, bean);
         if (endpoint != null) {
-            endpoint.setContext(this);
+            endpoint.setCamelContext(this);
             return endpoint;
         }
         Processor processor = new BeanProcessor(bean, this);

Modified: activemq/camel/trunk/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlEndpoint.java Mon May 12 08:18:52 2008
@@ -49,6 +49,12 @@
         this.query = query;
     }
 
+    public SqlEndpoint(String endpointUri, JdbcTemplate jdbcTemplate, String query) {
+        super(endpointUri);
+        this.jdbcTemplate = jdbcTemplate;
+        this.query = query;
+    }
+
     public Consumer<DefaultExchange> createConsumer(Processor arg0) throws Exception {
         throw new UnsupportedOperationException("Not yet implemented");
     }

Modified: activemq/camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java Mon May 12 08:18:52 2008
@@ -34,6 +34,11 @@
         this.uri = endpointUri;
     }
 
+    public StreamEndpoint(String endpointUri) {
+        super(endpointUri);
+        this.uri = endpointUri;
+    }
+
     public Consumer<Exchange> createConsumer(Processor processor) throws Exception {
         return new StreamConsumer(this, processor, uri);
     }

Modified: activemq/camel/trunk/components/camel-stringtemplate/src/main/java/org/apache/camel/component/stringtemplate/StringTemplateEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-stringtemplate/src/main/java/org/apache/camel/component/stringtemplate/StringTemplateEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-stringtemplate/src/main/java/org/apache/camel/component/stringtemplate/StringTemplateEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-stringtemplate/src/main/java/org/apache/camel/component/stringtemplate/StringTemplateEndpoint.java Mon May 12 08:18:52 2008
@@ -24,6 +24,7 @@
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.Message;
+import org.apache.camel.Processor;
 import org.apache.camel.component.ResourceBasedEndpoint;
 import org.apache.camel.converter.IOConverter;
 import org.apache.camel.util.ExchangeHelper;
@@ -32,11 +33,13 @@
  * @version $Revision$
  */
 public class StringTemplateEndpoint extends ResourceBasedEndpoint {
-    private final StringTemplateComponent component;
 
     public StringTemplateEndpoint(String uri, StringTemplateComponent component, String resourceUri, Map parameters) {
         super(uri, component, resourceUri, null);
-        this.component = component;
+    }
+
+    public StringTemplateEndpoint(String endpointUri, Processor processor, String resourceUri) {
+        super(endpointUri, processor, resourceUri);
     }
 
     public boolean isSingleton() {

Modified: activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component/uface/UFaceEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component/uface/UFaceEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component/uface/UFaceEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component/uface/UFaceEndpoint.java Mon May 12 08:18:52 2008
@@ -33,6 +33,10 @@
         super(uri, component);
     }
 
+    public UFaceEndpoint(String endpointUri) {
+        super(endpointUri);
+    }
+
     @Override
     protected List<Exchange> createExchangeList() {
         Realm realm = Realm.getDefault();

Modified: activemq/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java?rev=655516&r1=655515&r2=655516&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java Mon May 12 08:18:52 2008
@@ -54,6 +54,10 @@
         super(uri, component);
     }
 
+    public XmppEndpoint(String endpointUri) {
+        super(endpointUri);
+    }
+
     public Producer<XmppExchange> createProducer() throws Exception {
         if (room != null) {
             return createGroupChatProducer(room);
@@ -79,11 +83,11 @@
 
     @Override
     public XmppExchange createExchange(ExchangePattern pattern) {
-        return new XmppExchange(getContext(), pattern, getBinding());
+        return new XmppExchange(getCamelContext(), pattern, getBinding());
     }
 
     public XmppExchange createExchange(Message message) {
-        return new XmppExchange(getContext(), getExchangePattern(), getBinding(), message);
+        return new XmppExchange(getCamelContext(), getExchangePattern(), getBinding(), message);
     }
 
     // Properties



Mime
View raw message