At 16:45 10.11.00 , you wrote:
>Hi...
>
>I need to upload a compiled class to my Orion application and then execute
>some methods of it. Anybody knows how can I do it?

upload the class file, instantiate a URLClassloader that points to the 
file's url, load the class using that classloader, do whatever you need 
using reflection (e.g. instantiate objects, call methods on them, whatever) 
and after that dump the classloader.

however as simple as that may be, are you aware of the security 
implications of this? if this is not just for playing around, you should 
read up on java security and classloading and then subclass URLClassLoader 
and implement a very restrictive getPermissions() method for the uploaded code.

before you do that be REALLY, REALLY sure you know what you are doing if 
this is for real world use!!!

other than that I don't see any difficulties in achieving what you described.

HTH,

robert

>[]s
>Guilherme Ceschiatti
>[EMAIL PROTECTED]
>

(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de


Reply via email to