/** * Return my mapping of rolename to users and groups on a particular * server. */ public SecurityRoleMapper getRoleMapper() { if (this.roleMapper == null) { if (securityRoleMapperFactory == null) { _logger.log(Level.FINE, "SecurityRoleMapperFactory NOT set."); } else { this.roleMapper = securityRoleMapperFactory.getRoleMapper(this.getName()); } } return this.roleMapper; }
/** * Sets the registration name for this application. This name is used * while deploying the application. The deployment process gurantees * that this name is unique. * * @param appId the registration name used for this application */ public void setRegistrationName(String appId) { // at his point we need to swap our RoleMapper, if we have one... SecurityRoleMapper roleMapper = null; try { roleMapper = getRoleMapper(); } catch (IllegalArgumentException ignore) { } if (roleMapper != null) { if (securityRoleMapperFactory == null) { throw new IllegalArgumentException(localStrings.getLocalString( "enterprise.deployment.norolemapperfactorydefine", "This application has no role mapper factory defined")); } securityRoleMapperFactory.removeRoleMapper(getName()); roleMapper.setName(appId); securityRoleMapperFactory.setRoleMapper(appId, roleMapper); } this.registrationName = appId; }
private void postConstruct() { SecurityRoleMapperFactoryGen.getSecurityRoleMapperFactory().setAppNameForContext(getAppId(), CONTEXT_ID); }
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 static void removeRoleMapper(DeploymentContext dc) { OpsParams params = dc.getCommandParameters(OpsParams.class); if (params.origin != OpsParams.Origin.undeploy) { return; } String appName = params.name(); SecurityRoleMapperFactory factory = getRoleMapperFactory(); factory.removeRoleMapper(appName); }
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); }
private SecurityRoleMapper getInternalMapper(String pcid) { SecurityRoleMapperFactory factory = Globals.get(SecurityRoleMapperFactory.class); //SecurityRoleMapperFactoryMgr.getFactory(); if (factory == null) { String msg = "RoleMapper.factory.lookup.failed"; logger.log(Level.SEVERE, msg); throw new SecurityException(msg); } SecurityRoleMapper srm = factory.getRoleMapper(pcid); if (srm == null) { String msg = "RoleMapper.mapper.lookup.failed"; logger.log(Level.SEVERE, msg); throw new SecurityException(msg); } return srm; }
roleMapperFactory.setAppNameForContext(appName, contextId); codesource = getApplicationCodeSource(contextId); ejbName = deploymentDescriptor.getName();
SecurityRoleMapper srm = factory.getRoleMapper(CONTEXT_ID); if (srm != null) { roleToSubjectMap = srm.getRoleToSubjectMapping(); String contextId = (String)it.next(); if (!CONTEXT_ID.equals(contextId)) { SecurityRoleMapper otherSrm = factory.getRoleMapper(contextId); Map otherRoleToSubjectMap = null;