Package org.apache.avro.ipc

Examples of org.apache.avro.ipc.HttpTransceiver


    return new HttpServer(testResponder, connector);
  }
 
  @Override
  public Transceiver createTransceiver() throws Exception{
    return new HttpTransceiver(new URL("https://localhost:"+server.getPort()+"/"));
  }
View Full Code Here


    return new HttpServer(testResponder, 0);
  }
 
  @Override
  public Transceiver createTransceiver() throws Exception{
    return new HttpTransceiver(new URL("http://127.0.0.1:"+server.getPort()+"/"));
  }
View Full Code Here

  }

  @Test(expected=SocketTimeoutException.class)
    public void testTimeout() throws Throwable {
    ServerSocket s = new ServerSocket(0);
    HttpTransceiver client =
      new HttpTransceiver(new URL("http://127.0.0.1:"+s.getLocalPort()+"/"));
    client.setTimeout(100);
    Simple proxy = SpecificRequestor.getClient(Simple.class, client);
    try {
      proxy.hello("foo");
    } catch (AvroRemoteException e) {
      throw e.getCause();
View Full Code Here

    }
  }
 
  @Test(expected = Exception.class)
  public void testConnectionRefusedOneWay() throws IOException {
    Transceiver client = new HttpTransceiver(new URL("http://localhost:4444"));
    SpecificRequestor req = new SpecificRequestor(Simple.class, client);
    addRpcPlugins(req);
    Simple proxy = SpecificRequestor.getClient(Simple.class, (SpecificRequestor)req);
    proxy.ack();
  }
View Full Code Here

  /** Sends RPCs and returns nanos elapsed. */
  private static long sendRpcs(boolean withPlugin) throws IOException {
    HttpServer server = createServer(withPlugin);
    Transceiver t =
      new HttpTransceiver(new URL("http://127.0.0.1:"+server.getPort()+"/"));
    GenericRequestor requestor = new GenericRequestor(NULL_PROTOCOL, t);

    long now = System.nanoTime();
    for (int i = 0; i < COUNT; ++i) {
      requestor.request("null", null);
    }
    long elapsed = System.nanoTime() - now;
    t.close();
    server.close();
    return elapsed;
  }
View Full Code Here

    Protocol protocol;
   
    public RecursingResponder(Protocol local, RPCPlugin plugin)
    throws Exception {
      super(local);
      transC = new HttpTransceiver(
          new URL("http://localhost:21006"));
      transD = new HttpTransceiver(
          new URL("http://localhost:21007"));
      reqC = new GenericRequestor(local, transC);
      reqC.addRPCPlugin(plugin);
      reqD = new GenericRequestor(local, transD);
      reqD.addRPCPlugin(plugin);
View Full Code Here

    res.addRPCPlugin(responderPlugin);
   
    HttpServer server = new HttpServer(res, 50000);
    server.start();
   
    HttpTransceiver trans = new HttpTransceiver(
        new URL("http://localhost:50000"));
   
    GenericRequestor r = new GenericRequestor(protocol, trans);
    r.addRPCPlugin(requestorPlugin);
   
View Full Code Here

    dRes.addRPCPlugin(dPlugin);
    HttpServer server3 = new HttpServer(dRes, 21007);
    server3.start();
   
    // Root requestor
    HttpTransceiver trans = new HttpTransceiver(
        new URL("http://localhost:21005"));
   
    GenericRequestor r = new GenericRequestor(advancedProtocol, trans);
    r.addRPCPlugin(aPlugin);
   
View Full Code Here

    HttpServer server3 = new HttpServer(dRes, 21007);
    server3.start();
   
   
    // Root requestors
    HttpTransceiver trans1 = new HttpTransceiver(
        new URL("http://localhost:21005")); // recurse
    HttpTransceiver trans2 = new HttpTransceiver(
        new URL("http://localhost:21007")); // no recurse
   
   
    GenericRequestor r1 = new GenericRequestor(advancedProtocol, trans1);
    r1.addRPCPlugin(aPlugin);
View Full Code Here

    Protocol protocol;
   
    public RecursingResponder(Protocol local, RPCPlugin plugin)
    throws Exception {
      super(local);
      transC = new HttpTransceiver(
          new URL("http://localhost:21006"));
      transD = new HttpTransceiver(
          new URL("http://localhost:21007"));
      reqC = new GenericRequestor(local, transC);
      reqC.addRPCPlugin(plugin);
      reqD = new GenericRequestor(local, transD);
      reqD.addRPCPlugin(plugin);
View Full Code Here

TOP

Related Classes of org.apache.avro.ipc.HttpTransceiver

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.