Codota Logo
ClientBootstrap.getFactory
Code IndexAdd Codota to your IDE (free)

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

Best Java code snippets using org.jboss.netty.bootstrap.ClientBootstrap.getFactory (Showing top 13 results out of 315)

  • Common ways to obtain ClientBootstrap
private void myMethod () {
ClientBootstrap c =
  • Codota IconChannelFactory channelFactory;new ClientBootstrap(channelFactory)
  • Codota Iconnew ClientBootstrap(new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()))
  • Codota Iconnew ClientBootstrap(new NioClientSocketChannelFactory(Executors.newSingleThreadExecutor(), Executors.newSingleThreadExecutor()))
  • Smart code suggestions by Codota
}
origin: io.netty/netty

Channel ch = getFactory().newChannel(pipeline);
boolean success = false;
try {
origin: io.netty/netty

Channel ch = getFactory().newChannel(pipeline);
boolean success = false;
try {
origin: cgbystrom/sockjs-netty

@Override
public ChannelFuture connect() throws URISyntaxException {
  this.sessionId = UUID.randomUUID().toString();
  URI sockJsUri = new URI("http", uri.getUserInfo(), uri.getHost(), uri.getPort(),
      uri.getPath() + "/999/" + sessionId + "/websocket", uri.getQuery(), uri.getFragment());
  this.wsHandshaker = new WebSocketClientHandshakerFactory().newHandshaker(
      sockJsUri, WebSocketVersion.V13, null, false, null);
  if (bootstrap.getFactory() instanceof LocalClientChannelFactory) {
    return bootstrap.connect(new LocalAddress(getPort(uri)));
  } else {
    return bootstrap.connect(new InetSocketAddress(uri.getHost(), getPort(uri)));
  }
}
origin: mconf/flazr

public static void connect(final ClientOptions options) {  
  final ClientBootstrap bootstrap = getBootstrap(Executors.newCachedThreadPool(), options);
  final ChannelFuture future = bootstrap.connect(new InetSocketAddress(options.getHost(), options.getPort()));
  future.awaitUninterruptibly();
  if(!future.isSuccess()) {
    // future.getCause().printStackTrace();
    logger.error("error creating client connection: {}", future.getCause().getMessage());
  }
  future.getChannel().getCloseFuture().awaitUninterruptibly(); 
  bootstrap.getFactory().releaseExternalResources();
}
origin: net.sourceforge.openutils/flazr

public static void connect(final ClientOptions options) {  
  final ClientBootstrap bootstrap = getBootstrap(Executors.newCachedThreadPool(), options);
  final ChannelFuture future = bootstrap.connect(new InetSocketAddress(options.getHost(), options.getPort()));
  future.awaitUninterruptibly();
  if(!future.isSuccess()) {
    // future.getCause().printStackTrace();
    logger.error("error creating client connection: {}", future.getCause().getMessage());
  }
  future.getChannel().getCloseFuture().awaitUninterruptibly(); 
  bootstrap.getFactory().releaseExternalResources();
}
origin: net.sourceforge.openutils/openutils-mgnlmedia

bootstrap.getFactory().releaseExternalResources();
origin: wg/lettuce

private <K, V, T extends RedisAsyncConnection<K, V>> T connect(CommandHandler<K, V> handler, T connection) {
  try {
    ConnectionWatchdog watchdog = new ConnectionWatchdog(bootstrap, channels, timer);
    ChannelPipeline pipeline = Channels.pipeline(watchdog, handler, connection);
    Channel channel = bootstrap.getFactory().newChannel(pipeline);
    ChannelFuture future = channel.connect((SocketAddress) bootstrap.getOption("remoteAddress"));
    future.await();
    if (!future.isSuccess()) {
      throw future.getCause();
    }
    watchdog.setReconnect(true);
    return connection;
  } catch (Throwable e) {
    throw new RedisException("Unable to connect", e);
  }
}
origin: nyankosama/simple-netty-source

Channel ch = getFactory().newChannel(pipeline);
boolean success = false;
try {
origin: com.lambdaworks/lettuce

private <K, V, T extends RedisAsyncConnection<K, V>> T connect(CommandHandler<K, V> handler, T connection) {
  try {
    ConnectionWatchdog watchdog = new ConnectionWatchdog(bootstrap, channels, timer);
    ChannelPipeline pipeline = Channels.pipeline(watchdog, handler, connection);
    Channel channel = bootstrap.getFactory().newChannel(pipeline);
    ChannelFuture future = channel.connect((SocketAddress) bootstrap.getOption("remoteAddress"));
    future.await();
    if (!future.isSuccess()) {
      throw future.getCause();
    }
    watchdog.setReconnect(true);
    return connection;
  } catch (Throwable e) {
    throw new RedisException("Unable to connect", e);
  }
}
origin: nyankosama/simple-netty-source

Channel ch = getFactory().newChannel(pipeline);
boolean success = false;
try {
origin: org.elasticsearch.plugin/transport-netty3-client

final TimeValue defaultConnectTimeout = defaultConnectionProfile.getConnectTimeout();
if (profile.getConnectTimeout() != null && profile.getConnectTimeout().equals(defaultConnectTimeout) == false) {
  clientBootstrap = new ClientBootstrap(this.clientBootstrap.getFactory());
  clientBootstrap.setPipelineFactory(this.clientBootstrap.getPipelineFactory());
  clientBootstrap.setOptions(this.clientBootstrap.getOptions());
origin: wg/lettuce

  /**
   * Reconnect to the remote address that the closed channel was connected to.
   * This creates a new {@link ChannelPipeline} with the same handler instances
   * contained in the old channel's pipeline.
   *
   * @param timeout Timer task handle.
   *
   * @throws Exception when reconnection fails.
   */
  @Override
  public void run(Timeout timeout) throws Exception {
    ChannelPipeline old = channel.getPipeline();
    CommandHandler<?, ?> handler = old.get(CommandHandler.class);
    RedisAsyncConnection<?, ?> connection = old.get(RedisAsyncConnection.class);
    ChannelPipeline pipeline = Channels.pipeline(this, handler, connection);

    Channel c = bootstrap.getFactory().newChannel(pipeline);
    c.getConfig().setOptions(bootstrap.getOptions());
    c.connect((SocketAddress) bootstrap.getOption("remoteAddress"));
  }
}
origin: com.lambdaworks/lettuce

  /**
   * Reconnect to the remote address that the closed channel was connected to.
   * This creates a new {@link ChannelPipeline} with the same handler instances
   * contained in the old channel's pipeline.
   *
   * @param timeout Timer task handle.
   *
   * @throws Exception when reconnection fails.
   */
  @Override
  public void run(Timeout timeout) throws Exception {
    ChannelPipeline old = channel.getPipeline();
    CommandHandler<?, ?> handler = old.get(CommandHandler.class);
    RedisAsyncConnection<?, ?> connection = old.get(RedisAsyncConnection.class);
    ChannelPipeline pipeline = Channels.pipeline(this, handler, connection);

    Channel c = bootstrap.getFactory().newChannel(pipeline);
    c.getConfig().setOptions(bootstrap.getOptions());
    c.connect((SocketAddress) bootstrap.getOption("remoteAddress"));
  }
}
org.jboss.netty.bootstrapClientBootstrapgetFactory

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.
  • setPipelineFactory
  • setOption
  • releaseExternalResources
  • getPipeline
  • setOptions
  • getOption
  • getOptions
  • shutdown
  • getPipelineFactory
  • setPipeline
  • getPipelineFactory,
  • setPipeline,
  • setFactory

Popular in Java

  • Start an intent from android
  • notifyDataSetChanged (ArrayAdapter)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JFileChooser (javax.swing)
  • JList (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now