Examples of Policy


Examples of java.security.Policy

  }
 
  public void testAuthorizedPut() throws Exception {
    //testing
    GraphOverTime trustedGOT = new MemoryStoreImpl().getGraphOverTime(new HashSet<Source>());
    Policy orig = Policy.getPolicy();
    Policy.setPolicy(new DefaultPolicy(trustedGOT));
    //Policy.setPolicy(orig);
    Policy.setPolicy(null);
    Policy.setPolicy(new NoRestrictionsPolicy());
View Full Code Here

Examples of javax.security.auth.Policy

            this.subject = subject;
         }

         public boolean implies(Permission permission)
         {
            Policy policy = (Policy)AccessController.doPrivileged(new PrivilegedAction()
            {
               public Object run()
               {
                  return Policy.getPolicy();
               }
            });
            PermissionCollection permissions = policy.getPermissions(subject, getCodeSource());
            return permissions.implies(permission);
         }
View Full Code Here

Examples of ma.glasnost.orika.test.crossfeatures.PolicyElementsTestCaseClasses.Policy

    @Test
    public void test() {
        MapperFactory factory = MappingUtil.getMapperFactory();
        configureMapperFactory(factory);
       
        Policy policy = new Policy();
        Set<PolicyElement> elements = new HashSet<PolicyElement>();
        elements.add(new CustomerElement());
        elements.add(new ProductElement());
        elements.add(new OtherElement());
        elements.add(new OneOtherElement());
       
        policy.setElements(elements);
       
        PolicyDTO dto = factory.getMapperFacade().map(policy, PolicyDTO.class);
       
        Assert.assertEquals(elements.size(), dto.getElements().size());
    }
View Full Code Here

Examples of net.javlov.Policy

  protected SarsaAgent makeAgent(List<? extends Option> optionPool) {
    qf = TabularQFunction.getInstance(optionPool.size());
    SarsaAgent a = new QLearningAgent(qf, 1, optionPool);
    //a.setLearnRate(new DecayingLearningRate(1, optionPool.size(), 0.8));
    a.setLearnRate( new FixedLearningRate(0.2) );
    Policy pi = new EGreedyPolicy(qf, 0.05, optionPool);
    a.setPolicy(pi);
    a.setSMDPMode(true);
    a.setLearnStateValueFunction(false);
    a.setInterruptOptions(false);
    return a;
View Full Code Here

Examples of net.sf.ehcache.store.Policy

    /**
     * {@inheritDoc}.
     */
    public Policy getInMemoryEvictionPolicy() {
        Policy rv = null;
        try {
            rv = executeWithExecutor(new Callable<Policy>() {
                public Policy call() throws Exception {
                    return nonstopActiveDelegateHolder.getUnderlyingTerracottaStore().getInMemoryEvictionPolicy();
                }
View Full Code Here

Examples of org.acme.insurance.Policy

        final RuleBase ruleBase = loadRuleBase( reader );
        final WorkingMemory wm = ruleBase.newStatefulSession();

        // now create some test data
        final Driver driver = new Driver();
        final Policy policy = new Policy();

        wm.insert( driver );
        wm.insert( policy );

        wm.fireAllRules();

        assertEquals( 120,
                      policy.getBasePrice() );
    }
View Full Code Here

Examples of org.apache.archiva.policies.Policy

                    }

                    // Validate existance of policy key.
                    if ( policyExists( policyId ) )
                    {
                        Policy policy = findPolicy( policyId );
                        // Does option exist?
                        if ( !policy.getOptions().contains( setting ) )
                        {
                            setting = policy.getDefaultOption();
                        }
                        connector.addPolicy( policyId, setting );
                    }
                    else
                    {
View Full Code Here

Examples of org.apache.camel.spi.Policy

    @Override
    public Processor createProcessor(RouteContext routeContext) throws Exception {
        Processor childProcessor = createOutputsProcessor(routeContext);

        Policy policy = resolvePolicy(routeContext);
        if (policy == null) {
            throw new IllegalArgumentException("No policy configured: " + this);
        }
        return policy.wrap(childProcessor);
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.client.api.Policy

    }

    private void removePolicyFromPolicyList(Policy policy) {
        Iterator<Policy> iter = policies.iterator();
        while (iter.hasNext()) {
            Policy p = iter.next();
            if (policy.getId().equals(p.getId())) {
                iter.remove();
            }
        }
    }
View Full Code Here

Examples of org.apache.cxf.annotations.Policy

            //ignore
        }
    }

    private void addPolicies(AbstractServiceFactoryBean factory, OperationInfo inf, Method m) {
        Policy p = m.getAnnotation(Policy.class);
        Policies ps = m.getAnnotation(Policies.class);
        if (p != null || ps != null) {
            List<Policy> list = new ArrayList<Policy>();
            if (p != null) {
                list.add(p);
            }
            if (ps != null) {
                list.addAll(Arrays.asList(ps.value()));
            }
            ListIterator<Policy> it = list.listIterator();
            while (it.hasNext()) {
                p = it.next();
                Policy.Placement place = p.placement();
                if (place == Policy.Placement.DEFAULT) {
                    place = Policy.Placement.BINDING_OPERATION;
                }
                ServiceInfo service = inf.getInterface().getService();
                Class<?> cls = m.getDeclaringClass();
                switch (place) {
                case PORT_TYPE_OPERATION:
                    addPolicy(inf, service, p, cls,
                              inf.getName().getLocalPart() + "PortTypeOpPolicy");
                    it.remove();
                    break;
                case PORT_TYPE_OPERATION_INPUT:
                    addPolicy(inf.getInput(), service, p, cls,
                              inf.getName().getLocalPart() + "PortTypeOpInputPolicy");
                    it.remove();
                    break;
                case PORT_TYPE_OPERATION_OUTPUT:
                    addPolicy(inf.getOutput(), service, p, cls,
                              inf.getName().getLocalPart() + "PortTypeOpOutputPolicy");
                    it.remove();
                    break;
                case PORT_TYPE_OPERATION_FAULT: {
                    for (FaultInfo f : inf.getFaults()) {
                        if (p.faultClass().equals(f.getProperty(Class.class.getName()))) {
                            addPolicy(f, service, p, cls,
                                      f.getName().getLocalPart() + "PortTypeOpFaultPolicy");
                            it.remove();
                        }
                    }
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.