Package org.apache.avro.ipc.specific

Examples of org.apache.avro.ipc.specific.SpecificResponder


  protected static TestNamespace proxy;

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


 
  @Test
  public void testRpcPluginOrdering() throws Exception {
    OrderPlugin plugin = new OrderPlugin();
   
    SpecificResponder responder = new SpecificResponder(Mail.class, new TestMailImpl());
    SpecificRequestor requestor = new SpecificRequestor(Mail.class, new LocalTransceiver(responder));
    responder.addRPCPlugin(plugin);
    requestor.addRPCPlugin(plugin);
   
    Mail client = SpecificRequestor.getClient(Mail.class, requestor);
    Message message = createTestMessage();
    client.send(message);
View Full Code Here

  protected static HandshakeMonitor monitor;

  @Before
  public void testStartServer() throws Exception {
    if (server != null) return;
    responder = new SpecificResponder(Simple.class, new TestImpl());
    server = createServer(responder);
    server.start();
   
    client = createTransceiver();
    SpecificRequestor req = new SpecificRequestor(Simple.class, client);
View Full Code Here

    /**
     * Starts the RPC server.
     */
    public static void main(String[] args) throws Exception {
      SocketServer server = new SocketServer(
          new SpecificResponder(Simple.class, new TestImpl()),
          new InetSocketAddress(0));
      server.start();
      File portFile = new File(SERVER_PORTS_DIR, "java-port");
      FileWriter w = new FileWriter(portFile);
      w.write(Integer.toString(server.getPort()));
View Full Code Here

    switch(proto) {
    case SASL:
      // start input server
      this.inputServer = new SaslSocketServer
      (new SpecificResponder(InputProtocol.class, this),
          iaddress);
      LOG.info("Started SaslSocketServer on port:"+iaddress.getPort());
      break;

    case HTTP:
      this.inputServer=new  HttpServer
      (new SpecificResponder(InputProtocol.class, this),
          iaddress.getPort());

      LOG.info("Started HttpServer on port:"+iaddress.getPort());
      break;
    }
View Full Code Here

public class TestNettyTransceiverWhenServerStops {
//  @Test                                           // disable flakey test!
    public void testNettyTransceiverWhenServerStops() throws Exception {
    Mail mailService = new TestNettyServer.MailImpl();
    Responder responder = new SpecificResponder(Mail.class, mailService);
    NettyServer server = new NettyServer(responder, new InetSocketAddress(0));
    server.start();

    int serverPort = server.getPort();
View Full Code Here

      InetSocketAddress iaddress;
      switch (proto) {
      case SASL:
        iaddress=new InetSocketAddress(0);
        this.outputServer = new SaslSocketServer
            (new SpecificResponder(OutputProtocol.class, outputService),
                iaddress);
        break;
      case HTTP:
        iaddress=new InetSocketAddress(0);
        //set it up for http
        this.outputServer= new  HttpServer
            (new SpecificResponder(OutputProtocol.class, outputService),
                iaddress.getPort());
        break;
      case NONE:
      default:
        throw new RuntimeException("No transport protocol was specified in the job configuraiton");
View Full Code Here

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

  protected Responder createResponder(Class<?> iface, Object impl) {
    return new SpecificResponder(iface, impl);
  }
View Full Code Here

        private final NettyServer nettyServer;


        public EventCollector(int port) {
            Responder responder = new SpecificResponder(AvroSourceProtocol.class, this);
            nettyServer = new NettyServer(responder, new InetSocketAddress(HOSTNAME, port));
            nettyServer.start();
        }
View Full Code Here

        private final NettyServer nettyServer;


        public EventCollector(int port) {
            Responder responder = new SpecificResponder(AvroSourceProtocol.class, this);
            nettyServer = new NettyServer(responder, new InetSocketAddress(HOSTNAME, port));
            nettyServer.start();
        }
View Full Code Here

TOP

Related Classes of org.apache.avro.ipc.specific.SpecificResponder

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.