You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by Aaron Mulder <am...@alumni.princeton.edu> on 2008/03/05 03:31:57 UTC

Documentation Request: Scripting JBI Component

Can someone look at the servicemix-script page on the Wiki?  I have a
few questions and I think it could be enhanced a bit.

http://servicemix.apache.org/servicemix-script.html

1) According to the note at the bottom, it supports only InOnly, but
the example right above that uses InOut.  Huh?
2) Can state be maintained like in the old Scripting lightweight
component (see the discussion at
http://servicemix.apache.org/groovy.html)?
3) The second-to-last bullet on the page saying you must use the
Spring Bean -- I'm not sure what that means (which Spring Bean and why
is the superclass relevant?)
4) In the case of a simple script, is it possible to put the script
inline in the xbean.xml instead of as a separate file?  The examples
for the old lightweight scripting component seemed to do that.

Thanks,
       Aaron

Re: Documentation Request: Scripting JBI Component

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
All great changes, thanks!

Aaron

On Wed, Mar 5, 2008 at 4:23 AM, Guillaume Nodet <gn...@gmail.com> wrote:
> On Wed, Mar 5, 2008 at 3:31 AM, Aaron Mulder
>  <am...@alumni.princeton.edu> wrote:
>  > Can someone look at the servicemix-script page on the Wiki?  I have a
>  >  few questions and I think it could be enhanced a bit.
>  >
>  >  http://servicemix.apache.org/servicemix-script.html
>  >
>  >  1) According to the note at the bottom, it supports only InOnly, but
>  >  the example right above that uses InOut.  Huh?
>
>  The note states that you can not *send* InOut exchanges.  I think it can now
>  be easily improved by leveraging some helper classes that have been written
>  after that.
>
>
>  >  2) Can state be maintained like in the old Scripting lightweight
>  >  component (see the discussion at
>  >  http://servicemix.apache.org/groovy.html)?
>
>  So the concept is a bit different that the lightweight component in
>  that the script
>  implements a class and a single instance is used to process all the
>  requests.  So
>  it has to be written in a threadsafe way, as if a servlet.   If you
>  want to maintain
>  some state, just store it in a property of the class.  I've just added a note.
>
>
>  >  3) The second-to-last bullet on the page saying you must use the
>  >  Spring Bean -- I'm not sure what that means (which Spring Bean and why
>  >  is the superclass relevant?)
>
>  I agree this is a bit cryptic...  I've tried to enhance it a bit, just
>  let me know if this
>  is more clear.
>
>
>  >  4) In the case of a simple script, is it possible to put the script
>  >  inline in the xbean.xml instead of as a separate file?  The examples
>  >  for the old lightweight scripting component seemed to do that.
>
>  Sure.  Take a look at the spring documentation:
>   http://static.springframework.org/spring/docs/2.0.x/reference/dynamic-language.html
>  I've added a small example to the doc.
>
>  >
>  >  Thanks,
>  >        Aaron
>  >
>
>
>
>  --
>  Cheers,
>  Guillaume Nodet
>  ------------------------
>  Blog: http://gnodet.blogspot.com/
>
>

Re: Documentation Request: Scripting JBI Component

Posted by Guillaume Nodet <gn...@gmail.com>.
Btw, I've just created and fixed SM-1261, so you will now be able to create
and send any exchanges from the script.

On Wed, Mar 5, 2008 at 10:23 AM, Guillaume Nodet <gn...@gmail.com> wrote:
> On Wed, Mar 5, 2008 at 3:31 AM, Aaron Mulder
>  <am...@alumni.princeton.edu> wrote:
>  > Can someone look at the servicemix-script page on the Wiki?  I have a
>  >  few questions and I think it could be enhanced a bit.
>  >
>  >  http://servicemix.apache.org/servicemix-script.html
>  >
>  >  1) According to the note at the bottom, it supports only InOnly, but
>  >  the example right above that uses InOut.  Huh?
>
>  The note states that you can not *send* InOut exchanges.  I think it can now
>  be easily improved by leveraging some helper classes that have been written
>  after that.
>
>
>  >  2) Can state be maintained like in the old Scripting lightweight
>  >  component (see the discussion at
>  >  http://servicemix.apache.org/groovy.html)?
>
>  So the concept is a bit different that the lightweight component in
>  that the script
>  implements a class and a single instance is used to process all the
>  requests.  So
>  it has to be written in a threadsafe way, as if a servlet.   If you
>  want to maintain
>  some state, just store it in a property of the class.  I've just added a note.
>
>
>  >  3) The second-to-last bullet on the page saying you must use the
>  >  Spring Bean -- I'm not sure what that means (which Spring Bean and why
>  >  is the superclass relevant?)
>
>  I agree this is a bit cryptic...  I've tried to enhance it a bit, just
>  let me know if this
>  is more clear.
>
>
>  >  4) In the case of a simple script, is it possible to put the script
>  >  inline in the xbean.xml instead of as a separate file?  The examples
>  >  for the old lightweight scripting component seemed to do that.
>
>  Sure.  Take a look at the spring documentation:
>   http://static.springframework.org/spring/docs/2.0.x/reference/dynamic-language.html
>  I've added a small example to the doc.
>
>  >
>  >  Thanks,
>  >        Aaron
>  >
>
>
>
>  --
>  Cheers,
>  Guillaume Nodet
>  ------------------------
>  Blog: http://gnodet.blogspot.com/
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Re: Documentation Request: Scripting JBI Component

Posted by Guillaume Nodet <gn...@gmail.com>.
On Wed, Mar 5, 2008 at 3:31 AM, Aaron Mulder
<am...@alumni.princeton.edu> wrote:
> Can someone look at the servicemix-script page on the Wiki?  I have a
>  few questions and I think it could be enhanced a bit.
>
>  http://servicemix.apache.org/servicemix-script.html
>
>  1) According to the note at the bottom, it supports only InOnly, but
>  the example right above that uses InOut.  Huh?

The note states that you can not *send* InOut exchanges.  I think it can now
be easily improved by leveraging some helper classes that have been written
after that.

>  2) Can state be maintained like in the old Scripting lightweight
>  component (see the discussion at
>  http://servicemix.apache.org/groovy.html)?

So the concept is a bit different that the lightweight component in
that the script
implements a class and a single instance is used to process all the
requests.  So
it has to be written in a threadsafe way, as if a servlet.   If you
want to maintain
some state, just store it in a property of the class.  I've just added a note.

>  3) The second-to-last bullet on the page saying you must use the
>  Spring Bean -- I'm not sure what that means (which Spring Bean and why
>  is the superclass relevant?)

I agree this is a bit cryptic...  I've tried to enhance it a bit, just
let me know if this
is more clear.

>  4) In the case of a simple script, is it possible to put the script
>  inline in the xbean.xml instead of as a separate file?  The examples
>  for the old lightweight scripting component seemed to do that.

Sure.  Take a look at the spring documentation:
  http://static.springframework.org/spring/docs/2.0.x/reference/dynamic-language.html
I've added a small example to the doc.

>
>  Thanks,
>        Aaron
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/