Package org.apache.avro.ipc.specific

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


public class AvroNettyConsumerTest extends AvroConsumerTestSupport {

    @Override
    protected void initializeTranceiver() throws IOException {
        transceiver = new NettyTransceiver(new InetSocketAddress("localhost", avroPort));
        requestor = new SpecificRequestor(KeyValueProtocol.class, transceiver);

        transceiverMessageInRoute = new NettyTransceiver(new InetSocketAddress("localhost", avroPortMessageInRoute));
        requestorMessageInRoute = new SpecificRequestor(KeyValueProtocol.class, transceiverMessageInRoute);

        transceiverForWrongMessages = new NettyTransceiver(new InetSocketAddress("localhost", avroPortForWrongMessages));
        requestorForWrongMessages = new SpecificRequestor(KeyValueProtocol.class, transceiverForWrongMessages);

        reflectTransceiver = new NettyTransceiver(new InetSocketAddress("localhost", avroPortReflection));
        reflectRequestor = new ReflectRequestor(TestReflection.class, reflectTransceiver);
    }
View Full Code Here


public class AvroHttpConsumerTest extends AvroConsumerTestSupport {

    @Override
    protected void initializeTranceiver() throws IOException {
        transceiver = new HttpTransceiver(new URL("http://localhost:" + avroPort));
        requestor = new SpecificRequestor(KeyValueProtocol.class, transceiver);

        transceiverMessageInRoute = new HttpTransceiver(new URL("http://localhost:" + avroPortMessageInRoute));
        requestorMessageInRoute = new SpecificRequestor(KeyValueProtocol.class, transceiverMessageInRoute);

        transceiverForWrongMessages = new HttpTransceiver(new URL("http://localhost:" + avroPortForWrongMessages));
        requestorForWrongMessages = new SpecificRequestor(KeyValueProtocol.class, transceiverForWrongMessages);

        reflectTransceiver = new HttpTransceiver(new URL("http://localhost:" + avroPortReflection));
        reflectRequestor = new ReflectRequestor(TestReflection.class, reflectTransceiver);
    }
View Full Code Here

public class AvroNettyConsumerTest extends AvroConsumerTestSupport {

    @Override
    protected void initializeTranceiver() throws IOException {
        transceiver = new NettyTransceiver(new InetSocketAddress("localhost", avroPort));
        requestor = new SpecificRequestor(KeyValueProtocol.class, transceiver);
    }
View Full Code Here

public class AvroHttpConsumerTest extends AvroConsumerTestSupport {

    @Override
    protected void initializeTranceiver() throws IOException {
        transceiver = new HttpTransceiver(new URL("http://localhost:" + avroPort));
        requestor = new SpecificRequestor(KeyValueProtocol.class, transceiver);
    }
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

    responder = new SpecificResponder(Simple.class, new TestImpl());
    server = createServer(responder);
    server.start();
   
    client = createTransceiver();
    SpecificRequestor req = new SpecificRequestor(Simple.class, client);
    addRpcPlugins(req);
    proxy = SpecificRequestor.getClient(Simple.class, (SpecificRequestor)req);
   
    monitor = new HandshakeMonitor();
    responder.addRPCPlugin(monitor);
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

@InterfaceStability.Evolving
public class AvroSpecificRpcEngine extends AvroRpcEngine {

  protected SpecificRequestor createRequestor(Class<?> protocol,
      Transceiver transeiver) throws IOException {
    return new SpecificRequestor(protocol, transeiver);
  }
View Full Code Here

    } catch(IOException e) {
      throw new SparqlException("Socket error connecting client", e);
    }
   
    try {
      requestor = new SpecificRequestor(SherpaServer.class, transceiver);
    } catch (IOException e) {
      throw new SparqlException("Error creating client requestor", e);
    }

    try {
View Full Code Here

    DummySherpaServer server = new DummySherpaServer(resultRows);
    InetSocketAddress serverAddress = server.getAddress();
   
    try {
      Transceiver tr = new SaslSocketTransceiver(serverAddress);
      SpecificRequestor requestor = new SpecificRequestor(SherpaServer.class, tr);
      SherpaServer queryApi = SpecificRequestor.getClient(SherpaServer.class, requestor);
      QueryExecution protocol = new QueryExecution(queryApi);

      protocol.query("fake command",null,null);     
     
View Full Code Here

TOP

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

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.