Examples of HeaderClientConnector


Examples of com.facebook.nifty.header.client.HeaderClientConnector

    private static void sendClientRequest(Injector clientInjector, int serverPort) throws InterruptedException, ExecutionException {
        ThriftClientManager clientManager = clientInjector.getInstance(ThriftClientManager.class);
        ThriftClient<HeaderUsageExampleClient> clientFactory = clientInjector.getInstance(Key.get(new TypeLiteral<ThriftClient<HeaderUsageExampleClient>>() {
        }));
        HeaderUsageExampleClient client = clientFactory.open(new HeaderClientConnector(HostAndPort.fromParts("localhost", serverPort))).get();

        TProtocol outputProtocol = clientManager.getOutputProtocol(client);
        TTransport outputTransport = outputProtocol.getTransport();
        if (outputTransport instanceof THeaderTransport) {
            LOG.info("adding headers to next client request");
View Full Code Here

Examples of com.facebook.nifty.header.client.HeaderClientConnector

                                  output.toString()));
    }

    public static NiftyClientConnector<? extends NiftyClientChannel> getConnector()
    {
        return new HeaderClientConnector(fromParts("localhost", 4567));
    }
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.