Package net.jini.jeri

Examples of net.jini.jeri.BasicInvocationHandler


    }

    protected DgcProxy getDgcProxy(Object endpoint) {
  Endpoint e = (Endpoint) endpoint;
  ObjectEndpoint oe = new BasicObjectEndpoint(e, Jeri.DGC_ID, false);
  InvocationHandler ih = new BasicInvocationHandler(oe, null);
  DgcServer proxy =
      (DgcServer) Proxy.newProxyInstance(getClass().getClassLoader(),
                 proxyInterfaces, ih);
  return new DgcProxyImpl(proxy);
    }
View Full Code Here


  }
    }

    private static DgcServer makeDgcProxy(Endpoint e) {
  ObjectEndpoint oe = new BasicObjectEndpoint(e, DGC_ID, false);
  InvocationHandler ih = new BasicInvocationHandler(oe, null);
  return (DgcServer)
      Proxy.newProxyInstance(DgcServer.class.getClassLoader(),
           new Class[] { DgcServer.class }, ih);
    }
View Full Code Here

    /**
     * A passthrough call to the underlying <code>RemoteMethodControl</code> stub
     */
    public MethodConstraints getServerConstraints() throws RemoteException {
        BasicInvocationHandler suiHandler =
            (BasicInvocationHandler)
            Proxy.getInvocationHandler(remoteProxy);
        return suiHandler.getServerConstraints();
    }
View Full Code Here

            "com.sun.jini.test.spec.io.util.FakeArgument").newInstance();
        Object proxy = Proxy.newProxyInstance(
                    RMIClassLoader.getClassLoader(codebase),
                    new Class[] {RMIClassLoader.loadClass(
                        codebase,interfaceName)},
                    new BasicInvocationHandler(new FakeObjectEndpoint(),
                        new FakeMethodConstraints(null)));

        // providesIntegrity
        Boolean f = Boolean.FALSE;
        Boolean t = Boolean.TRUE;
View Full Code Here

        File file = new File("test case");
        Object proxy = Proxy.newProxyInstance(
                    RMIClassLoader.getClassLoader(codebase),
                    new Class[] {RMIClassLoader.loadClass(
                        codebase,interfaceName)},
                    new BasicInvocationHandler(new FakeObjectEndpoint(),null));

        // callUseCodebaseAnnotations
        Boolean f = Boolean.FALSE;
        Boolean t = Boolean.TRUE;
View Full Code Here

            "com.sun.jini.test.spec.io.util.FakeArgument").newInstance();
        Object proxy = Proxy.newProxyInstance(
                    RMIClassLoader.getClassLoader(codebase),
                    new Class[] {RMIClassLoader.loadClass(
                        codebase,interfaceName)},
                    new BasicInvocationHandler(new FakeObjectEndpoint(),null));

        // requestIntegrity
        Boolean f = Boolean.FALSE;
        Boolean t = Boolean.TRUE;
View Full Code Here

      new BasicObjectEndpoint(
    endpoint,
    UuidFactory.create("57117a56-2750-11b2-b312-080020c9e4a1"),
    false);
  InvocationHandler invocationHandler =
      new BasicInvocationHandler(objectEndpoint, null);
  RemoteMethodControl proxy =
      (RemoteMethodControl) Proxy.newProxyInstance(
     TestConnectTimeout.class.getClassLoader(),
     new Class[] { Ping.class, RemoteMethodControl.class },
     invocationHandler);
View Full Code Here

        InvocationConstraint[] server1;
        InvocationConstraint[] server2;
        FakeObjectEndpoint oe1 = new FakeObjectEndpoint();
        FakeObjectEndpoint oe2 = new FakeTrustedObjectEndpoint(false);
        FakeObjectEndpoint oe3 = new FakeTrustedObjectEndpoint(true);
        BasicInvocationHandler handler1;
        BasicInvocationHandler handler2;
        TrustEquivalence proxy1;
        TrustEquivalence proxy2;

        for (int i = 0; i < cases.length; i++) {
            proxyInterfaces1 = (Class[])cases[i][0];
            client1 = (InvocationConstraint[])cases[i][1];
            server1 = (InvocationConstraint[])cases[i][2];

            for (int j = 0; j < cases.length; j++) {
                proxyInterfaces2 = (Class[])cases[j][0];
                client2 = (InvocationConstraint[])cases[j][1];
                server2 = (InvocationConstraint[])cases[j][2];

                logger.log(Level.FINE,"=================================");
                logger.log(Level.FINE,"test case " + (counter++) + ": "
                    + "i=" + i + ",j=" + j
                    + ",ObjectEndpoint doesn't implement TrustEquivalence");
                logger.log(Level.FINE,"");

                handler1 = newHandler(oe1,client1,server1);
                handler2 = newHandler(oe1,client2,server2);
                proxy1 = newProxy(proxyInterfaces1,handler1);
                proxy2 = newProxy(proxyInterfaces2,handler2);

                // verify BasicInvocationHandler.invoke test cases
                assertion(! proxy1.checkTrustEquivalence(proxy2));
                assertion(! proxy2.checkTrustEquivalence(proxy1));
                // verify BasicInvocationHandler test cases
                assertion(! handler1.checkTrustEquivalence(handler2));
                assertion(! handler2.checkTrustEquivalence(handler1));

                logger.log(Level.FINE,"=================================");
                logger.log(Level.FINE,"test case " + (counter++) + ": "
                    + "i=" + i + ",j=" + j
                    +",ObjectEndpoint.checkTrustEquivalence returns false");
                logger.log(Level.FINE,"");

                handler1 = newHandler(oe2,client1,server1);
                handler2 = newHandler(oe2,client2,server2);
                proxy1 = newProxy(proxyInterfaces1,handler1);
                proxy2 = newProxy(proxyInterfaces2,handler2);

                // verify BasicInvocationHandler.invoke test cases
                assertion(! proxy1.checkTrustEquivalence(proxy2));
                assertion(! proxy2.checkTrustEquivalence(proxy1));
                // verify BasicInvocationHandler test cases
                assertion(! handler1.checkTrustEquivalence(handler2));
                assertion(! handler2.checkTrustEquivalence(handler1));

                logger.log(Level.FINE,"=================================");
                logger.log(Level.FINE,"test case " + (counter++) + ": "
                    + "i=" + i + ",j=" + j
                    + ",ObjectEndpoint.checkTrustEquivalence returns true");
                logger.log(Level.FINE,"");

                handler1 = newHandler(oe3,client1,server1);
                handler2 = newHandler(oe3,client2,server2);
                proxy1 = newProxy(proxyInterfaces1,handler1);
                proxy2 = newProxy(proxyInterfaces2,handler2);

                if (i == j) {
                    // verify BasicInvocationHandler.invoke test cases
                    assertion(proxy1.checkTrustEquivalence(proxy2));
                    assertion(proxy2.checkTrustEquivalence(proxy1));
                    // verify BasicInvocationHandler test cases
                    assertion(handler1.checkTrustEquivalence(handler2));
                    assertion(handler2.checkTrustEquivalence(handler1));
                } else {
                    // verify BasicInvocationHandler.invoke test cases
                    assertion(! proxy1.checkTrustEquivalence(proxy2));
                    assertion(! proxy2.checkTrustEquivalence(proxy1));
                    // verify BasicInvocationHandler test cases
                    assertion(! handler1.checkTrustEquivalence(handler2));
                    assertion(! handler2.checkTrustEquivalence(handler1));
                }
            }//inner for loop
        }//outer for loop
    }
View Full Code Here

    }

    private BasicInvocationHandler newHandler(FakeObjectEndpoint oe,
        InvocationConstraint[] client, InvocationConstraint[] server)
    {
        return new BasicInvocationHandler(
            new BasicInvocationHandler(oe, new FakeMethodConstraints(server)),
            new FakeMethodConstraints(client));
    }
View Full Code Here

     *
     * @param interfaces array of interface, one must be Remote
     * @param oe the endpoint with which to create the BasicInvocationHandler
     */
    private Remote createImpl(Class[] interfaces, ObjectEndpoint oe) {
        BasicInvocationHandler handler =
            new BasicInvocationHandler(oe,new FakeMethodConstraints(null));
        return (Remote) Proxy.newProxyInstance(
            this.getClass().getClassLoader(),
            interfaces,
            handler);
    }
View Full Code Here

TOP

Related Classes of net.jini.jeri.BasicInvocationHandler

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.