Package com.sun.enterprise.security.application

Examples of com.sun.enterprise.security.application.EJBSecurityManager


                // abort loading
                return false;
            }

            try {
    EJBSecurityManager sm =
                    EJBSecurityManager.createManager(nextDescriptor,true);
                // create the bean container
                Container container = null;
                try {
        notifyEjbEvent(EjbContainerEvent.BEFORE_EJB_CONTAINER_LOAD,
View Full Code Here


      final Method meth = beanClassMethod;
      final Object obj = o;
      final Object[] objArr = oa;
      Object ret;
      EJBSecurityManager mgr = (EJBSecurityManager) c.getSecurityManager();
       if (mgr == null) {
     throw new SecurityException("SecurityManager not set");
      }

            // Optimization.  Skip doAsPrivileged call if this is a local
            // invocation and the target ejb uses caller identity or the
      // System Security Manager is disabled.
            // Still need to execute it within the target bean's policy context.
            // see CR 6331550
            if((inv.isLocal && mgr.getUsesCallerIdentity()) ||
         System.getSecurityManager() == null) {
                ret = mgr.runMethod(meth, obj, objArr);
            } else {
                try {
                    PrivilegedExceptionAction pea =
                        new PrivilegedExceptionAction(){
                            public java.lang.Object run() throws Exception {
                                return meth.invoke(obj, objArr);
                            }
                        };

                    ret = mgr.doAsPrivileged(pea);
                } catch(PrivilegedActionException pae) {
                    Throwable cause = pae.getCause();
                    if( cause instanceof InvocationTargetException ) {
                        cause = ((InvocationTargetException) cause).getCause();
                    }
View Full Code Here

 
  final Method meth = beanClassMethod;
  final Object obj = o;
  final Object[] objArr = oa;
  Object ret = null;
        EJBSecurityManager ejbSecMgr = null;

   if(mgr == null) {
      if (c != null) {
    ejbSecMgr = (EJBSecurityManager) c.getSecurityManager();
      }
      if (ejbSecMgr == null) {
     throw new SecurityException("SecurityManager not set");
      }
  } else {
            ejbSecMgr = (EJBSecurityManager) mgr;
        }

        // Optimization.  Skip doAsPrivileged call if this is a local
        // invocation and the target ejb uses caller identity or the
  // System Security Manager is disabled.
        // Still need to execute it within the target bean's policy context.
        // see CR 6331550
        if((inv.isLocal && ejbSecMgr.getUsesCallerIdentity()) ||
     System.getSecurityManager() == null) {
            ret = ejbSecMgr.runMethod(meth, obj, objArr);
        } else {

            PrivilegedExceptionAction pea =
                new PrivilegedExceptionAction(){
                    public java.lang.Object run() throws Exception {
                        return meth.invoke(obj, objArr);
                    }
                };
            try {
                ret = ejbSecMgr.doAsPrivileged(pea);
            } catch(PrivilegedActionException pae) {
                Throwable cause = pae.getCause();
                throw cause;
            }
        }
View Full Code Here

            if (ctxIds != null && ctxIds.length > 0 && ctxIds[0] != null) {
                SecurityUtil.removePolicy(ctxIds[0]);
                ArrayList<EJBSecurityManager> list = EJBSecurityManager.getManagers(ctxIds[0], true);
                if (list != null && list.size() > 0) {
                    for (int i = 0; i < list.size(); i++) {
                        EJBSecurityManager esm = list.get(i);
                        esm.destroy();
                    }
                }
            }else{
                cleanPolicies(requestName);
            }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.security.application.EJBSecurityManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.