You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2008/11/14 16:31:19 UTC

svn commit: r714035 - in /activemq/camel/trunk/components: camel-jms/src/main/java/org/apache/camel/component/jms/ camel-script/src/main/java/org/apache/camel/builder/script/ camel-script/src/test/java/org/apache/camel/builder/script/ camel-stream/src/...

Author: janstey
Date: Fri Nov 14 07:31:18 2008
New Revision: 714035

URL: http://svn.apache.org/viewvc?rev=714035&view=rev
Log:
CAMEL-1061 - More removals. Almost done - honest

Removed:
    activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessageJMSPropertyAccessException.java
    activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessagePropertyAccessException.java
    activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessagePropertyNamesAccessException.java
    activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/RuntimeJmsException.java
    activemq/camel/trunk/components/camel-script/src/main/java/org/apache/camel/builder/script/BeanShell.java
    activemq/camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamMessage.java
Modified:
    activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
    activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
    activemq/camel/trunk/components/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java
    activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/BeanShellScriptRouteTest.java
    activemq/camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java?rev=714035&r1=714034&r2=714035&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java Fri Nov 14 07:31:18 2008
@@ -101,7 +101,7 @@
                 return null;
             }
         } catch (JMSException e) {
-            throw new RuntimeJmsException("Failed to extract body due to: " + e + ". Message: " + message, e);
+            throw new RuntimeCamelException("Failed to extract body due to: " + e + ". Message: " + message, e);
         }
     }
 
@@ -124,14 +124,14 @@
                 // TODO this works around a bug in the ActiveMQ property handling
                 map.put("JMSXGroupID", jmsMessage.getStringProperty("JMSXGroupID"));
             } catch (JMSException e) {
-                throw new MessageJMSPropertyAccessException(e);
+                throw new RuntimeCamelException(e);
             }
 
             Enumeration names;
             try {
                 names = jmsMessage.getPropertyNames();
             } catch (JMSException e) {
-                throw new MessagePropertyNamesAccessException(e);
+                throw new RuntimeCamelException(e);
             }
             while (names.hasMoreElements()) {
                 String name = names.nextElement().toString();
@@ -147,7 +147,7 @@
                     String key = JmsBinding.decodeFromSafeJmsHeaderName(name);
                     map.put(key, value);
                 } catch (JMSException e) {
-                    throw new MessagePropertyAccessException(name, e);
+                    throw new RuntimeCamelException(name, e);
                 }
             }
         }

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java?rev=714035&r1=714034&r2=714035&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java Fri Nov 14 07:31:18 2008
@@ -26,6 +26,7 @@
 import javax.jms.Topic;
 
 import org.apache.camel.Exchange;
+import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.impl.DefaultMessage;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -121,7 +122,7 @@
             try {
                 answer = jmsMessage.getObjectProperty(name);
             } catch (JMSException e) {
-                throw new MessagePropertyAccessException(name, e);
+                throw new RuntimeCamelException(name, e);
             }
         }
         if (answer == null) {

Modified: activemq/camel/trunk/components/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java?rev=714035&r1=714034&r2=714035&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java (original)
+++ activemq/camel/trunk/components/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java Fri Nov 14 07:31:18 2008
@@ -116,7 +116,7 @@
      * Creates a script builder for the named language and script contents
      *
      * @param language the language to use for the script
-     * @param scriptText the script text to be evaluted
+     * @param scriptText the script text to be evaluated
      * @return the builder
      */
     public static ScriptBuilder script(String language, String scriptText) {
@@ -156,60 +156,13 @@
         return new ScriptBuilder(language, new UrlResource(scriptURL));
     }
 
-    // Beanshell
-    // -------------------------------------------------------------------------
-
-    /**
-     * Creates a script builder for the BeanShell script contents
-     *
-     * @param scriptText the script text to be evaluted
-     * @return the builder
-     * @deprecated will be removed in Camel 2.0
-     */
-    public static ScriptBuilder beanShell(String scriptText) {
-        return new ScriptBuilder("beanshell", scriptText);
-    }
-
-    /**
-     * Creates a script builder for the BeanShell script {@link Resource}
-     *
-     * @param scriptResource the resource used to load the script
-     * @return the builder
-     * @deprecated will be removed in Camel 2.0
-     */
-    public static ScriptBuilder beanShell(Resource scriptResource) {
-        return new ScriptBuilder("beanshell", scriptResource);
-    }
-
-    /**
-     * Creates a script builder for the BeanShell script {@link File}
-     *
-     * @param scriptFile the file used to load the script
-     * @return the builder
-     * @deprecated will be removed in Camel 2.0
-     */
-    public static ScriptBuilder beanShell(File scriptFile) {
-        return new ScriptBuilder("beanshell", new FileSystemResource(scriptFile));
-    }
-
-    /**
-     * Creates a script builder for the BeanShell script {@link URL}
-     *
-     * @param scriptURL the URL used to load the script
-     * @return the builder
-     * @deprecated will be removed in Camel 2.0
-     */
-    public static ScriptBuilder beanShell(URL scriptURL) {
-        return new ScriptBuilder("beanshell", new UrlResource(scriptURL));
-    }
-
     // Groovy
     // -------------------------------------------------------------------------
 
     /**
      * Creates a script builder for the groovy script contents
      *
-     * @param scriptText the script text to be evaluted
+     * @param scriptText the script text to be evaluated
      * @return the builder
      */
     public static ScriptBuilder groovy(String scriptText) {
@@ -252,7 +205,7 @@
     /**
      * Creates a script builder for the JavaScript/ECMAScript script contents
      *
-     * @param scriptText the script text to be evaluted
+     * @param scriptText the script text to be evaluated
      * @return the builder
      */
     public static ScriptBuilder javaScript(String scriptText) {
@@ -296,7 +249,7 @@
     /**
      * Creates a script builder for the PHP script contents
      *
-     * @param scriptText the script text to be evaluted
+     * @param scriptText the script text to be evaluated
      * @return the builder
      */
     public static ScriptBuilder php(String scriptText) {
@@ -339,7 +292,7 @@
     /**
      * Creates a script builder for the Python script contents
      *
-     * @param scriptText the script text to be evaluted
+     * @param scriptText the script text to be evaluated
      * @return the builder
      */
     public static ScriptBuilder python(String scriptText) {
@@ -382,7 +335,7 @@
     /**
      * Creates a script builder for the Ruby/JRuby script contents
      *
-     * @param scriptText the script text to be evaluted
+     * @param scriptText the script text to be evaluated
      * @return the builder
      */
     public static ScriptBuilder ruby(String scriptText) {

Modified: activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/BeanShellScriptRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/BeanShellScriptRouteTest.java?rev=714035&r1=714034&r2=714035&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/BeanShellScriptRouteTest.java (original)
+++ activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/BeanShellScriptRouteTest.java Fri Nov 14 07:31:18 2008
@@ -22,7 +22,7 @@
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.builder.RouteBuilder;
 
-import static org.apache.camel.builder.script.ScriptBuilder.beanShell;
+import static org.apache.camel.builder.script.ScriptBuilder.script;;
 
 
 /**
@@ -56,7 +56,7 @@
         return new RouteBuilder() {
             public void configure() throws Exception {
                 from("direct:start").choice().
-                        when(beanShell("request.headers['foo'] = 'bar'")).to("mock:result")
+                        when(script("beanshell", "request.headers['foo'] = 'bar'")).to("mock:result")
                         .otherwise().to("mock:unmatched");
             }
         };

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=714035&r1=714034&r2=714035&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 Fri Nov 14 07:31:18 2008
@@ -62,26 +62,12 @@
 
     public String getFile() {
         return file;
-    }
-
-    /**
-     * @deprecated use camel-file component. Will be removed in Camel 2.0
-     */
-    public void setFile(String file) {
-        this.file = file;
-    }
-
+    }   
+    
     public String getUrl() {
         return url;
     }
 
-    /**
-     * @deprecated use camel-jetty or camel-http component. Will be removed in Camel 2.0
-     */
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
     public long getDelay() {
         return delay;
     }