You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Teiva Harsanyi (JIRA)" <ji...@apache.org> on 2011/05/12 01:00:47 UTC
[jira] [Created] (CAMEL-3964) Script arguments
Script arguments
----------------
Key: CAMEL-3964
URL: https://issues.apache.org/jira/browse/CAMEL-3964
Project: Camel
Issue Type: Improvement
Components: camel-script
Affects Versions: 2.7.1
Reporter: Teiva Harsanyi
Priority: Minor
Fix For: 2.8.0
As I said here : http://fusesource.com/forums/thread.jspa?threadID=2946&tstart=0, the ScriptEngine class (http://download.oracle.com/javase/6/docs/api/javax/script/ScriptEngine.html) provides a put method which enable to add a Java object into the created script, thanks to the JSR-223. But Camel does not provide a "bridge" to this method.
So I propose to pass the arguments via the header map of the message.
Indeed, on client side, I created a Map<String, Object> which contains the future scripts arguments. Then I put this map into the header.
Next on the camel-script component, I check a particular key (a public static final attribute that I added) and if the value returned is a Map, I try to add the Map's objects with the engine.put(String, Object) method.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-3964) Script arguments
Posted by "Teiva Harsanyi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3964?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Teiva Harsanyi updated CAMEL-3964:
----------------------------------
Attachment: patch.txt
The patch I created
> Script arguments
> ----------------
>
> Key: CAMEL-3964
> URL: https://issues.apache.org/jira/browse/CAMEL-3964
> Project: Camel
> Issue Type: Improvement
> Components: camel-script
> Affects Versions: 2.7.1
> Reporter: Teiva Harsanyi
> Priority: Minor
> Labels: camel-script, jsr-223, script, scripting
> Fix For: 2.8.0
>
> Attachments: patch.txt
>
>
> As I said here : http://fusesource.com/forums/thread.jspa?threadID=2946&tstart=0, the ScriptEngine class (http://download.oracle.com/javase/6/docs/api/javax/script/ScriptEngine.html) provides a put method which enable to add a Java object into the created script, thanks to the JSR-223. But Camel does not provide a "bridge" to this method.
> So I propose to pass the arguments via the header map of the message.
> Indeed, on client side, I created a Map<String, Object> which contains the future scripts arguments. Then I put this map into the header.
> Next on the camel-script component, I check a particular key (a public static final attribute that I added) and if the value returned is a Map, I try to add the Map's objects with the engine.put(String, Object) method.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (CAMEL-3964) Script arguments
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3964?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-3964.
--------------------------------
Resolution: Fixed
Thanks for the patch.
> Script arguments
> ----------------
>
> Key: CAMEL-3964
> URL: https://issues.apache.org/jira/browse/CAMEL-3964
> Project: Camel
> Issue Type: Improvement
> Components: camel-script
> Affects Versions: 2.7.1
> Reporter: Teiva Harsanyi
> Assignee: Claus Ibsen
> Priority: Minor
> Labels: camel-script, jsr-223, script, scripting
> Fix For: 2.8.0
>
> Attachments: patch.txt
>
>
> As I said here : http://fusesource.com/forums/thread.jspa?threadID=2946&tstart=0, the ScriptEngine class (http://download.oracle.com/javase/6/docs/api/javax/script/ScriptEngine.html) provides a put method which enable to add a Java object into the created script, thanks to the JSR-223. But Camel does not provide a "bridge" to this method.
> So I propose to pass the arguments via the header map of the message.
> Indeed, on client side, I created a Map<String, Object> which contains the future scripts arguments. Then I put this map into the header.
> Next on the camel-script component, I check a particular key (a public static final attribute that I added) and if the value returned is a Map, I try to add the Map's objects with the engine.put(String, Object) method.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (CAMEL-3964) Script arguments
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3964?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen reassigned CAMEL-3964:
----------------------------------
Assignee: Claus Ibsen
> Script arguments
> ----------------
>
> Key: CAMEL-3964
> URL: https://issues.apache.org/jira/browse/CAMEL-3964
> Project: Camel
> Issue Type: Improvement
> Components: camel-script
> Affects Versions: 2.7.1
> Reporter: Teiva Harsanyi
> Assignee: Claus Ibsen
> Priority: Minor
> Labels: camel-script, jsr-223, script, scripting
> Fix For: 2.8.0
>
> Attachments: patch.txt
>
>
> As I said here : http://fusesource.com/forums/thread.jspa?threadID=2946&tstart=0, the ScriptEngine class (http://download.oracle.com/javase/6/docs/api/javax/script/ScriptEngine.html) provides a put method which enable to add a Java object into the created script, thanks to the JSR-223. But Camel does not provide a "bridge" to this method.
> So I propose to pass the arguments via the header map of the message.
> Indeed, on client side, I created a Map<String, Object> which contains the future scripts arguments. Then I put this map into the header.
> Next on the camel-script component, I check a particular key (a public static final attribute that I added) and if the value returned is a Map, I try to add the Map's objects with the engine.put(String, Object) method.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-3964) Script arguments
Posted by "Teiva Harsanyi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-3964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13032160#comment-13032160 ]
Teiva Harsanyi commented on CAMEL-3964:
---------------------------------------
I also try to add some test methods, especially to test the robustness of the method.
> Script arguments
> ----------------
>
> Key: CAMEL-3964
> URL: https://issues.apache.org/jira/browse/CAMEL-3964
> Project: Camel
> Issue Type: Improvement
> Components: camel-script
> Affects Versions: 2.7.1
> Reporter: Teiva Harsanyi
> Priority: Minor
> Labels: camel-script, jsr-223, script, scripting
> Fix For: 2.8.0
>
> Attachments: patch.txt
>
>
> As I said here : http://fusesource.com/forums/thread.jspa?threadID=2946&tstart=0, the ScriptEngine class (http://download.oracle.com/javase/6/docs/api/javax/script/ScriptEngine.html) provides a put method which enable to add a Java object into the created script, thanks to the JSR-223. But Camel does not provide a "bridge" to this method.
> So I propose to pass the arguments via the header map of the message.
> Indeed, on client side, I created a Map<String, Object> which contains the future scripts arguments. Then I put this map into the header.
> Next on the camel-script component, I check a particular key (a public static final attribute that I added) and if the value returned is a Map, I try to add the Map's objects with the engine.put(String, Object) method.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira