Tabnine Logo
ClientBootstrap.setPipelineFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
setPipelineFactory
method
in
org.jboss.netty.bootstrap.ClientBootstrap

Best Java code snippets using org.jboss.netty.bootstrap.ClientBootstrap.setPipelineFactory (Showing top 20 results out of 810)

origin: apache/incubator-druid

bootstrap.setPipelineFactory(new HttpClientPipelineFactory());
origin: MovingBlocks/Terasology

public ServerInfoService() {
  pool = Executors.newCachedThreadPool();
  factory = new NioClientSocketChannelFactory(pool, pool, 1, 1);
  bootstrap = new ClientBootstrap(factory);
  bootstrap.setPipelineFactory(new InfoRequestPipelineFactory());
  bootstrap.setOption("tcpNoDelay", true);
  bootstrap.setOption("keepAlive", true);
}
origin: apache/avro

bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
 @Override
 public ChannelPipeline getPipeline() throws Exception {
origin: alibaba/jstorm

public void start() {
  bootstrap = new ClientBootstrap(clientChannelFactory);
  bootstrap.setOption("tcpNoDelay", true);
  bootstrap.setOption("reuseAddress", true);
  bootstrap.setOption("sendBufferSize", bufferSize);
  bootstrap.setOption("keepAlive", true);
  // Set up the pipeline factory.
  bootstrap.setPipelineFactory(new StormClientPipelineFactory(this, stormConf));
  reconnect();
}
origin: menacher/java-game-server

synchronized (bootstrap)
  bootstrap.setPipelineFactory(pipelineFactory);
  future = bootstrap.connect(serverAddress);
  future.addListener(new ChannelFutureListener()
origin: apache/incubator-dubbo

@Override
protected void doOpen() throws Throwable {
  NettyHelper.setNettyLoggerFactory();
  bootstrap = new ClientBootstrap(channelFactory);
  // config
  // @see org.jboss.netty.channel.socket.SocketChannelConfig
  bootstrap.setOption("keepAlive", true);
  bootstrap.setOption("tcpNoDelay", true);
  bootstrap.setOption("connectTimeoutMillis", getConnectTimeout());
  final NettyHandler nettyHandler = new NettyHandler(getUrl(), this);
  bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
    @Override
    public ChannelPipeline getPipeline() {
      NettyCodecAdapter adapter = new NettyCodecAdapter(getCodec(), getUrl(), NettyClient.this);
      ChannelPipeline pipeline = Channels.pipeline();
      pipeline.addLast("decoder", adapter.getDecoder());
      pipeline.addLast("encoder", adapter.getEncoder());
      pipeline.addLast("handler", nettyHandler);
      return pipeline;
    }
  });
}
origin: apache/incubator-dubbo

@Override
protected void doOpen() throws Throwable {
  NettyHelper.setNettyLoggerFactory();
  bootstrap = new ClientBootstrap(channelFactory);
  // config
  // @see org.jboss.netty.channel.socket.SocketChannelConfig
  bootstrap.setOption("keepAlive", true);
  bootstrap.setOption("tcpNoDelay", true);
  bootstrap.setOption("connectTimeoutMillis", getConnectTimeout());
  final NettyHandler nettyHandler = new NettyHandler(getUrl(), this);
  bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
    @Override
    public ChannelPipeline getPipeline() {
      NettyCodecAdapter adapter = new NettyCodecAdapter(getCodec(), getUrl(), NettyClient.this);
      ChannelPipeline pipeline = Channels.pipeline();
      pipeline.addLast("decoder", adapter.getDecoder());
      pipeline.addLast("encoder", adapter.getEncoder());
      pipeline.addLast("handler", nettyHandler);
      return pipeline;
    }
  });
}
origin: MovingBlocks/Terasology

bootstrap.setPipelineFactory(new TerasologyClientPipelineFactory(this));
bootstrap.setOption("tcpNoDelay", true);
bootstrap.setOption("keepAlive", true);
origin: weibocom/motan

    URLParamType.maxContentLength.getIntValue());
bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
  @Override
  public ChannelPipeline getPipeline() {
origin: com.ning/async-http-client

wsProcessor = new Processor(config, this, requestSender, wsProtocol);
plainBootstrap.setPipelineFactory(new ChannelPipelineFactory() {
webSocketBootstrap.setPipelineFactory(new ChannelPipelineFactory() {
secureBootstrap.setPipelineFactory(new ChannelPipelineFactory() {
secureWebSocketBootstrap.setPipelineFactory(new ChannelPipelineFactory() {
origin: eBay/parallec

/**
 * Creates the tcpClient with proper handler.
 *
 * @return the bound request builder
 * @throws HttpRequestCreateException
 *             the http request create exception
 */
public ClientBootstrap bootStrapTcpClient()
    throws HttpRequestCreateException {
  ClientBootstrap tcpClient = null;
  try {
    // Configure the client.
    tcpClient = new ClientBootstrap(tcpMeta.getChannelFactory());
    // Configure the pipeline factory.
    tcpClient.setPipelineFactory(new MyPipelineFactory(TcpUdpSshPingResourceStore.getInstance().getTimer(),
        this, tcpMeta.getTcpIdleTimeoutSec())
    );
    tcpClient.setOption("connectTimeoutMillis",
        tcpMeta.getTcpConnectTimeoutMillis());
    tcpClient.setOption("tcpNoDelay", true);
   // tcpClient.setOption("keepAlive", true);
  } catch (Exception t) {
    throw new TcpUdpRequestCreateException(
        "Error in creating request in Tcpworker. "
            + " If tcpClient is null. Then fail to create.", t);
  }
  return tcpClient;
}
origin: com.couchbase.client/couchbase-client

protected ChannelFuture createChannel() {
 // Configure the client.
 bootstrap = new ClientBootstrap(factory);
 // Set up the event pipeline factory.
 bootstrap.setPipelineFactory(new BucketMonitorPipelineFactory());
 // Start the connection attempt.
 return bootstrap.connect(new InetSocketAddress(host, port));
}
origin: ksfzhaohui/gserver

private void createBootStrap() {
  bootstrap = new ClientBootstrap(new NioClientSocketChannelFactory(
      Executors.newCachedThreadPool(),
      Executors.newCachedThreadPool()));
  bootstrap.setPipelineFactory(createPipelineFactory());
}
origin: lihengming/java-codes

public static void main(String args[]) {
  // Client服务启动器
  ClientBootstrap bootstrap = new ClientBootstrap(
      new NioClientSocketChannelFactory(
          Executors.newCachedThreadPool(),
          Executors.newCachedThreadPool()));
  // 设置一个处理服务端消息和各种消息事件的类(Handler)
  bootstrap.setPipelineFactory(() -> Channels.pipeline(new HelloClientHandler()));
  // 连接到本地的8000端口的服务端
  bootstrap.connect(new InetSocketAddress("127.0.0.1", 8000));
}
origin: geertvos/gossip

/**
 * Create a server for this cluster.
 * @param cluster
 */
public GossipServer(GossipCluster cluster) {
  this.cluster = cluster;
  
  serverBootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(Executors.newFixedThreadPool(1), Executors.newFixedThreadPool(8)));
  serverBootstrap.setPipelineFactory(new GossipPipelineFactory(cluster,false));
  clientBootstrap = new ClientBootstrap(new NioClientSocketChannelFactory(Executors.newFixedThreadPool(1), Executors.newFixedThreadPool(8)));
  clientBootstrap.setPipelineFactory(new GossipPipelineFactory(cluster,true));
  
}

origin: net.anthavio/hatatitla

public NettyTransport(SenderConfigurer config, ExecutorService executor) {
  client = new ClientBootstrap(new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),
      Executors.newCachedThreadPool()));
  client.setOption("connectTimeoutMillis", 10000);
  client.setOption("keepAlive", true);
  client.setPipelineFactory(new HttpClientPipelineFactory(true));
  channels = new DefaultChannelGroup();
}
origin: net.sourceforge.openutils/flazr

private static ClientBootstrap getBootstrap(final Executor executor, final ClientOptions options) {
  final ChannelFactory factory = new NioClientSocketChannelFactory(executor, executor);
  final ClientBootstrap bootstrap = new ClientBootstrap(factory);
  bootstrap.setPipelineFactory(new ClientPipelineFactory(options));
  bootstrap.setOption("tcpNoDelay" , true);
  bootstrap.setOption("keepAlive", true);
  return bootstrap;
}
origin: org.jboss.ws.native/jbossws-native-core

private NettyTransportHandler(URL url, ChannelPipelineFactory pipelineFactory)
{
 this.url = url;
 ChannelFactory factory = factoryProvider.getClientSocketChannelFactoryInstance();
 ClientBootstrap bootstrap = new ClientBootstrap(factory);
 bootstrap.setPipelineFactory(pipelineFactory);
 
 //Start the connection attempt
 bootstrap.setOption("tcpNoDelay", true);
 connectFuture = bootstrap.connect(getSocketAddress(url));
}
origin: net.sourceforge.openutils/openutils-mgnlmedia

private static ClientBootstrap getBootstrap(final Executor executor, final ClientOptions options)
{
  final ChannelFactory factory = new NioClientSocketChannelFactory(executor, executor);
  final ClientBootstrap bootstrap = new ClientBootstrap(factory);
  bootstrap.setPipelineFactory(new ClientPipelineFactory(options));
  bootstrap.setOption("tcpNoDelay", true);
  bootstrap.setOption("keepAlive", true);
  return bootstrap;
}
origin: com.alibaba.jstorm/jstorm-core

public void start() {
  bootstrap = new ClientBootstrap(clientChannelFactory);
  bootstrap.setOption("tcpNoDelay", true);
  bootstrap.setOption("reuseAddress", true);
  bootstrap.setOption("sendBufferSize", bufferSize);
  bootstrap.setOption("keepAlive", true);
  // Set up the pipeline factory.
  bootstrap.setPipelineFactory(new StormClientPipelineFactory(this, stormConf));
  reconnect();
}
org.jboss.netty.bootstrapClientBootstrapsetPipelineFactory

Popular methods of ClientBootstrap

  • connect
    Attempts a new connection with the specified remoteAddress and the specified localAddress. If the sp
  • <init>
    Creates a new instance with the specified initial ChannelFactory.
  • setOption
  • releaseExternalResources
  • getPipeline
  • getFactory
  • setOptions
  • getOption
  • getOptions
  • shutdown
  • getPipelineFactory
  • setPipeline
  • getPipelineFactory,
  • setPipeline,
  • setFactory

Popular in Java

  • Finding current android device location
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • getSystemService (Context)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Socket (java.net)
    Provides a client-side TCP socket.
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now