[groovy-dev] Extending InteractiveShell

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[groovy-dev] Extending InteractiveShell

graemer
Ok I'm trying to extend InteractiveShell so that it can be used with
Grails. What I've done is create a class that bootstraps the Grails
environment then calls InteractiveShell (rather than extend it).

The problem is that I need to set a custom parent class loader for the
GroovyShell instance used internally by InteractiveShell and there
appears to be no way to do this :-(

I've attempted to put the classes in the binding and this allows me to
invoke static methods but I can't create new instances (odd?)

Any suggestions?

Cheers
Graeme

PS I'm going to be doing the same thing with groovy.ui.Console so i'm
likely to encounter similar issues

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

RE: [groovy-dev] Extending InteractiveShell

Dierk König
if you start the shell via the 'groovy' command (the latest workaround
for the broken shell) you should have a RootLoader available, that
may be helpful...

cheers
Mittie

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]On Behalf
> Of Graeme Rocher
> Sent: Freitag, 2. Juni 2006 18:42
> To: [hidden email]
> Subject: [groovy-dev] Extending InteractiveShell
>
>
> Ok I'm trying to extend InteractiveShell so that it can be used with
> Grails. What I've done is create a class that bootstraps the Grails
> environment then calls InteractiveShell (rather than extend it).
>
> The problem is that I need to set a custom parent class loader for the
> GroovyShell instance used internally by InteractiveShell and there
> appears to be no way to do this :-(
>
> I've attempted to put the classes in the binding and this allows me to
> invoke static methods but I can't create new instances (odd?)
>
> Any suggestions?
>
> Cheers
> Graeme
>
> PS I'm going to be doing the same thing with groovy.ui.Console so i'm
> likely to encounter similar issues
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: [groovy-dev] Extending InteractiveShell

Jochen Theodorou
In reply to this post by graemer
Graeme Rocher schrieb:
> Ok I'm trying to extend InteractiveShell so that it can be used with
> Grails. What I've done is create a class that bootstraps the Grails
> environment then calls InteractiveShell (rather than extend it).
>
> The problem is that I need to set a custom parent class loader for the
> GroovyShell instance used internally by InteractiveShell and there
> appears to be no way to do this :-(

it is easy to add such a contructor..

[...]
> Any suggestions?

there is also the problem that InteractiveShell doesn't support
additional commands, most of the methods are private.. to say it short:
it is designed to be used as is, atm. Define wahta you want to be able
to do with it and then we modify the design in that way - or maybe we
write a new shell

bye blackdrag

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email