openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mitesh Meswani (JIRA)" <>
Subject [jira] Commented: (OPENJPA-244) Java 2 Security enablement
Date Tue, 05 Jun 2007 18:03:25 GMT


Mitesh Meswani commented on OPENJPA-244:

>What is possible is to hide the nasty mechanical construction of a new instance of the
anonymous inner class by a wrapper method.

Here is an example for invoking a method reflectively 

                try {
                    AccessController.doPrivileged(new PrivilegedMethodInvoker(method, null,
                } catch (PrivilegedActionException exception) {
                    Exception throwableException = exception.getException();

where PrivilegedMethodInvoker is as follows

public class PrivilegedMethodInvoker implements PrivilegedExceptionAction {

    private Method method;
    private Object target;
    private Object[] args;
    public PrivilegedMethodInvoker(Method method, Object target, Object[] args){
        this.method = method; = target;
        this.args = args;
    public Object run() throws IllegalAccessException, InvocationTargetException {
        return PrivilegedAccessHelper.invokeMethod(method, target, args);

> Java 2 Security enablement
> --------------------------
>                 Key: OPENJPA-244
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 0.9.8
>            Reporter: Kevin Sutter
>         Attachments:
> Via some testing with the WebSphere Application Server, it's been discovered that we're
missing some doPriv blocks through out the OpenJPA code base.  This JIRA report will be used
to resolve these issues.  More specific examples will be posted later.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message