public WebSecurityManager getManager(String ctxId, String name, boolean remove) { return getManager(SECURITY_MANAGERS, ctxId, name, remove); }
public WebSecurityManager getManager(String ctxId, String name, boolean remove) { return getManager(SECURITY_MANAGERS, ctxId, name, remove); }
public WebSecurityManager getWebSecurityManager(boolean logNull) { if (webSecurityManager == null) { synchronized (this) { webSecurityManager = webSecurityManagerFactory.getManager(CONTEXT_ID,null, false); } if (webSecurityManager == null && logNull) { _logger.log(Level.WARNING, "realmAdapter.noWebSecMgr", CONTEXT_ID); } } return webSecurityManager; }
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() 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 WebSecurityManager createManager(WebBundleDescriptor wbd, boolean register, ServerContext context) { String ctxId = WebSecurityManager.getContextID(wbd); WebSecurityManager manager = null; if (register) { manager = getManager(ctxId, null,false); } if (manager == null || !register) { try { probeProvider.securityManagerCreationStartedEvent(wbd.getModuleID()); manager = new WebSecurityManager(wbd, context, this, register); probeProvider.securityManagerCreationEndedEvent(wbd.getModuleID()); if (register) { String appName = wbd.getApplication().getRegistrationName(); addManagerToApp(ctxId, null, appName, manager); probeProvider.securityManagerCreationEvent(ctxId); } } catch (javax.security.jacc.PolicyContextException e) { logger.log(Level.FINE, "[Web-Security] FATAL Exception. Unable to create WebSecurityManager: " + e.getMessage()); throw new RuntimeException(e); } } return manager; } }
public WebSecurityManager createManager(WebBundleDescriptor wbd, boolean register, ServerContext context) { String ctxId = WebSecurityManager.getContextID(wbd); WebSecurityManager manager = null; if (register) { manager = getManager(ctxId, null,false); } if (manager == null || !register) { try { probeProvider.securityManagerCreationStartedEvent(wbd.getModuleID()); manager = new WebSecurityManager(wbd, context, this, register); probeProvider.securityManagerCreationEndedEvent(wbd.getModuleID()); if (register) { String appName = wbd.getApplication().getRegistrationName(); addManagerToApp(ctxId, null, appName, manager); probeProvider.securityManagerCreationEvent(ctxId); } } catch (javax.security.jacc.PolicyContextException e) { logger.log(Level.FINE, "[Web-Security] FATAL Exception. Unable to create WebSecurityManager: " + e.getMessage()); throw new RuntimeException(e); } } return manager; } }
/** * Translate Web Bundle Policy * @param webBD * @param remove boolean indicated whether any existing policy statements * are removed form context before translation * @throws DeploymentException */ private void loadPolicy(WebBundleDescriptor webBD, boolean remove) throws DeploymentException { try { if (webBD != null) { if (remove) { String cid = SecurityUtil.getContextID(webBD); WebSecurityManager wsm = wsmf.getManager(cid, null, true); if (wsm != null) { wsm.release(); } } wsmf.createManager(webBD, true, serverContext); } } catch (Exception se) { String msg = "Error in generating security policy for " + webBD.getModuleDescriptor().getModuleName(); throw new DeploymentException(msg, se); } }
/** * Translate Web Bundle Policy * @param webBD * @param remove boolean indicated whether any existing policy statements * are removed form context before translation * @throws DeploymentException */ private void loadPolicy(WebBundleDescriptor webBD, boolean remove) throws DeploymentException { try { if (webBD != null) { if (remove) { String cid = SecurityUtil.getContextID(webBD); WebSecurityManager wsm = wsmf.getManager(cid, null, true); if (wsm != null) { wsm.release(); } } wsmf.createManager(webBD, true, serverContext); } } catch (Exception se) { String msg = "Error in generating security policy for " + webBD.getModuleDescriptor().getModuleName(); throw new DeploymentException(msg, se); } }
/** * 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); }
/** * 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); }