Error accessing public members in Applet

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

Error accessing public members in Applet

dh254
Greetings,
I get a ReflectPermission error when trying to access public members of
an object
via the interpreter when running in an Applet -- I've searched the docs
and can't seem
to find whether this is expected behavior (and if so, why). Any thoughts
would be much
appreciated..
Thnx, -daniel




_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

Interface Classes

Nadia Boukhelifa
Hello,

I would like to know if it is possible to use BeanShell to implement
methods of my own Interface class, dynamically?

Many thanks

N.


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: Interface Classes

webdel@libero.it
Hi, i use this script:

public static Object implementsInterface(URLClassLoader ucl, String[]
className, MethodInvoker methodInvoker) throws ClassNotFoundException{
        Class[] cls = new Class[className.length];
        for (int i=0;i<=cls.length-1;i++){
            cls[i]=Class.forName(className[i], false, ucl);
        }
        Object o = Proxy.newProxyInstance(ucl,cls,new
MethodInvocationHandler(methodInvoker));
        return o;
    }
   
    private static class MethodInvocationHandler implements
java.lang.reflect.InvocationHandler{
        MethodInvoker methodInvoker=null;
        public MethodInvocationHandler(MethodInvoker methodInvoker){
            this.methodInvoker=methodInvoker;
        }
       
        public Object invoke(Object proxy, java.lang.reflect.Method
method, Object[] args) throws Throwable{
         
        }
    }

Best regards
Danilo Limatola


Nadia Boukhelifa ha scritto:

> Hello,
>
> I would like to know if it is possible to use BeanShell to implement
> methods of my own Interface class, dynamically?
>
> Many thanks
>
> N.
>
>
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Interface Classes

Furash Gary
In reply to this post by Nadia Boukhelifa
Danilo, do you have an example of how to use this "in action"?  This
stuff you've put together looks like a utility that you use in a script
to implement an interface.

G

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of
[hidden email]
Sent: Monday, June 26, 2006 12:35 AM
To: Nadia Boukhelifa
Cc: [hidden email]
Subject: Re: [Beanshell-users] Interface Classes

Hi, i use this script:

public static Object implementsInterface(URLClassLoader ucl, String[]
className, MethodInvoker methodInvoker) throws ClassNotFoundException{
        Class[] cls = new Class[className.length];
        for (int i=0;i<=cls.length-1;i++){
            cls[i]=Class.forName(className[i], false, ucl);
        }
        Object o = Proxy.newProxyInstance(ucl,cls,new
MethodInvocationHandler(methodInvoker));
        return o;
    }
   
    private static class MethodInvocationHandler implements
java.lang.reflect.InvocationHandler{
        MethodInvoker methodInvoker=null;
        public MethodInvocationHandler(MethodInvoker methodInvoker){
            this.methodInvoker=methodInvoker;
        }
       
        public Object invoke(Object proxy, java.lang.reflect.Method
method, Object[] args) throws Throwable{
         
        }
    }

Best regards
Danilo Limatola


Nadia Boukhelifa ha scritto:

> Hello,
>
> I would like to know if it is possible to use BeanShell to implement
> methods of my own Interface class, dynamically?
>
> Many thanks
>
> N.
>
>
> 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=1216
> 42 _______________________________________________
> 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

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: Interface Classes

webdel@libero.it
Hi Gary,
try this code
                java.net.URL[] urls = new java.net.URL[1];
                urls[0] = new File("your jar file").toURL();
                URLClassLoader ucl = URLClassLoader.newInstance(urls)

        cls[0]=Class.forName("yourinterface", false, ucl);

        Proxy.newProxyInstance(ucl,cls,new MethodInvocationHandler(){
        public Object invoke(Object proxy, java.lang.reflect.Method method, Object[] args) throws Throwable{
                //HERE METHOD TO IMPLEMENTS
                         //es. if (method.getName().equals("MethodToImpl")){ ...... todo

        }
        });


bye
Danilo


Furash Gary ha scritto:

> Danilo, do you have an example of how to use this "in action"?  This
> stuff you've put together looks like a utility that you use in a script
> to implement an interface.
>
> G
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of
> [hidden email]
> Sent: Monday, June 26, 2006 12:35 AM
> To: Nadia Boukhelifa
> Cc: [hidden email]
> Subject: Re: [Beanshell-users] Interface Classes
>
> Hi, i use this script:
>
> public static Object implementsInterface(URLClassLoader ucl, String[]
> className, MethodInvoker methodInvoker) throws ClassNotFoundException{
>         Class[] cls = new Class[className.length];
>         for (int i=0;i<=cls.length-1;i++){
>             cls[i]=Class.forName(className[i], false, ucl);
>         }
>         Object o = Proxy.newProxyInstance(ucl,cls,new
> MethodInvocationHandler(methodInvoker));
>         return o;
>     }
>    
>     private static class MethodInvocationHandler implements
> java.lang.reflect.InvocationHandler{
>         MethodInvoker methodInvoker=null;
>         public MethodInvocationHandler(MethodInvoker methodInvoker){
>             this.methodInvoker=methodInvoker;
>         }
>        
>         public Object invoke(Object proxy, java.lang.reflect.Method
> method, Object[] args) throws Throwable{
>          
>         }
>     }
>
> Best regards
> Danilo Limatola
>
>
> Nadia Boukhelifa ha scritto:
>  
>> Hello,
>>
>> I would like to know if it is possible to use BeanShell to implement
>> methods of my own Interface class, dynamically?
>>
>> Many thanks
>>
>> N.
>>
>>
>> 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=1216
>> 42 _______________________________________________
>> 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
>
> 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