Package net.jini.constraint

Examples of net.jini.constraint.BasicMethodConstraints


        InvocationConstraints constraints = new InvocationConstraints(
                ic, null);
        MethodDesc methodDesc1 = new MethodDesc(name, constraints);
        MethodDesc methodDesc2 = new MethodDesc(constraints);
        MethodDesc [] passedDescs = {methodDesc1, methodDesc2};
        BasicMethodConstraints bmc = new BasicMethodConstraints(passedDescs);
        MethodDesc [] resultDescs = bmc.getMethodDescs();
        if (resultDescs.length != passedDescs.length) {
            throw new TestException(
                    "returned MethodDesc array has invalid length");
        }
        for (int j = 0; j < passedDescs.length; ++j) {
            if (resultDescs[j] != passedDescs[j]) {
                throw new TestException(
                        "returned MethodDesc array invalid");
            }
        }
       
        // 2
        bmc = new BasicMethodConstraints(constraints);
        resultDescs = bmc.getMethodDescs();
        if (resultDescs.length != 1) {
            throw new TestException(
                    "returned MethodDesc array has invalid length");
        }
        if (!resultDescs[0].getConstraints().equals(constraints)) {
            throw new TestException(
                    "returned MethodDesc array invalid");
        }
       
        // 3
        bmc = new BasicMethodConstraints(passedDescs);
        MethodDesc [] resultDescs1 = bmc.getMethodDescs();
        MethodDesc [] resultDescs2 = bmc.getMethodDescs();
        if (resultDescs1 == resultDescs2) {
            throw new TestException(
                    "returned MethodDesc array should be the new every time"
                    + " it is called");
        }
       
        // 4
        bmc = new BasicMethodConstraints(constraints);
        resultDescs1 = bmc.getMethodDescs();
        resultDescs2 = bmc.getMethodDescs();
        if (resultDescs1 == resultDescs2) {
            throw new TestException(
                    "returned MethodDesc array should be the new every time"
                    + " it is called");
        }
View Full Code Here


             configDefined));
    }
    b.append("}");
    list.add(b.toString());
    // get the locator constraints
    BasicMethodConstraints constraints = null;
    if (configDefined) {
        try {
      constraints = (BasicMethodConstraints)
                    c.getEntry(getServiceComponent(),
             "locatorConstraints",
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.constraint.BasicMethodConstraints

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.