16 Jul 22:58
Re: [groovy-user] rootloader scope
From: Jochen Theodorou <blackdrag@...>
Subject: Re: [groovy-user] rootloader scope
Newsgroups: gmane.comp.lang.groovy.user
Date: 2008-07-16 20:58:11 GMT
Subject: Re: [groovy-user] rootloader scope
Newsgroups: gmane.comp.lang.groovy.user
Date: 2008-07-16 20:58:11 GMT
Kallin Nagelberg schrieb:
> Thanks for the info blackdrag
>
> Well there are some utility methods in "myJar.jar" that I would like to
> use from a command line script.
>
> From what I can tell i have to either:
>
> 1) Always start a single script that loads all the libraries, and then
> evaluates the desired script, like
> groovy libloader thescriptIwanttorun
>
> 2) create a secondary script whenever I want to access something in my
> libraries, either inline or in a separate file.
>
> Both are easy, but somewhat roundabout.
> Can you suggest a more straightforward approach?
well, depends... if you do not need the classes in your own method
signatures, then just load them using the classloader...
loader.load("Foo").newInstance()
would load Foo and create a new instance of Foo.
If this scheme is not possible for you, then I am afraid you have to
either wait till the small grape project is ready, or spin off a
solution like 1 or 2 yourself
bye blackdrag
--
--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/
http://www.g2one.com/
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
RSS Feed