Package javax.security.jacc

Examples of javax.security.jacc.PolicyConfiguration


        try {
            // Now link the policy configuration objects
            for (Iterator itCtxId = ctxIDs.iterator(); itCtxId.hasNext();) {
                String toBeLinkedCtxId = (String) itCtxId.next();
                PolicyConfiguration toBeLinkedPC = getPolicyConfigurationFactory().getPolicyConfiguration(toBeLinkedCtxId, false);
                for (Iterator linkCId = ctxIDs.iterator(); linkCId.hasNext();) {
                    String linkedCtxId = (String) linkCId.next();
                    if (!toBeLinkedCtxId.equals(linkedCtxId)) {
                        PolicyConfiguration linkedPC = getPolicyConfigurationFactory().getPolicyConfiguration(linkedCtxId, false);
                        toBeLinkedPC.linkConfiguration(linkedPC);
                    }
                }
            }
        } catch (PolicyContextException pce) {
View Full Code Here


        String ctxId = null;
        try {
            // commit the policy configuration objects
            for (Iterator itCtxId = ctxIDs.iterator(); itCtxId.hasNext();) {
                ctxId = (String) itCtxId.next();
                PolicyConfiguration pc = getPolicyConfigurationFactory().getPolicyConfiguration(ctxId, false);
                pc.commit();
            }
        } catch (PolicyContextException pce) {
            throw new DeployerException("Cannot commit policy configuration with Id '" + ctxId + "'", pce);
        }
View Full Code Here

            return false;
        }

        JPolicyConfiguration jPolicyConfiguration = null;
        try {
            PolicyConfiguration pc = policyConfigurationFactory.getPolicyConfiguration(contextID, false);
            if (pc instanceof JPolicyConfiguration) {
                jPolicyConfiguration = (JPolicyConfiguration) pc;
            } else {
                // Maybe it's a delegating policy configuration and we have a
                // configuration for this object
View Full Code Here

        // Section 3.3 - Check permissions
        checkSetPolicy();

        // Get in cache
        PolicyConfiguration policyConfiguration = getInternalPolicyConfiguration(contextID);

        // Is there an existing configuration ?
        if (policyConfiguration != null) {
            // Need to be removed ?
            if (remove) {
                // Delete permissions
                policyConfiguration.delete();
                ((JPolicyConfiguration) policyConfiguration).resetState();
            }
            // return cache
            return policyConfiguration;
        }
View Full Code Here

      }
      if (accepted == false)
         return;

      String contextID = unit.getName();
      PolicyConfiguration pc = null;
      try
      {
         PolicyConfigurationFactory pcFactory = PolicyConfigurationFactory.getPolicyConfigurationFactory();
         pc = pcFactory.getPolicyConfiguration(contextID, true);
      }
View Full Code Here

      String contextID =  shortNameFromDeploymentName(unit.getSimpleName());
      PolicyConfigurationFactory pcFactory = null;
      try
      {
         pcFactory = PolicyConfigurationFactory.getPolicyConfigurationFactory();
         PolicyConfiguration pc = pcFactory.getPolicyConfiguration(contextID, true);
         unit.addAttachment(PolicyConfiguration.class, pc);
      }
      catch (PolicyContextException e)
      {
         throw new DeploymentException("PolicyContextException generated in deploy", e);
View Full Code Here

      setInput(PolicyConfiguration.class);
   }
  
   public void internalDeploy(DeploymentUnit unit) throws org.jboss.deployers.spi.DeploymentException
   {
      PolicyConfiguration pc = unit.getAttachment(PolicyConfiguration.class);
      if (pc == null)
         return;

      DeploymentUnit parent = unit.getParent();
      if (parent == null)
         throw new IllegalStateException("Unit has not parent: " + unit);
      PolicyConfiguration parentPc = parent.getAttachment(PolicyConfiguration.class);
      try
      {
         if (parentPc != null && pc != parentPc)
         {
            parentPc.linkConfiguration(pc);
         }
         pc.commit();
      }
      catch (PolicyContextException e)
      {
View Full Code Here

      try
      {
         final PolicyConfigurationFactory policyConfigurationFactory = PolicyConfigurationFactory
               .getPolicyConfigurationFactory();
         final PolicyConfiguration policyConfiguration = policyConfigurationFactory.getPolicyConfiguration(dep
               .getSimpleName(), false);

         WebPermissionMapping.createPermissions(jbossWebMD, policyConfiguration);
         policyConfiguration.commit();
      }
      catch (Exception e)
      {
         throw new RuntimeException("Exception generating JACC perms: ", e);
      }
View Full Code Here

             * the policy configuration from the factory and then we commit.
             */
            String jaccContextIdChild = pcfm.getJaccContextID();
           
            PolicyConfigurationFactory policyConfigurationFactory = PolicyConfigurationFactory.getPolicyConfigurationFactory();
            PolicyConfiguration pcChild = policyConfigurationFactory.getPolicyConfiguration(jaccContextIdChild, false);
            if(pcChild != null)
            {
               parentPC.linkConfiguration(pcChild);
               //Commit the linked PC
               pcChild.commit();
            }
         }
         parentPC.commit();
         // Allow the policy to incorporate the policy configs
         Policy.getPolicy().refresh();
View Full Code Here

   void createMissingPermissions(Container con, BeanMetaData bean) throws ClassNotFoundException,
         PolicyContextException
   {
      String contextID = con.getJaccContextID();
      PolicyConfigurationFactory pcFactory = PolicyConfigurationFactory.getPolicyConfigurationFactory();
      PolicyConfiguration pc = pcFactory.getPolicyConfiguration(contextID, false);
      Class clazz = con.getHomeClass();
      // If there is no security domain mark all methods as unchecked
      boolean hasSecurityDomain = con.getSecurityManager() != null;
      boolean exclude = hasSecurityDomain ? bean.isExcludeMissingMethods() : false;

      if (clazz != null)
      {
         addMissingMethodPermissions(bean, exclude, clazz, InvocationType.HOME, pc);
      }
      clazz = con.getLocalHomeClass();
      if (clazz != null)
      {
         addMissingMethodPermissions(bean, exclude, clazz, InvocationType.LOCALHOME, pc);
      }
      clazz = con.getLocalClass();
      if (clazz != null)
      {
         addMissingMethodPermissions(bean, exclude, clazz, InvocationType.LOCAL, pc);
      }
      clazz = con.getRemoteClass();
      if (clazz != null)
      {
         addMissingMethodPermissions(bean, exclude, clazz, InvocationType.REMOTE, pc);
      }

      if (pc.inService() == false)
         pc.commit();
      // Allow the policy to incorporate the policy configs
      Policy.getPolicy().refresh();
   }
View Full Code Here

TOP

Related Classes of javax.security.jacc.PolicyConfiguration

Copyright © 2018 www.massapicom. 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.