Top Description Fields Constructors Methods
io.netty5.channel.local

public final Class LocalHandler

extends Object
implements IoHandler
Class Inheritance
All Implemented Interfaces
io.netty5.channel.IoHandler
Imports
io.netty5.channel.Channel, .IoExecutionContext, .IoHandle, .IoHandler, .IoHandlerFactory, io.netty5.util.internal.StringUtil, java.util.HashSet, .Set, java.util.concurrent.locks.LockSupport

IoHandler implementation for LocalChannel and LocalServerChannel.

Field Summary

Modifier and TypeField and Description
private volatile Thread
private final Set<LocalChannelUnsafe>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static LocalChannelUnsafe
cast(IoHandle handle)

public void
deregister(IoHandle
the IoHandle to deregister..
handle
)

Implements io.netty5.channel.IoHandler.deregister.

Deregister a IoHandle for IO.
public void
destroy()

Implements io.netty5.channel.IoHandler.destroy.

Destroy the IoHandler and free all its resources.
public boolean
isCompatible(Class<? extends IoHandle>
the type of the IoHandle.
handleType
)

Implements io.netty5.channel.IoHandler.isCompatible.

Returns true if the given type is compatible with this IoHandler and so can be registered, false otherwise.
public static IoHandlerFactory
newFactory()

Returns a new IoHandlerFactory that creates LocalHandler instances.

public void
public void
register(IoHandle
the Channel to register..
handle
)

Implements io.netty5.channel.IoHandler.register.

Register a Channel for IO.
public int
run(IoExecutionContext runner)

Implements io.netty5.channel.IoHandler.run.

Run the IO handled by this IoHandler.
public void
wakeup(boolean inEventLoop)

Implements io.netty5.channel.IoHandler.wakeup.

Wakeup the IoHandler, which means if any operation blocks it should be unblocked and return as soon as possible.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

executionThreadback to summary
private volatile Thread executionThread
registeredChannelsback to summary
private final Set<LocalChannelUnsafe> registeredChannels

Constructor Detail

LocalHandlerback to summary
private LocalHandler()

Method Detail

castback to summary
private static LocalChannelUnsafe cast(IoHandle handle)
deregisterback to summary
public void deregister(IoHandle handle)

Implements io.netty5.channel.IoHandler.deregister.

Doc from io.netty5.channel.IoHandler.deregister.

Deregister a IoHandle for IO.

Parameters
handle:IoHandle

the IoHandle to deregister..

Annotations
@Override
destroyback to summary
public void destroy()

Implements io.netty5.channel.IoHandler.destroy.

Doc from io.netty5.channel.IoHandler.destroy.

Destroy the IoHandler and free all its resources.

Annotations
@Override
isCompatibleback to summary
public boolean isCompatible(Class<? extends IoHandle> handleType)

Implements io.netty5.channel.IoHandler.isCompatible.

Doc from io.netty5.channel.IoHandler.isCompatible.

Returns true if the given type is compatible with this IoHandler and so can be registered, false otherwise.

Parameters
handleType:Class<? extends IoHandle>

the type of the IoHandle.

Returns:boolean

if compatible of not.

Annotations
@Override
newFactoryback to summary
public static IoHandlerFactory newFactory()

Returns a new IoHandlerFactory that creates LocalHandler instances.

prepareToDestroyback to summary
public void prepareToDestroy()

Implements io.netty5.channel.IoHandler.prepareToDestroy.

Doc from io.netty5.channel.IoHandler.prepareToDestroy.

Prepare to destroy this IoHandler. This method will be called before destroy() and may be called multiple times.

Annotations
@Override
registerback to summary
public void register(IoHandle handle)

Implements io.netty5.channel.IoHandler.register.

Doc from io.netty5.channel.IoHandler.register.

Register a Channel for IO.

Parameters
handle:IoHandle

the Channel to register..

Annotations
@Override
runback to summary
public int run(IoExecutionContext runner)

Implements io.netty5.channel.IoHandler.run.

Doc from io.netty5.channel.IoHandler.run.

Run the IO handled by this IoHandler. The IoExecutionContext should be used to ensure we not execute too long and so block the processing of other task that are scheduled on the EventLoop. This is done by taking IoExecutionContext#delayNanos(long) or IoExecutionContext#deadlineNanos() into account.

Returns:int

the number of IoHandle for which I/O was handled.

Annotations
@Override
wakeupback to summary
public void wakeup(boolean inEventLoop)

Implements io.netty5.channel.IoHandler.wakeup.

Doc from io.netty5.channel.IoHandler.wakeup.

Wakeup the IoHandler, which means if any operation blocks it should be unblocked and return as soon as possible.

Annotations
@Override