Package net.jini.core.constraint

Examples of net.jini.core.constraint.InvocationConstraints


            throw new TestException(ep + " does not implement"
                + " ServerCapabilities.");
        }
        ServerCapabilities serverEndpoint = (ServerCapabilities) ep;
        //Obtain constraints
        InvocationConstraints conflictingConstraints =
            (InvocationConstraints) getConfigObject(
                InvocationConstraints.class, "conflictingConstraints");
        InvocationConstraints unsupportedConstraints =
            (InvocationConstraints) getConfigObject(
                InvocationConstraints.class, "unsupportedConstraints");
        boolean integritySupported = ((Boolean)getConfigObject(
            Boolean.class, "integritySupported")).booleanValue();
        //Verify conflicting constraints
        boolean exceptionThrown = false;
        try {
            serverEndpoint.checkConstraints(conflictingConstraints);
        } catch (UnsupportedConstraintException e){
            exceptionThrown = true;
        }
        if (!exceptionThrown) {
            throw new TestException("Conflicting constraints"
                + " did not generate an UnsupportedConstraintsException"
                + " for " + ep);
        }
        //Verify unsupported constraints
        exceptionThrown = false;
        try {
            serverEndpoint.checkConstraints(unsupportedConstraints);
        } catch (UnsupportedConstraintException e){
            exceptionThrown = true;
        }
        if (!exceptionThrown) {
            throw new TestException("Unsupported constraints"
                + " did not generate an UnsupportedConstraintsException"
                + " for " + ep);
        }
        if (integritySupported) {
            //Verify integrity
            boolean integrityReturned = false;
            InvocationConstraints returned = serverEndpoint
                .checkConstraints(
                    new InvocationConstraints(Integrity.YES,null));
            Iterator it = returned.requirements().iterator();
            while (it.hasNext()) {
                InvocationConstraint ic = (InvocationConstraint) it.next();
                if (ic.equals(Integrity.YES)) {
                    integrityReturned = true;
                    break;
View Full Code Here


    /**
     * Implementation of interface method.
     */
    public InvocationConstraints getConstraints(Method method) {
        return new InvocationConstraints(required_ic,null);
    }
View Full Code Here

      public boolean hasNext() {
    return i > 0;
      }
      public Object next() {
    if (i > 0) {
        return new InvocationConstraints(
                        new InvocationConstraint[] { required_ic[--i] },
                        null);
    } else if (i == 0) {
                    --i;
        return InvocationConstraints.EMPTY;
View Full Code Here

        //Obtain endpoint
        ServerEndpoint serverEndpoint = getServerEndpoint();
        endpoint = serverEndpoint
            .enumerateListenEndpoints(new SETContext());
        //Obtain constraints
        InvocationConstraints conflictingConstraints =
            (InvocationConstraints) getConfigObject(
                InvocationConstraints.class, "conflictingConstraints");
        InvocationConstraints unsupportedConstraints =
            (InvocationConstraints) getConfigObject(
                InvocationConstraints.class, "unsupportedConstraints");
        boolean integritySupported = ((Boolean)getConfigObject(
            Boolean.class, "integritySupported")).booleanValue();
        //Verify conflicting constraints
View Full Code Here

            prefs.add(ClientAuthentication.NO);
            prefs.add(Confidentiality.NO);
            prefs.add(Delegation.NO);
            prefs.add(Integrity.NO);
            prefs.add(ServerAuthentication.NO);
            obj = new InvocationConstraints(reqs, prefs);
        } catch (Exception e) {
            throw new TestException("Exception has been thrown while creating"
                    + " InvocationConstraints object", e);
        }
    }
View Full Code Here

    /**
     * Constructs a FakeServerCapabilities. 
     */
    public FakeServerCapabilities(InvocationConstraint[] ic) {
        constraints = (ic == null ? InvocationConstraints.EMPTY :
                                    new InvocationConstraints(ic,null));
    }
View Full Code Here

        ServiceBeanConfig sc = svcElement.getServiceBeanConfig();
        Map<String, Object> configParameters = sc.getConfigurationParameters();

        String[] args = (String[])configParameters.get(ServiceBeanConfig.SERVICE_PROVISION_CONFIG);
        MethodConstraints serviceListenerConstraints=
                new BasicMethodConstraints(new InvocationConstraints(new ConnectionRelativeTime(30000), null));
        ProxyPreparer defaultProxyPreparer =  new BasicProxyPreparer(false, serviceListenerConstraints, null);

        if(args==null) {
            proxyPreparer = defaultProxyPreparer;
        } else {
View Full Code Here

TOP

Related Classes of net.jini.core.constraint.InvocationConstraints

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.