Examples of BasicObjectEndpoint


Examples of net.jini.jeri.BasicObjectEndpoint

  super.registerRefs(endpoint, refs);
    }

    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

Examples of net.jini.jeri.BasicObjectEndpoint

    protected void freeEndpoint(Object endpoint) {
  // we don't need to do anything special for freed endpoints
    }

    protected Object getRefEndpoint(Object ref) {
  BasicObjectEndpoint oei = (BasicObjectEndpoint) ref;
  assert oei.getEnableDGC();
  return oei.getEndpoint();
    }
View Full Code Here

Examples of net.jini.jeri.BasicObjectEndpoint

  assert oei.getEnableDGC();
  return oei.getEndpoint();
    }

    protected Object getRefObjectID(Object ref) {
  BasicObjectEndpoint oei = (BasicObjectEndpoint) ref;
  assert oei.getEnableDGC();
  return oei.getObjectIdentifier();
    }
View Full Code Here

Examples of net.jini.jeri.BasicObjectEndpoint

      throw new RuntimeException("TEST FAILED: unexpected failure", e);
  }
    }

    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

Examples of net.jini.jeri.BasicObjectEndpoint

      }
        };
    }
      });
  ObjectEndpoint objectEndpoint =
      new BasicObjectEndpoint(
    endpoint,
    UuidFactory.create("57117a56-2750-11b2-b312-080020c9e4a1"),
    false);
  InvocationHandler invocationHandler =
      new BasicInvocationHandler(objectEndpoint, null);
View Full Code Here

Examples of net.jini.jeri.BasicObjectEndpoint

        logger.log(Level.FINE,"test case 1: "
            + "normal equals, hashCode, toString method calls");
        logger.log(Level.FINE,"");

        // construct two instances of BasicObjectEndpoint
        BasicObjectEndpoint boe1 = new BasicObjectEndpoint(ep1,uuid1,false);
        BasicObjectEndpoint boe2 = new BasicObjectEndpoint(ep1,uuid1,false);

        // verify BasicObjectEndpoint equals, hashCode, and toString methods
        assertion(! boe1.equals(null));
        assertion(boe1.equals(boe2));
        assertion(boe2.equals(boe1));
        assertion(boe1.equals(boe1));
        assertion(boe2.equals(boe2));
        assertion(boe1.hashCode() == boe2.hashCode());
        assertion(boe1.toString() != null);
        assertion(boe2.toString() != null);

        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case 2: "
            + "equals is false when contained Endpoints are different");
        logger.log(Level.FINE,"");

        boe2 = new BasicObjectEndpoint(ep2,uuid1,false);
        assertion(! boe1.equals(boe2));

        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case 3: "
            + "equals is false when contained Uuids are different");
        logger.log(Level.FINE,"");

        boe2 = new BasicObjectEndpoint(ep1,uuid2,false);
        assertion(! boe1.equals(boe2));

        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case 4: "
            + "equals is false when contained enableDGC are different");
        logger.log(Level.FINE,"");

        boe2 = new BasicObjectEndpoint(ep1,uuid1,true);
        assertion(! boe1.equals(boe2));

        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case 5: "
            + "equals is false with different ObjectEndpoint impl");
View Full Code Here

Examples of net.jini.jeri.BasicObjectEndpoint

  super.registerRefs(endpoint, refs);
    }

    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

Examples of net.jini.jeri.BasicObjectEndpoint

    protected void freeEndpoint(Object endpoint) {
  // we don't need to do anything special for freed endpoints
    }

    protected Object getRefEndpoint(Object ref) {
  BasicObjectEndpoint oei = (BasicObjectEndpoint) ref;
  assert oei.getEnableDGC();
  return oei.getEndpoint();
    }
View Full Code Here

Examples of net.jini.jeri.BasicObjectEndpoint

  assert oei.getEnableDGC();
  return oei.getEndpoint();
    }

    protected Object getRefObjectID(Object ref) {
  BasicObjectEndpoint oei = (BasicObjectEndpoint) ref;
  assert oei.getEnableDGC();
  return oei.getObjectIdentifier();
    }
View Full Code Here

Examples of net.jini.jeri.BasicObjectEndpoint

        FakeOutboundRequest fakeRequest = new FakeOutboundRequest();
        FakeOutboundRequestIterator iterator =
            new FakeOutboundRequestIterator(fakeRequest);
        FakeEndpoint ep = new FakeEndpoint(iterator);
        Uuid uuid = UuidFactory.create(1,2);
        BasicObjectEndpoint boe = new BasicObjectEndpoint(ep,uuid,false);

        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case " + (counter++)
            + ": reading response input stream throws IOException");
        logger.log(Level.FINE,"");

        // OutboundRequest.getResponseInputStream.read throws IOException

        fakeRequest.setResponseInputStream(
            new FakeInputStream(new IOException(),0));
        request = boe.newCall(InvocationConstraints.EMPTY).next();
        try {
            boe.executeCall(request);
            throw new AssertionError("executeCall() should fail");
        } catch (IOException ignore) {
        }

        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case " + (counter++)
            + ": reading response input stream returns -1 (EOF)");
        logger.log(Level.FINE,"");

        // OutboundRequest.getResponseInputStream.read returns -1

        iterator.init();
        fakeRequest.setResponseInputStream(new FakeInputStream(null,-1));

        request = boe.newCall(InvocationConstraints.EMPTY).next();
        try {
            boe.executeCall(request);
            throw new AssertionError("executeCall() should fail");
        } catch (EOFException ignore) {
        }
    }
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.