Package net.jini.jeri

Examples of net.jini.jeri.Endpoint.newRequest()


  Thread t = new Thread(new Runnable() {
      public void run() {
    try {
        System.err.println(
      "Initiating first request asynchronously:");
        ep.newRequest(InvocationConstraints.EMPTY).next();
        System.err.println("First request initiated.");
    } catch (IOException e) {
        e.printStackTrace();
    }
      }
View Full Code Here


   * socket; this request should use a normal socket and thus it
   * should return quickly.  If not, then the test will hang
   * (and time out, if run in the harness).
   */
  System.err.println("Initiating second request:");
  ep.newRequest(InvocationConstraints.EMPTY).next();
  System.err.println("Second request initiated.");

  System.err.println("TEST PASSED");
    }

View Full Code Here

      getEndpoint(new PrearrangedSocketFactory(socket), constraints);
  ConnManagerFactoryImpl factory = new ConnManagerFactoryImpl();
  endpointInternals.setConnManagerFactory(ep, factory);
  endpointInternals.disableSocketConnect(ep);

  OutboundRequestIterator iter = ep.newRequest(constraints);
  ConnectionInfo ci = factory.getConnectionInfo();
  if (ci != null) {
      return ci;
  }
View Full Code Here

      {
    return lep.listen(new Dispatcher()).getCookie();
      }
  });
  for (int i = 0; i < 300; i++) {
      ep.newRequest(InvocationConstraints.EMPTY).next();
  }
    }
}
View Full Code Here

  System.err.println("\nTesting " + method + ":");
  for (Iterator i = testCases.entrySet().iterator(); i.hasNext();) {
      Map.Entry entry = (Map.Entry) i.next();
      InvocationConstraints c = (InvocationConstraints) entry.getKey();
      System.err.println("  trying: " + c);
      OutboundRequestIterator iter = endpoint.newRequest(c);
      OutboundRequest request = iter.next();
      InvocationConstraints u = request.getUnfulfilledConstraints();
      System.err.println("returned: " + u);
      if (!entry.getValue().equals(u)) {
    throw new RuntimeException(
View Full Code Here

        GetDeliveryContext lc = new GetDeliveryContext(dispatcher);
        Endpoint e =
            se.enumerateListenEndpoints(lc);
        dispatcher.accept();
        OutboundRequestIterator ori =
            e.newRequest(InvocationConstraints.EMPTY);
        OutboundRequest or = null;
        while (ori.hasNext()) {
            or = ori.next();
            ObjectOutputStream oos = new ObjectOutputStream(
                or.getRequestOutputStream());
View Full Code Here

        while (it.hasNext()){
            ((EndpointHolder)it.next()).getListenHandle().close();
        }
        dispatcher.reject();
        try {
            ori = e.newRequest(InvocationConstraints.EMPTY);
            while (ori.hasNext()) {
                or = ori.next();
                ObjectOutputStream oos = new ObjectOutputStream(
                    or.getRequestOutputStream());
                oos.writeInt(2);
View Full Code Here

        endpoint = getServerEndpoint();
        context = new SETContext();
        Endpoint ep = endpoint.enumerateListenEndpoints(context);
        exceptionThrown = false;
        try {
            ep.newRequest(null);
        } catch (NullPointerException e) {
            exceptionThrown = true;
        }
        if (!exceptionThrown) {
            throw new TestException("Passing in null to"
View Full Code Here

        //Verify OutboundRequest.populateContext(null)
        endpoint = getServerEndpoint();
        context = new SETContext();
        ep = endpoint.enumerateListenEndpoints(context);
        OutboundRequestIterator it =
            ep.newRequest(InvocationConstraints.EMPTY);
        while (it.hasNext()) {
            exceptionThrown = false;
            try {
                it.next().populateContext(null);
            } catch (NullPointerException e) {
View Full Code Here

        Endpoint e =
            se.enumerateListenEndpoints(lc);
        dispatcher.reject();
        try {
            OutboundRequestIterator ori =
                e.newRequest(InvocationConstraints.EMPTY);
            while (ori.hasNext()){
                OutboundRequest or = ori.next();
                ObjectOutputStream oos = new ObjectOutputStream(
                    or.getRequestOutputStream());
                oos.writeInt(1);
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.