You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by js...@apache.org on 2007/05/04 14:35:23 UTC
svn commit: r535210 - in /activemq/camel/trunk:
camel-script/src/main/java/org/apache/camel/builder/script/
camel-spring/src/main/java/org/apache/camel/spring/xml/
camel-spring/src/main/resources/org/apache/camel/spring/
Author: jstrachan
Date: Fri May 4 05:35:22 2007
New Revision: 535210
URL: http://svn.apache.org/viewvc?view=rev&rev=535210
Log:
added python helper support
Modified:
activemq/camel/trunk/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/CamelNamespaceHandler.java
activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd
Modified: activemq/camel/trunk/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java?view=diff&rev=535210&r1=535209&r2=535210
==============================================================================
--- activemq/camel/trunk/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java (original)
+++ activemq/camel/trunk/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java Fri May 4 05:35:22 2007
@@ -294,7 +294,52 @@
}
- // JRuby
+
+ // Python
+ //-------------------------------------------------------------------------
+
+ /**
+ * Creates a script builder for the Python script contents
+ *
+ * @param scriptText the script text to be evaluted
+ * @return the builder
+ */
+ public static ScriptBuilder python(String scriptText) {
+ return new ScriptBuilder("python", scriptText);
+ }
+
+ /**
+ * Creates a script builder for the Python script @{link Resource}
+ *
+ * @param scriptResource the resource used to load the script
+ * @return the builder
+ */
+ public static ScriptBuilder python(Resource scriptResource) {
+ return new ScriptBuilder("python", scriptResource);
+ }
+
+ /**
+ * Creates a script builder for the Python script @{link File}
+ *
+ * @param scriptFile the file used to load the script
+ * @return the builder
+ */
+ public static ScriptBuilder python(File scriptFile) {
+ return new ScriptBuilder("python", new FileSystemResource(scriptFile));
+ }
+
+ /**
+ * Creates a script builder for the Python script @{link URL}
+ *
+ * @param scriptURL the URL used to load the script
+ * @return the builder
+ */
+ public static ScriptBuilder python(URL scriptURL) {
+ return new ScriptBuilder("python", new UrlResource(scriptURL));
+ }
+
+
+ // Ruby/JRuby
//-------------------------------------------------------------------------
/**
Modified: activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/CamelNamespaceHandler.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/CamelNamespaceHandler.java?view=diff&rev=535210&r1=535209&r2=535210
==============================================================================
--- activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/CamelNamespaceHandler.java (original)
+++ activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/CamelNamespaceHandler.java Fri May 4 05:35:22 2007
@@ -83,6 +83,7 @@
registerScriptParser("groovy", "groovy");
registerScriptParser("ruby", "jruby");
registerScriptParser("javaScript", "js");
+ registerScriptParser("python", "python");
registerScriptParser("php", "php");
}
Modified: activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd?view=diff&rev=535210&r1=535209&r2=535210
==============================================================================
--- activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd (original)
+++ activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd Fri May 4 05:35:22 2007
@@ -149,6 +149,7 @@
<xs:element ref="c:javaScript"/>
<xs:element ref="c:groovy"/>
<xs:element ref="c:php"/>
+ <xs:element ref="c:python"/>
<xs:element ref="c:ruby"/>
</xs:choice>
</xs:complexType>
@@ -182,6 +183,7 @@
<xs:element name="javaScript" type="c:scriptType"/>
<xs:element name="groovy" type="c:scriptType"/>
+ <xs:element name="python" type="c:scriptType"/>
<xs:element name="php" type="c:scriptType"/>
<xs:element name="ruby" type="c:scriptType"/>