Package javax.security.jacc

Examples of javax.security.jacc.PolicyConfiguration.commit()


      EJBMethodPermission methodX = new EJBMethodPermission("someEJB", "methodX,,int");
      // This perm should be denied since the policy config has not been comitted
      boolean implied = sysPolicy.implies(null, methodX);
      assertFalse("methodX allowed",implied == true);

      pc.commit();
      sysPolicy.refresh();
      // Now it should be allowed since the policy config has been comitted
      implied = sysPolicy.implies(null, methodX);
      assertTrue("methodX allowed", implied  == true);
   }
View Full Code Here


   {
      PolicyConfigurationFactory pcf = PolicyConfigurationFactory.getPolicyConfigurationFactory();
      PolicyConfiguration pc = pcf.getPolicyConfiguration("context-a", true);
      EJBMethodPermission someEJB = new EJBMethodPermission("someEJB", null);
      pc.addToRole("callerX", someEJB);
      pc.commit();

      log.debug("EJBMethodPermission.CS: "+EJBMethodPermission.class.getProtectionDomain());
      final EJBMethodPermission methodX = new EJBMethodPermission("someEJB", "methodX");
      final Subject caller = new Subject();
      caller.getPrincipals().add(new SimplePrincipal("callerX"));
View Full Code Here

            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

      {
         addMissingMethodPermissions(bean, exclude, clazz, InvocationType.REMOTE, pc);
      }

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

   private void getInterfaces(Class iface, HashSet tmp)
View Full Code Here

            }
        }

        //commit
        for (PolicyConfiguration policyConfiguration : contextIdToPolicyConfigurationMap.values()) {
            policyConfiguration.commit();
        }

        //refresh policy
        Policy policy = Policy.getPolicy();
        policy.refresh();
View Full Code Here

        String role = (String) iter.next();
        policyConfiguration.addToRole(role, new JMSBrokerPermission(
            brokerSecurity.getBrokerName(), JMSBrokerPermission.CONNECT_ACTION));
      }

      policyConfiguration.commit();

        } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (PolicyContextException e) {
      e.printStackTrace();
View Full Code Here

        String role = (String) iter.next();
        policyConfiguration.addToRole(role, new JMSDestinationPermission(
            destinationSecurity.getDestination().getPhysicalName(), JMSDestinationPermission.SEND_ACTION));
      }
     
      policyConfiguration.commit();

        } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (PolicyContextException e) {
      e.printStackTrace();
View Full Code Here

/* 1062 */     clazz = con.getRemoteClass();
/* 1063 */     if (clazz != null)
/*      */     {
/* 1065 */       addMissingMethodPermissions(bean, exclude, clazz, InvocationType.REMOTE, pc);
/*      */     }
/* 1067 */     pc.commit();
/*      */   }
/*      */
/*      */   private void getInterfaces(Class iface, HashSet tmp)
/*      */   {
/* 1072 */     tmp.add(iface);
View Full Code Here

            }
        }

        //commit
        for (PolicyConfiguration policyConfiguration : contextIdToPolicyConfigurationMap.values()) {
            policyConfiguration.commit();
        }

        //refresh policy
        Policy policy = Policy.getPolicy();
        policy.refresh();
View Full Code Here

                    PolicyConfiguration parent = parentPolicy.getValue();
                    if (parent != null) {
                        parent = pcf.getPolicyConfiguration(parent.getContextID(), false);
                        parent.linkConfiguration(policyConfiguration);
                        policyConfiguration.commit();
                        parent.commit();
                    } else {
                        log.debugf("Could not retrieve parent policy for policy " + contextId);
                    }
                } else {
                    policyConfiguration.commit();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.