Top Description Inners Fields Constructors Methods
org.glassfish.grizzly.strategies

public final Class SameThreadIOStrategy

extends AbstractIOStrategy
Class Inheritance
Imports
java.io.IOException, java.util.concurrent.Executor, java.util.logging.Logger, org.glassfish.grizzly.Connection, .Context, .Grizzly, .IOEvent, .IOEventLifeCycleListener, .Transport, org.glassfish.grizzly.asyncqueue.AsyncQueue, org.glassfish.grizzly.threadpool.ThreadPoolConfig

org.glassfish.grizzly.IOStrategy, which executes org.glassfish.grizzly.Processors in a current thread.
Author
Alexey Stashok

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final SameThreadIOStrategy
private static final SameThreadIOStrategy.InterestLifeCycleListenerWhenIoDisabled
private static final SameThreadIOStrategy.InterestLifeCycleListenerWhenIoEnabled
private static final Logger
Inherited from org.glassfish.grizzly.strategies.AbstractIOStrategy:
ENABLE_INTEREST_LIFECYCLE_LISTENER

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public ThreadPoolConfig
public boolean
executeIoEvent(final Connection<L> connection, final IOEvent ioEvent, final boolean isIoEventEnabled)

Implements org.glassfish.grizzly.IOStrategy.executeIoEvent.

The org.glassfish.grizzly.nio.SelectorRunner will invoke this method to allow the strategy implementation to decide how the IOEvent will be handled.

public static SameThreadIOStrategy
public Executor
getThreadPoolFor(final Connection<L> connection, final IOEvent ioEvent)

Overrides org.glassfish.grizzly.strategies.AbstractIOStrategy.getThreadPoolFor.

Implements org.glassfish.grizzly.IOStrategy.getThreadPoolFor.

Returns an Executor to be used to run given ioEvent processing for the given connection.

Inherited from org.glassfish.grizzly.strategies.AbstractIOStrategy:
executeIoEventfireIOEventisReadWrite

Field Detail

INSTANCEback to summary
private static final SameThreadIOStrategy INSTANCE
LIFECYCLE_LISTENER_WHEN_IO_DISABLEDback to summary
private static final SameThreadIOStrategy.InterestLifeCycleListenerWhenIoDisabled LIFECYCLE_LISTENER_WHEN_IO_DISABLED
LIFECYCLE_LISTENER_WHEN_IO_ENABLEDback to summary
private static final SameThreadIOStrategy.InterestLifeCycleListenerWhenIoEnabled LIFECYCLE_LISTENER_WHEN_IO_ENABLED
loggerback to summary
private static final Logger logger

Constructor Detail

SameThreadIOStrategyback to summary
private SameThreadIOStrategy()

Method Detail

createDefaultWorkerPoolConfigback to summary
public ThreadPoolConfig createDefaultWorkerPoolConfig(final Transport transport)

Overrides org.glassfish.grizzly.strategies.AbstractIOStrategy.createDefaultWorkerPoolConfig.

Implements org.glassfish.grizzly.strategies.WorkerThreadPoolConfigProducer.createDefaultWorkerPoolConfig.

Annotations
@Override
executeIoEventback to summary
public boolean executeIoEvent(final Connection<L> connection, final IOEvent ioEvent, final boolean isIoEventEnabled) throws IOException

Implements org.glassfish.grizzly.IOStrategy.executeIoEvent.

Doc from org.glassfish.grizzly.IOStrategy.executeIoEvent.

The org.glassfish.grizzly.nio.SelectorRunner will invoke this method to allow the strategy implementation to decide how the IOEvent will be handled.

Annotations
@Override
Exceptions
IOException:
if an error occurs processing the IOEvent.
getInstanceback to summary
public static SameThreadIOStrategy getInstance()
getThreadPoolForback to summary
public Executor getThreadPoolFor(final Connection<L> connection, final IOEvent ioEvent)

Overrides org.glassfish.grizzly.strategies.AbstractIOStrategy.getThreadPoolFor.

Implements org.glassfish.grizzly.IOStrategy.getThreadPoolFor.

Doc from org.glassfish.grizzly.IOStrategy.getThreadPoolFor.

Returns an Executor to be used to run given ioEvent processing for the given connection. A null value will be returned if the ioEvent should be executed in the kernel thread.

Annotations
@Override
org.glassfish.grizzly.strategies back to summary

private final Class SameThreadIOStrategy.InterestLifeCycleListenerWhenIoDisabled

extends Adapter
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
public void
Inherited from org.glassfish.grizzly.IOEventLifeCycleListener.Adapter:
onContextManualIOEventControlonContextResumeonContextSuspendonErroronLeaveonNotRunonRerunonTerminate

Constructor Detail

InterestLifeCycleListenerWhenIoDisabledback to summary
private InterestLifeCycleListenerWhenIoDisabled()

Method Detail

onCompleteback to summary
public void onComplete(final Context context, final Object data) throws IOException

Overrides org.glassfish.grizzly.IOEventLifeCycleListener.Adapter.onComplete.

Implements org.glassfish.grizzly.IOEventLifeCycleListener.onComplete.

Doc from org.glassfish.grizzly.IOEventLifeCycleListener.Adapter.onComplete.

IOEvent processing completed.

Annotations
@Override
Exceptions
IOException:

Doc from org.glassfish.grizzly.IOEventLifeCycleListener.onComplete.

on error

onReregisterback to summary
public void onReregister(final Context context) throws IOException

Overrides org.glassfish.grizzly.IOEventLifeCycleListener.Adapter.onReregister.

Implements org.glassfish.grizzly.IOEventLifeCycleListener.onReregister.

Doc from org.glassfish.grizzly.IOEventLifeCycleListener.Adapter.onReregister.

Reregister IOEvent interest.

Annotations
@Override
Exceptions
IOException:

Doc from org.glassfish.grizzly.IOEventLifeCycleListener.onReregister.

on error

org.glassfish.grizzly.strategies back to summary

private final Class SameThreadIOStrategy.InterestLifeCycleListenerWhenIoEnabled

extends Adapter
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
disableIOEvent(final Context context)

public void
public void
public void
public void
Inherited from org.glassfish.grizzly.IOEventLifeCycleListener.Adapter:
onContextResumeonErroronLeaveonNotRunonRerunonTerminate

Constructor Detail

InterestLifeCycleListenerWhenIoEnabledback to summary
private InterestLifeCycleListenerWhenIoEnabled()

Method Detail

disableIOEventback to summary
private static void disableIOEvent(final Context context) throws IOException
onCompleteback to summary
public void onComplete(final Context context, final Object data) throws IOException

Overrides org.glassfish.grizzly.IOEventLifeCycleListener.Adapter.onComplete.

Implements org.glassfish.grizzly.IOEventLifeCycleListener.onComplete.

Doc from org.glassfish.grizzly.IOEventLifeCycleListener.Adapter.onComplete.

IOEvent processing completed.

Annotations
@Override
Exceptions
IOException:

Doc from org.glassfish.grizzly.IOEventLifeCycleListener.onComplete.

on error

onContextManualIOEventControlback to summary
public void onContextManualIOEventControl(final Context context) throws IOException

Overrides org.glassfish.grizzly.IOEventLifeCycleListener.Adapter.onContextManualIOEventControl.

Implements org.glassfish.grizzly.IOEventLifeCycleListener.onContextManualIOEventControl.

Doc from org.glassfish.grizzly.IOEventLifeCycleListener.Adapter.onContextManualIOEventControl.

Processing switched to the manual IOEvent control. Connection#enableIOEvent(org.glassfish.grizzly.IOEvent) or Connection#disableIOEvent(org.glassfish.grizzly.IOEvent) might be explicitly called.

Annotations
@Override
onContextSuspendback to summary
public void onContextSuspend(final Context context) throws IOException

Overrides org.glassfish.grizzly.IOEventLifeCycleListener.Adapter.onContextSuspend.

Implements org.glassfish.grizzly.IOEventLifeCycleListener.onContextSuspend.

Doc from org.glassfish.grizzly.IOEventLifeCycleListener.Adapter.onContextSuspend.

IOEvent processing suspended.

Annotations
@Override
Exceptions
IOException:

Doc from org.glassfish.grizzly.IOEventLifeCycleListener.onContextSuspend.

on error

onReregisterback to summary
public void onReregister(final Context context) throws IOException

Overrides org.glassfish.grizzly.IOEventLifeCycleListener.Adapter.onReregister.

Implements org.glassfish.grizzly.IOEventLifeCycleListener.onReregister.

Doc from org.glassfish.grizzly.IOEventLifeCycleListener.Adapter.onReregister.

Reregister IOEvent interest.

Annotations
@Override
Exceptions
IOException:

Doc from org.glassfish.grizzly.IOEventLifeCycleListener.onReregister.

on error