[kepler-dev] Can we create ordinary java component with out using kepler source code?

Chad Berkley berkley at nceas.ucsb.edu
Tue Jun 30 08:33:46 PDT 2009


If you can execute the code on the command line, you can use the 
CommandLineExec actor to call it.  The problem with doing this is that 
your code will take inputs/create output outside of the normal workflow 
and you will have to deal with it in the workflow.  For example, if your 
code produces a textual table of data in a file, you will not be able to 
pass that data to other actors until you use a FileReader actor to read 
it in and one of the Tokenizer actors to turn the data into data tokens. 
  The easier way to do it is just to write an actor based wrapper for 
you code, especially if it's written in Java.

chad


Rajan Saminathan wrote:
> Dear Sir,
>  
>     I am not using kepler and ptolemy source code to create component. i 
> am creating component using java code. not using kepler or ptolemy 
> source code. Could i integrate that component into kepler with out using 
> kepler source code?  and Could i run that component in kepler execute 
> engine without calling any function from kepler or ptolemy.
> 
> -- 
> Thank You!
> 
> With Regards,
>         Rajan S.
> On 6/29/09, *Chad Berkley* <berkley at nceas.ucsb.edu 
> <mailto:berkley at nceas.ucsb.edu>> wrote:
> 
>     Hi Rajan,
> 
>     I'm not sure what you mean by ordinary java component.  Just a class
>     file?  A ptolemy (non-kepler) actor?  The answer to both of those
>     is, yes, you can use them in Kepler.  As Edward said, if you want to
>     use an existing java class in Kepler, you'd need to somehow wrap it
>     in a Kepler (or ptolemy) component so that it could be used in a
>     workflow.  If you mean a ptolemy actor, then we have lots of ptolemy
>     actors that work in Kepler.  In fact, most of the actors in Kepler
>     are regular ptolemy actors.  If you give me a few more details about
>     what you want to do, I can point you in the right direction.
> 
>     thanks,
>     chad
> 
> 
>     Edward A. Lee wrote:
> 
> 
> 
>         Rajan Saminathan wrote:
> 
>             Dear Sir,
> 
>             Can we create ordinary java component with out using kepler
>             source code?  Suppose it is possible  Can we
>             run that component in kepler.
> 
>             Please Note: I didn't use kepler source to create component.
>             can i run that component in kepler.
> 
>             -- 
>             Thank You!
> 
>             With Regards,
>                   Rajan S.
> 
> 
>         What would it mean to run the component in Kepler?
>         I can think of several alternatives:
> 
>         - Associate a port with each method of the class that the component
>          is an instance of.  Xiaojun Liu created an actor (very
>         experimental)
>          called ClassWrapper (in $PTII/ptolemy/actor/lib) that given a class
>          creates a wrapper with one port per method.
> 
>         - Execute a Runnable in a thread that doesn't interact with anything
>          else in Kepler. This would be easy to do in the PN domain, but why
>          do this?
> 
>         - Use Kepler to visually represent imperative code doing ordinary
>          method calls.  The "component" domain ($PTII/component) is a
>          (very rough) start at an attempt to do this. This has never been
>          finished in part because we really don't know what it means.
> 
>         - Wrap some service provided by some object in a Kepler actor
>          with input and output ports to provide data and get results.
>          This is easy to do (in fact, many actors are exactly such
>          wrappers). The Kepler web service actor is also an illustration
>          of this.
> 
>         Edward
> 
>         _______________________________________________
>         Kepler-dev mailing list
>         Kepler-dev at kepler-project.org <mailto:Kepler-dev at kepler-project.org>
>         http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
> 
> 
> 
> 
> -- 
> Thank You!
> 
> With Regards,
>         Rajan S.


More information about the Kepler-dev mailing list