Top Inners Fields Constructors Methods
io.vertx.core.net.impl

public final Class VertxEventLoopGroup

extends AbstractEventExecutorGroup
implements EventLoopGroup
Class Inheritance
All Implemented Interfaces
io.netty.channel.EventLoopGroup, io.netty.util.concurrent.EventExecutorGroup, java.lang.Iterable, java.util.concurrent.ScheduledExecutorService, java.util.concurrent.ExecutorService, java.lang.AutoCloseable, java.util.concurrent.Executor
Annotations
@SuppressWarnings:deprecation
Imports
io.netty.channel.*, io.netty.util.concurrent.*, java.util.ArrayList, .Collection, .Iterator, .List, .Objects, .Set, java.util.concurrent.TimeUnit

Author
Tim Fox

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final Set<EventExecutor>
private int
private final List<VertxEventLoopGroup.EventLoopHolder>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public synchronized void
public synchronized boolean
awaitTermination(long
the maximum time to wait
timeout
,
TimeUnit
the time unit of the timeout argument
unit
)

Implements java.util.concurrent.ExecutorService.awaitTermination.

Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.

private void
private VertxEventLoopGroup.EventLoopHolder
public boolean
isShutdown()

Implements java.util.concurrent.ExecutorService.isShutdown.

Returns true if this executor has been shut down.

public boolean
public boolean
isTerminated()

Implements java.util.concurrent.ExecutorService.isTerminated.

Returns true if all tasks have completed following shut down.

public Iterator<EventExecutor>
iterator()

Implements io.netty.util.concurrent.EventExecutorGroup.iterator.

Returns an iterator over elements of type T.

public synchronized EventLoop
public ChannelFuture
public ChannelFuture
register(Channel channel, ChannelPromise promise)

Implements io.netty.channel.EventLoopGroup.register.

Register a Channel with this EventLoop.

public ChannelFuture
public synchronized void
public synchronized void
shutdown()

Implements abstract io.netty.util.concurrent.AbstractEventExecutorGroup.shutdown.

Implements io.netty.util.concurrent.EventExecutorGroup.shutdown.

Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.

public Future<?>
shutdownGracefully(long
the quiet period as described in the documentation
quietPeriod
,
long
the maximum amount of time to wait until the executor is shutdown() regardless if a task was submitted during the quiet period
timeout
,
TimeUnit
the unit of quietPeriod and timeout
unit
)

Implements io.netty.util.concurrent.EventExecutorGroup.shutdownGracefully.

Signals this executor that the caller wants the executor to be shut down.

public Future<?>
terminationFuture()

Implements io.netty.util.concurrent.EventExecutorGroup.terminationFuture.

Returns the Future which is notified when all EventExecutors managed by this EventExecutorGroup have been terminated.

public synchronized int
Inherited from io.netty.util.concurrent.AbstractEventExecutorGroup:
executeinvokeAllinvokeAllinvokeAnyinvokeAnyscheduleschedulescheduleAtFixedRatescheduleWithFixedDelayshutdownGracefullyshutdownNowsubmitsubmitsubmit

Field Detail

childrenback to summary
private final Set<EventExecutor> children
posback to summary
private int pos
workersback to summary
private final List<VertxEventLoopGroup.EventLoopHolder> workers

Constructor Detail

VertxEventLoopGroupback to summary
public VertxEventLoopGroup()

Method Detail

addWorkerback to summary
public synchronized void addWorker(EventLoop worker)
awaitTerminationback to summary
public synchronized boolean awaitTermination(long timeout, TimeUnit unit)

Implements java.util.concurrent.ExecutorService.awaitTermination.

Doc from java.util.concurrent.ExecutorService.awaitTermination.

Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.

Parameters
timeout:long

the maximum time to wait

unit:TimeUnit

the time unit of the timeout argument

Returns:boolean

true if this executor terminated and false if the timeout elapsed before termination

Annotations
@Override
checkPosback to summary
private void checkPos()
findHolderback to summary
private VertxEventLoopGroup.EventLoopHolder findHolder(EventLoop worker)
isShutdownback to summary
public boolean isShutdown()

Implements java.util.concurrent.ExecutorService.isShutdown.

Doc from java.util.concurrent.ExecutorService.isShutdown.

Returns true if this executor has been shut down.

Returns:boolean

true if this executor has been shut down

Annotations
@Override
isShuttingDownback to summary
public boolean isShuttingDown()

Implements io.netty.util.concurrent.EventExecutorGroup.isShuttingDown.

Doc from io.netty.util.concurrent.EventExecutorGroup.isShuttingDown.

Returns true if and only if all EventExecutors managed by this EventExecutorGroup are being shut down gracefully or was shut down.

Annotations
@Override
isTerminatedback to summary
public boolean isTerminated()

Implements java.util.concurrent.ExecutorService.isTerminated.

Doc from java.util.concurrent.ExecutorService.isTerminated.

Returns true if all tasks have completed following shut down. Note that isTerminated is never true unless either shutdown or shutdownNow was called first.

Returns:boolean

true if all tasks have completed following shut down

Annotations
@Override
iteratorback to summary
public Iterator<EventExecutor> iterator()

Implements io.netty.util.concurrent.EventExecutorGroup.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<EventExecutor>

an Iterator.

Annotations
@Override
nextback to summary
public synchronized EventLoop next()

Implements io.netty.channel.EventLoopGroup.next, io.netty.util.concurrent.EventExecutorGroup.next.

Doc from io.netty.channel.EventLoopGroup.next.

Return the next EventLoop to use

Annotations
@Override
registerback to summary
public ChannelFuture register(Channel channel)

Implements io.netty.channel.EventLoopGroup.register.

Doc from io.netty.channel.EventLoopGroup.register.

Register a Channel with this EventLoop. The returned ChannelFuture will get notified once the registration was complete.

Annotations
@Override
registerback to summary
public ChannelFuture register(Channel channel, ChannelPromise promise)

Implements io.netty.channel.EventLoopGroup.register.

Doc from io.netty.channel.EventLoopGroup.register.

Register a Channel with this EventLoop. The passed ChannelFuture will get notified once the registration was complete and also will get returned.

Annotations
@Override
registerback to summary
public ChannelFuture register(ChannelPromise promise)

Implements io.netty.channel.EventLoopGroup.register.

Doc from io.netty.channel.EventLoopGroup.register.

Register a Channel with this EventLoop using a ChannelFuture. The passed ChannelFuture will get notified once the registration was complete and also will get returned.

Annotations
@Override
removeWorkerback to summary
public synchronized void removeWorker(EventLoop worker)
shutdownback to summary
public synchronized void shutdown()

Implements abstract io.netty.util.concurrent.AbstractEventExecutorGroup.shutdown.

Implements io.netty.util.concurrent.EventExecutorGroup.shutdown.

Doc from java.util.concurrent.ExecutorService.shutdown.

Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. Invocation has no additional effect if already shut down.

This method does not wait for previously submitted tasks to complete execution. Use awaitTermination to do that.

shutdownGracefullyback to summary
public Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit)

Implements io.netty.util.concurrent.EventExecutorGroup.shutdownGracefully.

Doc from io.netty.util.concurrent.EventExecutorGroup.shutdownGracefully.

Signals this executor that the caller wants the executor to be shut down. Once this method is called, isShuttingDown() starts to return true, and the executor prepares to shut itself down. Unlike shutdown(), graceful shutdown ensures that no tasks are submitted for 'the quiet period' (usually a couple seconds) before it shuts itself down. If a task is submitted during the quiet period, it is guaranteed to be accepted and the quiet period will start over.

Parameters
quietPeriod:long

the quiet period as described in the documentation

timeout:long

the maximum amount of time to wait until the executor is shutdown() regardless if a task was submitted during the quiet period

unit:TimeUnit

the unit of quietPeriod and timeout

Returns:Future<?>

the terminationFuture()

Annotations
@Override
terminationFutureback to summary
public Future<?> terminationFuture()

Implements io.netty.util.concurrent.EventExecutorGroup.terminationFuture.

Doc from io.netty.util.concurrent.EventExecutorGroup.terminationFuture.

Returns the Future which is notified when all EventExecutors managed by this EventExecutorGroup have been terminated.

Annotations
@Override
workerCountback to summary
public synchronized int workerCount()
io.vertx.core.net.impl back to summary

private Class VertxEventLoopGroup.EventLoopHolder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv final EventLoop

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

countback to summary
pack-priv int count
workerback to summary
pack-priv final EventLoop worker

Constructor Detail

EventLoopHolderback to summary
pack-priv EventLoopHolder(EventLoop worker)

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
io.vertx.core.net.impl back to summary

private final Class VertxEventLoopGroup.EventLoopIterator

extends Object
implements Iterator<EventExecutor>
Class Inheritance
All Implemented Interfaces
java.util.Iterator

Field Summary

Modifier and TypeField and Description
private final Iterator<VertxEventLoopGroup.EventLoopHolder>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.

public EventExecutor
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

holderItback to summary
private final Iterator<VertxEventLoopGroup.EventLoopHolder> holderIt

Constructor Detail

EventLoopIteratorback to summary
public EventLoopIterator(Iterator<VertxEventLoopGroup.EventLoopHolder> holderIt)

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
nextback to summary
public EventExecutor next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:EventExecutor

the next element in the iteration

Annotations
@Override
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.

Annotations
@Override