Tabnine Logo
ChannelFuture.awaitUninterruptibly
Code IndexAdd Tabnine to your IDE (free)

How to use
awaitUninterruptibly
method
in
org.jboss.netty.channel.ChannelFuture

Best Java code snippets using org.jboss.netty.channel.ChannelFuture.awaitUninterruptibly (Showing top 20 results out of 747)

origin: org.apache.zookeeper/zookeeper

@Override
public void disableRecv() {
  disableRecvNoWait().awaitUninterruptibly();
}

origin: apache/incubator-druid

 @Override
 public void close(ChannelFuture resource)
 {
  log.trace("Closing");
  resource.awaitUninterruptibly().getChannel().close();
 }
}
origin: alibaba/jstorm

/**
 * close a channel
 */
protected void closeChannel(Channel channel) {
  MessageDecoder.removeTransmitHistogram(channel);
  channel.close().awaitUninterruptibly();
  allChannels.remove(channel);
}
origin: menacher/java-game-server

public synchronized void close()
{
  if (isClosed)
    return;
  ChannelFuture closeFuture = channel.close();
  closeFuture.awaitUninterruptibly();
  if (!closeFuture.isSuccess())
  {
    System.err.println("TCP channel " + channel.getId()
        + " did not close successfully");
  }
  isClosed = true;
}
origin: io.netty/netty

public ChannelGroupFuture disconnect() {
  Map<Integer, ChannelFuture> futures =
    new LinkedHashMap<Integer, ChannelFuture>(size());
  for (Channel c: serverChannels.values()) {
    futures.put(c.getId(), c.disconnect().awaitUninterruptibly());
  }
  for (Channel c: nonServerChannels.values()) {
    futures.put(c.getId(), c.disconnect());
  }
  return new DefaultChannelGroupFuture(this, futures);
}
origin: io.netty/netty

public ChannelGroupFuture close() {
  Map<Integer, ChannelFuture> futures =
    new LinkedHashMap<Integer, ChannelFuture>(size());
  for (Channel c: serverChannels.values()) {
    futures.put(c.getId(), c.close().awaitUninterruptibly());
  }
  for (Channel c: nonServerChannels.values()) {
    futures.put(c.getId(), c.close());
  }
  return new DefaultChannelGroupFuture(this, futures);
}
origin: io.netty/netty

public ChannelGroupFuture setInterestOps(int interestOps) {
  Map<Integer, ChannelFuture> futures =
    new LinkedHashMap<Integer, ChannelFuture>(size());
  for (Channel c: serverChannels.values()) {
    futures.put(c.getId(), c.setInterestOps(interestOps).awaitUninterruptibly());
  }
  for (Channel c: nonServerChannels.values()) {
    futures.put(c.getId(), c.setInterestOps(interestOps));
  }
  return new DefaultChannelGroupFuture(this, futures);
}
origin: io.netty/netty

public ChannelGroupFuture unbind() {
  Map<Integer, ChannelFuture> futures =
    new LinkedHashMap<Integer, ChannelFuture>(size());
  for (Channel c: serverChannels.values()) {
    futures.put(c.getId(), c.unbind().awaitUninterruptibly());
  }
  for (Channel c: nonServerChannels.values()) {
    futures.put(c.getId(), c.unbind());
  }
  return new DefaultChannelGroupFuture(this, futures);
}
origin: io.netty/netty

public ChannelGroupFuture setReadable(boolean readable) {
  Map<Integer, ChannelFuture> futures =
    new LinkedHashMap<Integer, ChannelFuture>(size());
  for (Channel c: serverChannels.values()) {
    futures.put(c.getId(), c.setReadable(readable).awaitUninterruptibly());
  }
  for (Channel c: nonServerChannels.values()) {
    futures.put(c.getId(), c.setReadable(readable));
  }
  return new DefaultChannelGroupFuture(this, futures);
}
origin: apache/incubator-druid

@Override
public boolean isGood(ChannelFuture resource)
{
 Channel channel = resource.awaitUninterruptibly().getChannel();
 boolean isSuccess = resource.isSuccess();
 boolean isConnected = channel.isConnected();
 boolean isOpen = channel.isOpen();
 if (log.isTraceEnabled()) {
  log.trace("isGood = isSucess[%s] && isConnected[%s] && isOpen[%s]", isSuccess, isConnected, isOpen);
 }
 return isSuccess && isConnected && isOpen;
}
origin: MovingBlocks/Terasology

@Override
public void disconnect() {
  super.disconnect();
  if (channel.isOpen()) {
    channel.close().awaitUninterruptibly();
  }
  WorldProvider worldProvider = CoreRegistry.get(WorldProvider.class);
  if (worldProvider != null) {
    worldProvider.unregisterListener(this);
  }
}
origin: io.netty/netty

/**
 * Creates a new channel which is bound to the specified local address. This operation will block until
 * the channel is bound.
 *
 * @return a new bound channel which accepts incoming connections
 *
 * @throws ChannelException
 *         if failed to create a new channel and
 *                      bind it to the local address
 */
public Channel bind(final SocketAddress localAddress) {
  ChannelFuture future = bindAsync(localAddress);
  // Wait for the future.
  future.awaitUninterruptibly();
  if (!future.isSuccess()) {
    future.getChannel().close().awaitUninterruptibly();
    throw new ChannelException("Failed to bind to: " + localAddress, future.getCause());
  }
  return future.getChannel();
}
origin: org.apache.zookeeper/zookeeper

@Override
public void shutdown() {
  LOG.info("shutdown called " + localAddress);
  if (login != null) {
    login.shutdown();
  }
  // null if factory never started
  if (parentChannel != null) {
    parentChannel.close().awaitUninterruptibly();
    closeAll();
    allChannels.close().awaitUninterruptibly();
    bootstrap.releaseExternalResources();
  }
  if (zkServer != null) {
    zkServer.shutdown();
  }
  synchronized(this) {
    killed = true;
    notifyAll();
  }
}

origin: alibaba/canal

public void stop() {
  super.stop();
  if (this.serverChannel != null) {
    this.serverChannel.close().awaitUninterruptibly(1000);
  }
  // close sockets explicitly to reduce socket channel hung in complicated
  // network environment.
  if (this.childGroups != null) {
    this.childGroups.close().awaitUninterruptibly(5000);
  }
  if (this.bootstrap != null) {
    this.bootstrap.releaseExternalResources();
  }
  if (embeddedServer.isStart()) {
    embeddedServer.stop();
  }
}
origin: MovingBlocks/Terasology

} catch (InterruptedException e) {
  connectCheck.cancel();
  connectCheck.getChannel().getCloseFuture().awaitUninterruptibly();
  factory.releaseExternalResources();
  throw e;
  connectCheck.getChannel().getCloseFuture().awaitUninterruptibly();
  factory.releaseExternalResources();
  return new JoinStatusImpl("Failed to connect to server - " + connectCheck.getCause().getMessage());
origin: io.netty/netty

future.awaitUninterruptibly();
if (!future.isSuccess()) {
  future.getChannel().close().awaitUninterruptibly();
  throw new ChannelException("Failed to bind to: " + localAddress, future.getCause());
origin: apache/incubator-dubbo

ChannelFuture future = bootstrap.connect(getConnectAddress());
try {
  boolean ret = future.awaitUninterruptibly(getConnectTimeout(), TimeUnit.MILLISECONDS);
origin: apache/incubator-dubbo

ChannelFuture future = bootstrap.connect(getConnectAddress());
try {
  boolean ret = future.awaitUninterruptibly(getConnectTimeout(), TimeUnit.MILLISECONDS);
origin: weibocom/motan

boolean result = channelFuture.awaitUninterruptibly(timeout, TimeUnit.MILLISECONDS);
boolean success = channelFuture.isSuccess();
origin: weibocom/motan

boolean result = writeFuture.awaitUninterruptibly(timeout, TimeUnit.MILLISECONDS);
org.jboss.netty.channelChannelFutureawaitUninterruptibly

Javadoc

Waits for this future to be completed without interruption. This method catches an InterruptedException and discards it silently.

Popular methods of ChannelFuture

  • addListener
    Adds the specified listener to this future. The specified listener is notified when this future is #
  • isSuccess
    Returns true if and only if the I/O operation was completed successfully.
  • getChannel
    Returns a channel where the I/O operation associated with this future takes place.
  • getCause
    Returns the cause of the failed I/O operation if the I/O operation has failed.
  • await
    Waits for this future to be completed within the specified time limit.
  • cancel
    Cancels the I/O operation associated with this future and notifies all listeners if canceled success
  • isDone
    Returns true if and only if this future is complete, regardless of whether the operation was success
  • isCancelled
    Returns true if and only if this future was cancelled by a #cancel() method.
  • setFailure
    Marks this future as a failure and notifies all listeners.
  • setSuccess
    Marks this future as a success and notifies all listeners.
  • removeListener
    Removes the specified listener from this future. The specified listener is no longer notified when t
  • syncUninterruptibly
    Waits for this future until it is done, and rethrows the cause of the failure if this future failed.
  • removeListener,
  • syncUninterruptibly,
  • setProgress,
  • rethrowIfFailed,
  • sync

Popular in Java

  • Start an intent from android
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • String (java.lang)
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JPanel (javax.swing)
  • Top Sublime Text plugins
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