Examples of EJBSecurityManager


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

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

      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

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

 
  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

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

            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

Examples of org.glassfish.ejb.security.application.EJBSecurityManager

    public EJBSecurityManager createManager(EjbDescriptor ejbDesc,
            boolean register) {
        String ctxId = EJBSecurityManager.getContextID(ejbDesc);
        String ejbName = ejbDesc.getName();
        EJBSecurityManager manager = null;
        if (register) {
            manager = getManager(ctxId, ejbName, false);
        }
        if (manager == null || !register) {
            try {
                probeProvider.securityManagerCreationStartedEvent(ejbName);
                manager = new EJBSecurityManager(ejbDesc, this.invMgr, this);
                probeProvider.securityManagerCreationEndedEvent(ejbName);
                if (register) {
                         
                    String appName = ejbDesc.getApplication().getRegistrationName();
                    addManagerToApp(ctxId, ejbName, appName, manager);
View Full Code Here

Examples of org.glassfish.ejb.security.application.EJBSecurityManager

    public EJBSecurityManager createManager(EjbDescriptor ejbDesc,
            boolean register) {
        String ctxId = EJBSecurityManager.getContextID(ejbDesc);
        String ejbName = ejbDesc.getName();
        EJBSecurityManager manager = null;
        if (register) {
            manager = getManager(ctxId, ejbName, false);
        }
        if (manager == null || !register) {
            try {
                probeProvider.securityManagerCreationStartedEvent(ejbName);
                manager = new EJBSecurityManager(ejbDesc, this.invMgr, this);
                probeProvider.securityManagerCreationEndedEvent(ejbName);
                if (register) {
                         
                    String appName = ejbDesc.getApplication().getRegistrationName();
                    addManagerToApp(ctxId, ejbName, appName, manager);
View Full Code Here

Examples of org.glassfish.ejb.security.application.EJBSecurityManager

          throws Exception {
    assert bc != null;

    String ctxId = EJBSecurityManager.getContextID(ejbDescriptor);
    String ejbName = ejbDescriptor.getName();
    EJBSecurityManager sm = securityManagerFactory.getManager(ctxId, ejbName, false);
    if (sm == null) {
      sm = securityManagerFactory.createManager(ejbDescriptor, true);
    }
    bc.setSecurityManager(sm);
    bc.initializeHome();
View Full Code Here

Examples of org.glassfish.ejb.security.application.EJBSecurityManager

        try {
            policyLoader.loadPolicy();
            String moduleName = null;
       
            for (EjbDescriptor desc : ejbs) {
                EJBSecurityManager ejbSM = null;

                // Initialize each ejb container (setup component environment, register JNDI objects, etc.)
                // Any instance instantiation , timer creation/restoration, message inflow is delayed until
                // start phase.
                // create and register the security manager with the factory
View Full Code Here

Examples of org.glassfish.ejb.security.application.EJBSecurityManager

    public EJBSecurityManager createManager(EjbDescriptor ejbDesc,
            boolean register) {
        String ctxId = EJBSecurityManager.getContextID(ejbDesc);
        String ejbName = ejbDesc.getName();
        EJBSecurityManager manager = null;
        if (register) {
            manager = getManager(ctxId, ejbName, false);
        }
        if (manager == null || !register) {
            try {
                probeProvider.securityManagerCreationStartedEvent(ejbName);
                manager = new EJBSecurityManager(ejbDesc, this.invMgr, this);
                probeProvider.securityManagerCreationEndedEvent(ejbName);
                if (register) {
                         
                    String appName = ejbDesc.getApplication().getRegistrationName();
                    addManagerToApp(ctxId, ejbName, appName, manager);
View Full Code Here

Examples of org.glassfish.ejb.security.application.EJBSecurityManager

    protected final SecurityManager getSecurityManager(EjbDescriptor ejbDescriptor)
            throws Exception {

        String ctxId = EJBSecurityManager.getContextID(ejbDescriptor);
        String ejbName = ejbDescriptor.getName();
        EJBSecurityManager sm = securityManagerFactory.getManager(ctxId, ejbName, false);
        if (sm == null) {
            sm = securityManagerFactory.createManager(ejbDescriptor, true);
        }
        return sm;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.