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); }
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); }
/** * 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); }