Package org.apache.avro.ipc.specific

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


  @Test
  public void cancelPendingRequestsOnTransceiverClose() throws Exception {
    // Start up a second server so that closing the server doesn't
    // interfere with the other unit tests:
    BlockingSimpleImpl blockingSimpleImpl = new BlockingSimpleImpl();
    Server server2 = new NettyServer(new SpecificResponder(Simple.class,
        blockingSimpleImpl), new InetSocketAddress(0));
    server2.start();
    try {
      int serverPort = server2.getPort();
      System.out.println("server2 port : " + serverPort);
View Full Code Here


  @BeforeClass
  public static void initializeConnections()throws Exception {
    // start server
    System.out.println("starting server...");
    mailService = new MailImpl();
    Responder responder = new SpecificResponder(Mail.class, mailService);
    server = new NettyServer(responder, new InetSocketAddress(0));
    server.start();
 
    int serverPort = server.getPort();
    System.out.println("server port : " + serverPort);
View Full Code Here

  public TetherTaskRunner(TetherTask task) throws IOException {
    this.task = task;

    // start input server
    this.inputServer = new SaslSocketServer
      (new SpecificResponder(InputProtocol.class, this),
       new InetSocketAddress(0));
    inputServer.start();

    // open output to parent
    task.open(inputServer.getPort());
View Full Code Here

  private static Simple simpleService = new SimpleImpl(ackFlag);
 
  @BeforeClass
  public static void initializeConnections() throws Exception {
    // start server
    Responder responder = new SpecificResponder(Simple.class, simpleService);
    server = new NettyServer(responder, new InetSocketAddress(0));
    server.start();
 
    int serverPort = server.getPort();
    System.out.println("server port : " + serverPort);
View Full Code Here

 
  @Test
  public void testSendAfterChannelClose() throws Exception {
    // Start up a second server so that closing the server doesn't
    // interfere with the other unit tests:
    Server server2 = new NettyServer(new SpecificResponder(Simple.class, simpleService),
        new InetSocketAddress(0));
    server2.start();
    try {
      int serverPort = server2.getPort();
      System.out.println("server2 port : " + serverPort);
View Full Code Here

  @Test
  public void cancelPendingRequestsOnTransceiverClose() throws Exception {
    // Start up a second server so that closing the server doesn't
    // interfere with the other unit tests:
    BlockingSimpleImpl blockingSimpleImpl = new BlockingSimpleImpl();
    Server server2 = new NettyServer(new SpecificResponder(Simple.class,
        blockingSimpleImpl), new InetSocketAddress(0));
    server2.start();
    try {
      int serverPort = server2.getPort();
      System.out.println("server2 port : " + serverPort);
View Full Code Here

    // the request, and before it returned the response).

    // Start up a second server so that closing the server doesn't
    // interfere with the other unit tests:
    BlockingSimpleImpl blockingSimpleImpl = new BlockingSimpleImpl();
    Server server2 = new NettyServer(new SpecificResponder(Simple.class,
        blockingSimpleImpl), new InetSocketAddress(0));
    server2.start();

    Transceiver transceiver2 = null;
View Full Code Here

  @Test
  public void clientReconnectAfterServerRestart() throws Exception {
    // Start up a second server so that closing the server doesn't
    // interfere with the other unit tests:
    SimpleImpl simpleImpl = new BlockingSimpleImpl();
    Server server2 = new NettyServer(new SpecificResponder(Simple.class,
        simpleImpl), new InetSocketAddress(0));
    try {     
      server2.start();
      int serverPort = server2.getPort();
      System.out.println("server2 port : " + serverPort);

      // Initialize a client, and establish a connection to the server:
      Transceiver transceiver2 = new NettyTransceiver(new InetSocketAddress(
          serverPort), TestNettyServer.CONNECT_TIMEOUT_MILLIS);
      Simple.Callback simpleClient2 =
          SpecificRequestor.getClient(Simple.Callback.class, transceiver2);
      Assert.assertEquals(3, simpleClient2.add(1, 2));
     
      // Restart the server:
      server2.close();
      try {
        simpleClient2.add(2, -1);
        Assert.fail("Client should not be able to invoke RPCs " +
            "because server is no longer running");
      } catch (Exception e) {
        // Expected since server is no longer running
      }
      Thread.sleep(2000L);
      server2 = new NettyServer(new SpecificResponder(Simple.class,
          simpleImpl), new InetSocketAddress(serverPort));
      server2.start();
     
      // Invoke an RPC using the same client, which should reestablish the
      // connection to the server:
View Full Code Here

  @BeforeClass
  public static void initializeConnections()throws Exception {
    // start server
    System.out.println("starting server...");
    mailService = new MailImpl();
    Responder responder = new SpecificResponder(Mail.class, mailService);
    server = new NettyServer(responder, new InetSocketAddress(0));
    server.start();
 
    int serverPort = server.getPort();
    System.out.println("server port : " + serverPort);
View Full Code Here

 
  @Test(timeout=30000)
  public void test() throws Exception {
    final CountDownLatch waitLatch = new CountDownLatch(1);
    server = new NettyServer(
        new SpecificResponder(Simple.class, new SimpleImpl(waitLatch)),
        new InetSocketAddress(0),
        new NioServerSocketChannelFactory
          (Executors.newCachedThreadPool(), Executors.newCachedThreadPool()),
        new ExecutionHandler(Executors.newCachedThreadPool()));
    server.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.