[kepler-dev] build a custom actor

dejw dejw at man.poznan.pl
Fri Aug 8 01:13:49 PDT 2008


Hi

so my case is such one (I think such case will be very rare but it could 
happened):

actor will use the whole structure which should be visible in custom 
class loader:

it could be a subdir in the kepler/lib/jar

called for example:

vine (after our project)
  |
  |_____ lib (different jars)
  |
  |_____ classes (different thing not only classes but also some 
porperties, resource bundles, text file should be able to get as a 
resource from class loader)
  |
  |_____ projects
                   |
                   |_____project1
                   |              |_____libs (jars)
                   |
                   |_____project2
                                 |
                                 |______libs (jars)
                  
As you can see it is quite complicated :)

and the case is:

 - you could enable to set property if such subdir will be just added to 
common kepler class loader or will be a different separated class loader

 - only core kepler jars should be part of kepler common classloader 
(maybe just like shared/lib in tomcat ?) all other components should be 
separated in custom class loaders to prevent jars conflicts as much as 
possible

 - as you can see in my example - there is more subdirs with jars and 
now it should be possible to point out which dirs with jars are part of 
the custom class loader - only the first lib and classes or also these 
located deeper (in this project there is embedded custom class loader to 
swith between projects) - it could be some property file for given class 
loader? (I could set there that only vine/lib and vine/classes should be 
part of the class loader for example)

- if such property file doesn't exist then you could add all jars found 
in the subdir in the whole structure and all classes directories also

What do you think about such thing?

I know it looks a little complicated but if you manage to do such thing 
then later anything should be possible to make it part of the class 
loader of the given actor.


Other thing:

It should be possible to get information from kepler what is exact 
physical location of the class loader in the file system - some property?
So if I write actor java class I could get such information from 
somewhere in the code.

Dawid

Matt Jones wrote:
> Hi Dawid,
>
> This is one of our top priorities on Kepler Core right now -- getting 
> the actor tree separated from the main kernel of kepler and allowing 
> Kepler actor bundles (currently KAR files) to load jars and other 
> resources dynamically in their own namespace using an independent 
> classloader.  The Kepler framework group is taking this on, and we 
> welcome use cases, requirements, wishlists, etc, as well as any 
> contributions you might be willing to make.  We have a requirements 
> document for this functionality that should be released soon, so your 
> feedback on that document when it comes out would be appreciated.
>
> Matt
>
> On Thu, Aug 7, 2008 at 11:09 AM, Dawid Szejnfeld <dejw at man.poznan.pl 
> <mailto:dejw at man.poznan.pl>> wrote:
>
>     Hi,
>
>     so if I will have conflicts (I will do some tests) then what
>     options do I have in kepler? I understand that such custom class
>     loading should be carry on by kepler itself?
>
>     So the only way will be do some web service around my stuff and
>     use it in this way to separate set of jars for example ?
>
>     Or there is something more I can do in kepler to handle this
>     somehow? Write some custom class loader which will be used in my
>     actor? but then I will need some base information where my jars
>     and classes are? kepler/lib/jar/mystuff - can I get such info
>     somehow inside the actor ? Is there some property I can get from
>     kepler inside the actor about location of the jar repository on
>     the local storage system?
>
>     Dawid
>
>
>     Dan Higgins wrote:
>
>         Hi David,
>           If your jars conflict with other exisiting jars, there may
>         be a problem with adding them to the kar files as I suggested.
>         This is because the jars inside the kars are just dynamically
>         added to the classpath in the current code (unless that has
>         been changed in the last 6 months!)  Kepler will thus use the
>         first class it finds. A custom classloader is needed to handle
>         this versioning problem and that was not yet in Kepler the
>         last time I checked.
>
>         Dan Higgins
>
>         Dawid Szejnfeld wrote:
>
>             Hi,
>
>             I can't put the jars out there because they could do some
>             conflicts with some existing ones (I have some other
>             versions for example). I read that KAR's can contain jars
>             and do some custom class loading - it is the only solution
>             here. But I can't find any tutorial how to do it, how to
>             build it and so on. I found also something about KSW files
>             - but I understand it is some deprecated stuff ?
>
>             Dawid
>
>             Sean Riddle wrote:
>
>                 Putting your Jar files into kepler/lib/jar (or any
>                 level below that) will cause them to be put on the
>                 runtime classpath, I believe. Ideally, you would use
>                 KAR files to bundle up actors with stuff they need,
>                 and then you could import that in another Kepler
>                 installation; I've never actually tried it myself,
>                 though, so someone else could probably speak on that
>                 better.
>
>                 - Sean
>
>
>                 On Aug 7, 2008, at 4:39 AM, dejw wrote:
>
>                     Hi,
>
>                     I want to build a custom actor for Kepler, I saw
>                     the HelloWorld example and it is clear for me,
>                     that's fine but...
>
>                     I want to create quite "big" actor with many jars
>                     included which are not a part of kepler right now
>                     - the question how to do it, where should I put my
>                     custom jars?
>
>                     How can I later exchange this actor with other
>                     kepler instances? KSW files? If yes is out there
>                     any tutorial how to prepare KSW file with right
>                     stuff inside?
>
>                     Can I later upload such actor (ksw?) to repository
>                     and download over the wire in another kepler
>                     instance and use?
>
>                     My actor with the jars included may have from
>                     about 30 MB even up to 100 MB ;)
>
>                     Regards,
>                     Dawid Szejnfeld
>                     _______________________________________________
>                     Kepler-dev mailing list
>                     Kepler-dev at ecoinformatics.org
>                     <mailto:Kepler-dev at ecoinformatics.org>
>                     http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
>
>
>
>             _______________________________________________
>             Kepler-dev mailing list
>             Kepler-dev at ecoinformatics.org
>             <mailto:Kepler-dev at ecoinformatics.org>
>             http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
>
>
>     _______________________________________________
>     Kepler-dev mailing list
>     Kepler-dev at ecoinformatics.org <mailto:Kepler-dev at ecoinformatics.org>
>     http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
>
>
>
>
> -- 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Matthew B. Jones
> Director of Informatics Research and Development
> National Center for Ecological Analysis and Synthesis (NCEAS)
> UC Santa Barbara
> jones at nceas.ucsb.edu <mailto:jones at nceas.ucsb.edu> Ph: 1-907-523-1960
> http://www.nceas.ucsb.edu/ecoinfo
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercury.nceas.ucsb.edu/ecoinformatics/pipermail/kepler-dev/attachments/20080808/dfa91607/attachment-0001.html>


More information about the Kepler-dev mailing list