write(java.nio.ByteBuffer,
org.glassfish.tyrus.spi.CompletionHandler) method call can be processed at a time. Only one _read(java.nio.ByteBuffer) operation is supported at a time, another one is started only after the previous one
has
completed. Blocking in onRead(java.nio.ByteBuffer) or onConnect() method will result in data not
being read from a socket until these methods have completed.
| Modifier and Type | Class and Description |
|---|---|
| private static class | TransportFilter.
A thread pool executor that prefers creating new worker threads over queueing tasks until the maximum poll size has been reached, after which it will start queueing tasks. |
| private static class | TransportFilter.
A default thread factory that gets used if |
| Modifier and Type | Field and Description |
|---|---|
| private final InetAddress | |
| private static volatile AsynchronousChannelGroup | |
| private static volatile ScheduledFuture | |
| private static final ScheduledExecutorService | |
| private final Integer | |
| private static volatile Integer | currentContainerIdleTimeout
Idle timeout that will be used when closing current |
| private static volatile ThreadPoolConfig | currentThreadPoolConfig
|
| private static final int | |
| private final int | |
| private static final Logger | |
| private static final AtomicInteger | |
| private volatile AsynchronousSocketChannel | |
| private final ThreadPoolConfig |
| Access | Constructor and Description |
|---|---|
| pack-priv | TransportFilter(int
size of buffer to be allocated for reading data from a socket. inputBufferSize, ThreadPoolConfig thread pool configuration used for creating thread pool. threadPoolConfig, Integer idle time after which the shared thread pool will be destroyed. If containerIdleTimeout, InetAddress null
default value will be used. The default value is 30 seconds.local address to bind sockets ( bindingAddress)socketChannel) when they are created.
Binding is done only if not null.Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| pack-priv synchronized void | close()
Overrides org. Close the filter, invokes close operation on the next filter in the filter chain. |
| public void | handleConnect(SocketAddress
an address where to connect (server or proxy). serverAddress, Filter a filter positioned upstream. upstreamFilter)Overrides org. Handle |
| private void | |
| private void | |
| pack-priv void | startSsl()
Overrides org. Signal to turn on SSL, it is passed on in the filter chain until a filter responsible for SSL is reached. |
| private void | |
| pack-priv void | write(ByteBuffer
on which write operation is performed. data, final CompletionHandler<ByteBuffer> will be invoked when the write operation is completed or has failed. completionHandler)Overrides org. Perform write operation for this filter and invokes write method on the next filter in the filter chain. |
| bindingAddress | back to summary |
|---|---|
| private final InetAddress bindingAddress | |
| channelGroup | back to summary |
|---|---|
| private static volatile AsynchronousChannelGroup channelGroup | |
| closeWaitTask | back to summary |
|---|---|
| private static volatile ScheduledFuture<?> closeWaitTask | |
| connectionCloseScheduler | back to summary |
|---|---|
| private static final ScheduledExecutorService connectionCloseScheduler | |
| containerIdleTimeout | back to summary |
|---|---|
| private final Integer containerIdleTimeout | |
| currentContainerIdleTimeout | back to summary |
|---|---|
| private static volatile Integer currentContainerIdleTimeout Idle timeout that will be used when closing current | |
| currentThreadPoolConfig | back to summary |
|---|---|
| private static volatile ThreadPoolConfig currentThreadPoolConfig
| |
| DEFAULT_CONNECTION_CLOSE_WAIT | back to summary |
|---|---|
| private static final int DEFAULT_CONNECTION_CLOSE_WAIT | |
| inputBufferSize | back to summary |
|---|---|
| private final int inputBufferSize | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| openedConnections | back to summary |
|---|---|
| private static final AtomicInteger openedConnections | |
| socketChannel | back to summary |
|---|---|
| private volatile AsynchronousSocketChannel socketChannel | |
| threadPoolConfig | back to summary |
|---|---|
| private final ThreadPoolConfig threadPoolConfig | |
| TransportFilter | back to summary |
|---|---|
| pack-priv TransportFilter(int inputBufferSize, ThreadPoolConfig threadPoolConfig, Integer containerIdleTimeout, InetAddress bindingAddress) Constructor. If the channel group is not active (all connections have been closed and the shutdown timeout is running) and a new transport is created with tread pool configuration different from the one of the current thread pool, the current thread pool will be shut down and a new one created with the new configuration.
| |
| _read | back to summary |
|---|---|
| private void _read(final ByteBuffer inputBuffer) | |
| close | back to summary |
|---|---|
| pack-priv synchronized void close() Overrides org. Doc from org. Close the filter, invokes close operation on the next filter in the filter chain. The filter is expected to clean up any allocated resources and pass the invocation to downstream filter.
| |
| handleConnect | back to summary |
|---|---|
| public void handleConnect(SocketAddress serverAddress, Filter upstreamFilter) Overrides org. Doc from org. Handle
| |
| initializeChannelGroup | back to summary |
|---|---|
| private void initializeChannelGroup() throws IOException | |
| scheduleClose | back to summary |
|---|---|
| private void scheduleClose() | |
| startSsl | back to summary |
|---|---|
| pack-priv void startSsl() Overrides org. Doc from org. Signal to turn on SSL, it is passed on in the filter chain until a filter responsible for SSL is reached.
| |
| updateThreadPoolConfig | back to summary |
|---|---|
| private void updateThreadPoolConfig() | |
| write | back to summary |
|---|---|
| pack-priv void write(ByteBuffer data, final CompletionHandler<ByteBuffer> completionHandler) Overrides org. Doc from org. Perform write operation for this filter and invokes write method on the next filter in the filter chain.
| |
| Modifier and Type | Class and Description |
|---|---|
| private static class | TransportFilter.
Synchronous queue that tries to empty |
| Modifier and Type | Field and Description |
|---|---|
| private final Queue | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv | QueuingExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, Queue<Runnable> taskQueue, boolean
indicates if threadSafeQueue, ThreadFactory threadFactory)taskQueue is thread safe or not.Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public void | execute(Runnable
to be executed. task)Overrides java. Implements java. Submit a task for execution, if the maximum thread limit has been reached and all the threads are occupied, enqueue the task. |
| taskQueue | back to summary |
|---|---|
| private final Queue<Runnable> taskQueue | |
| threadSafeQueue | back to summary |
|---|---|
| private final boolean threadSafeQueue | |
| QueuingExecutor | back to summary |
|---|---|
| pack-priv QueuingExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, Queue<Runnable> taskQueue, boolean threadSafeQueue, ThreadFactory threadFactory) Constructor.
| |
| execute | back to summary |
|---|---|
| public void execute(Runnable task) Overrides java. Implements java. Submit a task for execution, if the maximum thread limit has been reached and all the threads are occupied, enqueue the task. The task is not executed by the current thread, but by a thread from the thread pool. | |
taskQueue before it blocks waiting for new tasks to be
submitted. It is passed to ThreadPoolExecutor, where it is used used to hand off tasks from
task-submitting thread to worker threads.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | |
| private final Queue | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Runnable | poll(long
how long to wait before giving up, in units of
timeout, TimeUnit unita unit)TimeUnit determining how to interpret the
timeout parameterOverrides java. Implements java. Retrieves and removes the head of this queue, waiting if necessary up to the specified wait time, for another thread to insert it. |
| public Runnable | take()
Overrides java. Implements java. Retrieves and removes the head of this queue, waiting if necessary for another thread to insert it. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| taskQueue | back to summary |
|---|---|
| private final Queue<Runnable> taskQueue | |
| threadSafeQueue | back to summary |
|---|---|
| private final boolean threadSafeQueue | |
| HandOffQueue | back to summary |
|---|---|
| private HandOffQueue(Queue<Runnable> taskQueue, boolean threadSafeQueue) | |
| poll | back to summary |
|---|---|
| public Runnable poll(long timeout, TimeUnit unit) throws InterruptedException Overrides java. Implements java. Doc from java. Retrieves and removes the head of this queue, waiting if necessary up to the specified wait time, for another thread to insert it.
| |
| take | back to summary |
|---|---|
| public Runnable take() throws InterruptedException Overrides java. Implements java. Doc from java. Retrieves and removes the head of this queue, waiting if necessary for another thread to insert it.
| |
org.glassfish.tyrus.client.ThreadPoolConfig#getThreadFactory()
is not specified.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final AtomicInteger | |
| private final ThreadPoolConfig |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Thread | newThread(Runnable
a runnable to be executed by new thread instance r)Implements java. Constructs a new unstarted |
| THREAD_NAME_BASE | back to summary |
|---|---|
| private static final String THREAD_NAME_BASE | |
| threadCounter | back to summary |
|---|---|
| private static final AtomicInteger threadCounter | |
| threadPoolConfig | back to summary |
|---|---|
| private final ThreadPoolConfig threadPoolConfig | |
| TransportThreadFactory | back to summary |
|---|---|
| pack-priv TransportThreadFactory(ThreadPoolConfig threadPoolConfig) | |
| newThread | back to summary |
|---|---|
| public Thread newThread(Runnable r) Implements java. Doc from java. Constructs a new unstarted | |