Examples of ReflectResponder


Examples of org.apache.avro.ipc.reflect.ReflectResponder

  protected static Simple proxy;

  @Before
  public void testStartServer() throws Exception {
    if (server != null) return;
    server = new SocketServer(new ReflectResponder(Simple.class, new TestImpl()),
                              new InetSocketAddress(0));
    server.start();
    client = new SocketTransceiver(new InetSocketAddress(server.getPort()));
    proxy = ReflectRequestor.getClient(Simple.class, client);
  }
View Full Code Here

Examples of org.apache.avro.ipc.reflect.ReflectResponder

  }

  @Test public void testClassLoader() throws Exception {
    ClassLoader loader = new ClassLoader() {};

    ReflectResponder responder
      = new ReflectResponder(Simple.class, new TestImpl(),
                             new ReflectData(loader));
    assertEquals(responder.getReflectData().getClassLoader(), loader);

    ReflectRequestor requestor
      = new ReflectRequestor(Simple.class, client, new ReflectData(loader));
    assertEquals(requestor.getReflectData().getClassLoader(), loader);
  }
View Full Code Here

Examples of org.apache.avro.ipc.reflect.ReflectResponder

  // test big enough to fill socket output buffer
  @Test
  public void test64kRequest() throws Exception {
    SaslSocketServer s = new SaslSocketServer
      (new ReflectResponder(ProtoInterface.class, new ProtoInterface() {
        public byte[] test(byte[] b) { return b; }
      }), new InetSocketAddress(0));
    s.start();
    SaslSocketTransceiver client =
      new SaslSocketTransceiver(new InetSocketAddress(s.getPort()));
View Full Code Here

Examples of org.apache.avro.ipc.reflect.ReflectResponder

public class TestProtocolReflectMeta extends TestProtocolReflect {

  @Before @Override
  public void testStartServer() throws Exception {
    if (server != null) return;
    ReflectResponder rresp = new ReflectResponder(Simple.class, new TestImpl());
    rresp.addRPCPlugin(new RPCMetaTestPlugin("key1"));
    rresp.addRPCPlugin(new RPCMetaTestPlugin("key2"));
    server = new SocketServer(rresp, new InetSocketAddress(0));
    server.start();
   
    client = new SocketTransceiver(new InetSocketAddress(server.getPort()));
    ReflectRequestor requestor = new ReflectRequestor(Simple.class, client);
View Full Code Here

Examples of org.apache.avro.ipc.reflect.ReflectResponder

public class TestNamespaceReflect extends TestNamespaceSpecific {

  @Before @Override
  public void testStartServer() throws Exception {
    if (server != null) return;
    server = new SocketServer(new ReflectResponder(TestNamespace.class, new TestImpl()),
                              new InetSocketAddress(0));
    server.start();
    client = new SocketTransceiver(new InetSocketAddress(server.getPort()));
    proxy = ReflectRequestor.getClient(TestNamespace.class, client);
  }
View Full Code Here

Examples of org.apache.avro.ipc.reflect.ReflectResponder

  protected static Simple proxy;

  @Before
  public void testStartServer() throws Exception {
    if (server != null) return;
    server = new SocketServer(new ReflectResponder(Simple.class, new TestImpl()),
                              new InetSocketAddress(0));
    server.start();
    client = new SocketTransceiver(new InetSocketAddress(server.getPort()));
    proxy = ReflectRequestor.getClient(Simple.class, client);
  }
View Full Code Here

Examples of org.apache.avro.ipc.reflect.ReflectResponder

  // test big enough to fill socket output buffer
  @Test
  public void test64kRequest() throws Exception {
    SaslSocketServer s = new SaslSocketServer
      (new ReflectResponder(ProtoInterface.class, new ProtoInterface() {
        public byte[] test(byte[] b) { return b; }
      }), new InetSocketAddress(0));
    s.start();
    SaslSocketTransceiver client =
      new SaslSocketTransceiver(new InetSocketAddress(s.getPort()));
View Full Code Here

Examples of org.apache.avro.ipc.reflect.ReflectResponder

            server = new NettyServer(new SpecificResponder(KeyValueProtocol.PROTOCOL, keyValue), new InetSocketAddress("localhost", avroPort));
            server.start();
        }

        if (serverReflection == null) {
            serverReflection = new NettyServer(new ReflectResponder(TestReflection.class, testReflection), new InetSocketAddress("localhost", avroPortReflection));
            serverReflection.start();
        }
    }
View Full Code Here

Examples of org.apache.avro.ipc.reflect.ReflectResponder

            server = new HttpServer(new SpecificResponder(KeyValueProtocol.PROTOCOL, keyValue), avroPort);
            server.start();
        }
       
        if (serverReflection == null) {
            serverReflection = new HttpServer(new ReflectResponder(TestReflection.class, testReflection),
                                              avroPortReflection);
            serverReflection.start();
        }
    }
View Full Code Here

Examples of org.apache.avro.ipc.reflect.ReflectResponder

      Transceiver transeiver) throws IOException {
    return new ReflectRequestor(protocol, transeiver);
  }

  protected Responder createResponder(Class<?> iface, Object impl) {
    return new ReflectResponder(iface, impl);
  }
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.