Restricting access to classpath and object instances for the execution of a script...

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

Restricting access to classpath and object instances for the execution of a script...

Martin Deinhofer
Hello!

I would like to use Beanshell for writing test-scripts for my
application.
However I would like to hide my normal applicational Java classes and
only provide a certain set of isolated objects to the scripting
environment.
Do you have any idea how to achieve this?

I could imagine that

Interpreter.setClassLoader(ClassLoader)

would achieve this, but I am not sure if there are other ways for a
script writer to load classes and access instances of my objects.
For example through
ClassLoader.getSystemClassLoader().loadClass(String ...)

Is there any documentation about this or even an API to control the
access?

Thanx in advance
Martin Deinhofer

MARTIN DEINHOFER
SOFTWARE DEVELOPMENT
- - - - - - - - - - - - - -
MEDIORNET GMBH  |  HIETZINGER KAI 67  |  A-1130 VIENNA  |  AUSTRIA
TEL +43 1 585 7052  |  FAX +43 1 585 7050
 
WWW.MEDIORNET.COM | mailto:[hidden email]

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

Re: Restricting access to classpath and objectinstances for the execution of a script...

David Lee
I would love to have the ability to list the package names explicitly which
are "visible" ..
Perhaps the classloader is the trick ...  but you'd have to write the
classloader ...
Maybe a sort of delegated classloader, and one that doesnt let you change it
afterwards (like the unix chroot ...)





----- Original Message -----
From: "Martin Deinhofer" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, September 05, 2006 2:02 PM
Subject: [Beanshell-users] Restricting access to classpath and
objectinstances for the execution of a script...


> Hello!
>
> I would like to use Beanshell for writing test-scripts for my
> application.
> However I would like to hide my normal applicational Java classes and
> only provide a certain set of isolated objects to the scripting
> environment.
> Do you have any idea how to achieve this?
>
> I could imagine that
>
> Interpreter.setClassLoader(ClassLoader)
>
> would achieve this, but I am not sure if there are other ways for a
> script writer to load classes and access instances of my objects.
> For example through
> ClassLoader.getSystemClassLoader().loadClass(String ...)
>
> Is there any documentation about this or even an API to control the
> access?
>
> Thanx in advance
> Martin Deinhofer
>
> MARTIN DEINHOFER
> SOFTWARE DEVELOPMENT
> - - - - - - - - - - - - - -
> MEDIORNET GMBH  |  HIETZINGER KAI 67  |  A-1130 VIENNA  |  AUSTRIA
> TEL +43 1 585 7052  |  FAX +43 1 585 7050
>
> WWW.MEDIORNET.COM | mailto:[hidden email]
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Beanshell-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/beanshell-users
>


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users