Package net.jini.core.constraint

Examples of net.jini.core.constraint.RemoteMethodControl


    // inherit javadoc
    public void run() throws Exception {
        try {
            BasicInvocationHandler handler;
            RemoteMethodControl proxy, newProxy;
            FakeMethodConstraints clientConstraints = new FakeMethodConstraints(
                new InvocationConstraint[] {Integrity.YES});
            FakeMethodConstraints serverConstraints = new FakeMethodConstraints(
                new InvocationConstraint[] {Confidentiality.YES});
            FakeObjectEndpoint oe = new FakeObjectEndpoint();

            logger.log(Level.FINE,"=================================");
            logger.log(Level.FINE,"test case 1: setConstraints(null)");
            logger.log(Level.FINE,"");

            handler = new BasicInvocationHandler(
                new BasicInvocationHandler(oe,serverConstraints),
                clientConstraints);
            proxy = (RemoteMethodControl) Proxy.newProxyInstance(
                this.getClass().getClassLoader(),
                new Class[] {RemoteMethodControl.class}, handler);

            newProxy =
                (RemoteMethodControl) proxy.setConstraints(null);
            handler =
                (BasicInvocationHandler) Proxy.getInvocationHandler(newProxy);
            assertion(handler.getObjectEndpoint() == oe);
            assertion(handler.getClientConstraints() == null);
            assertion(handler.getServerConstraints() == serverConstraints);
            assertion(proxy.getConstraints() == clientConstraints);
            assertion(newProxy.getConstraints() == null);

            logger.log(Level.FINE,"=================================");
            logger.log(Level.FINE,"test case 2: "
                + "setConstraints(MethodConstraints)");
            logger.log(Level.FINE,"");

            handler = new BasicInvocationHandler(
                new BasicInvocationHandler(oe,serverConstraints),
                null);
            proxy = (RemoteMethodControl) Proxy.newProxyInstance(
                this.getClass().getClassLoader(),
                new Class[] {RemoteMethodControl.class}, handler);

            newProxy =
                (RemoteMethodControl) proxy.setConstraints(clientConstraints);
            handler =
                (BasicInvocationHandler) Proxy.getInvocationHandler(newProxy);
            assertion(handler.getObjectEndpoint() == oe);
            assertion(handler.getClientConstraints() == clientConstraints);
            assertion(handler.getServerConstraints() == serverConstraints);
            assertion(proxy.getConstraints() == null);
            assertion(newProxy.getConstraints() == clientConstraints);

            logger.log(Level.FINE,"=================================");
            logger.log(Level.FINE,"test case 3: bad proxy arg");
            logger.log(Level.FINE,"");
View Full Code Here


                                                MethodConstraints constraints )
        {
            MethodConstraints newConstraints
               = ConstrainableProxyUtil.translateConstraints(constraints,
                                                             methodMapArray);
            RemoteMethodControl constrainedServer =
                ((RemoteMethodControl)server).setConstraints(newConstraints);

            return ((Fiddler)constrainedServer);
        }//end constrainServer
View Full Code Here

            if (obj == null || ctx == null) {
                throw new IllegalArgumentException();
            } else if (!(obj instanceof ConstrainableCybernodeProxy)) {
                return false;
            }
            RemoteMethodControl otherServerProxy =
                (RemoteMethodControl) ((ConstrainableCybernodeProxy)obj).cybernodeProxy;
            MethodConstraints mc = otherServerProxy.getConstraints();
            TrustEquivalence trusted = (TrustEquivalence) serverProxy.setConstraints(mc);
            return(trusted.checkTrustEquivalence(otherServerProxy));
        }
View Full Code Here

            if (obj == null || ctx == null) {
                throw new IllegalArgumentException();
            } else if (!(obj instanceof ConstrainableCybernodeAdminProxy)) {
                return false;
            }
            RemoteMethodControl otherServerProxy =
                (RemoteMethodControl)((ConstrainableCybernodeAdminProxy)obj).cybernodeAdminProxy;
            MethodConstraints mc = otherServerProxy.getConstraints();
            TrustEquivalence trusted = (TrustEquivalence) serverProxy.setConstraints(mc);
            return(trusted.checkTrustEquivalence(otherServerProxy));
        }
View Full Code Here

            if (obj == null || ctx == null) {
                throw new IllegalArgumentException();
            } else if (!(obj instanceof ConstrainableProvisionMonitorProxy)) {
                return false;
            }
            RemoteMethodControl otherServerProxy =
                (RemoteMethodControl) ((ConstrainableProvisionMonitorProxy)obj).monitorProxy;
            MethodConstraints mc = otherServerProxy.getConstraints();
            TrustEquivalence trusted = (TrustEquivalence) serverProxy.setConstraints(mc);
            return(trusted.checkTrustEquivalence(otherServerProxy));
        }
View Full Code Here

            if (obj == null || ctx == null) {
                throw new IllegalArgumentException();
            } else if (!(obj instanceof ConstrainableProvisionMonitorAdminProxy)) {
                return false;
            }
            RemoteMethodControl otherServerProxy =
                (RemoteMethodControl)((ConstrainableProvisionMonitorAdminProxy)obj).monitorAdminProxy;
            MethodConstraints mc = otherServerProxy.getConstraints();
            TrustEquivalence trusted = (TrustEquivalence) serverProxy.setConstraints(mc);
            return(trusted.checkTrustEquivalence(otherServerProxy));
        }
View Full Code Here

TOP

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

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.