private static synchronized PermissionCache createSecurityManagerCache() { Integer key = getNextKey(); PermissionCache cache = new PermissionCache(key, null, null, protoPerms, null); return registerPermissionCache(cache); }
public void destroy() throws PolicyContextException { boolean wasInService = getPolicyFactory().inService(CONTEXT_ID); //getPolicyFactory().getPolicyConfiguration(CONTEXT_ID,true); if (wasInService) { policy.refresh(); } PermissionCacheFactory.removePermissionCache(uncheckedPermissionCache); uncheckedPermissionCache = null; SecurityRoleMapperFactoryGen.getSecurityRoleMapperFactory().removeAppNameForContext(CONTEXT_ID); wsmf.getManager(CONTEXT_ID,null,true); }
if (register) { uncheckedPermissionCache = PermissionCacheFactory.createPermissionCache(this.CONTEXT_ID, codesource, protoPerms, null);
public Object get(String key){ if (PolicyContextHandlerImpl.HTTP_SERVLET_REQUEST.equalsIgnoreCase(key)){ return httpReq; } else if (PolicyContextHandlerImpl.SUBJECT.equalsIgnoreCase(key)){ return SecurityContext.getCurrent().getSubject(); } else if (PolicyContextHandlerImpl.REUSE.equalsIgnoreCase(key)) { PermissionCacheFactory.resetCaches(); return Integer.valueOf(0); } if (inv == null) { return null; } if (PolicyContextHandlerImpl.SOAP_MESSAGE.equalsIgnoreCase(key)) { return (ejbDelegate != null) ? ejbDelegate.getSOAPMessage(inv) : null; } else if (PolicyContextHandlerImpl.ENTERPRISE_BEAN.equalsIgnoreCase(key)) { return (ejbDelegate != null) ? ejbDelegate.getEnterpriseBean(inv) : null; } else if (PolicyContextHandlerImpl.EJB_ARGUMENTS.equalsIgnoreCase(key)) { return (ejbDelegate != null) ? ejbDelegate.getEJbArguments(inv) : null; } return null; }
public void destroy() { try { boolean wasInService = getPolicyFactory().inService(this.contextId); if (wasInService) { policy.refresh(); } /* * all ejbs of module share same policy context, but each has its own * permission cache, which must be unregistered from factory to * avoid leak. */ PermissionCacheFactory.removePermissionCache(uncheckedMethodPermissionCache); uncheckedMethodPermissionCache = null; roleMapperFactory.removeAppNameForContext(this.contextId); } catch (PolicyContextException pce) { String msg = "ejbsm.could_not_delete"; // Just log it. _logger.log(Level.WARNING, msg, pce); } probeProvider.securityManagerDestructionStartedEvent(ejbName); ejbSFM.getManager(contextId,ejbName,true); probeProvider.securityManagerDestructionEndedEvent(ejbName); probeProvider.securityManagerDestructionEvent(ejbName); }
PermissionCacheFactory.createPermissionCache( this.contextId, this.codesource, EJBMethodPermission.class,
/** * Analogous to destroy, except does not remove links from Policy Context, * and does not remove context_id from role mapper factory. Used to support * Policy Changes that occur via ServletContextListener. * * @throws PolicyContextException */ public void release() throws PolicyContextException { boolean wasInService = getPolicyFactory().inService(CONTEXT_ID); PolicyConfiguration config = getPolicyFactory().getPolicyConfiguration(CONTEXT_ID,false); WebPermissionUtil.removePolicyStatements(config,wbd); // refresh policy if the context was in service if (wasInService) { Policy.getPolicy().refresh(); } PermissionCacheFactory.removePermissionCache(uncheckedPermissionCache); uncheckedPermissionCache = null; wsmf.getManager(CONTEXT_ID,null,true); }
Integer key = getNextKey(); return registerPermissionCache(cache);
Integer key = getNextKey(); return registerPermissionCache(cache);