- java.lang.Object
-
- io.netty5.util.DefaultAttributeMap
-
- io.netty5.channel.AbstractChannel<P,L,R>
-
- io.netty5.channel.AbstractServerChannel<LocalChannel,LocalAddress,LocalAddress>
-
- io.netty5.channel.local.LocalServerChannel
-
- All Implemented Interfaces:
Channel,ChannelOutboundInvoker,IoHandle,ServerChannel,io.netty5.util.AttributeMap,io.netty5.util.concurrent.FuturePromiseFactory,Comparable<Channel>
public class LocalServerChannel extends AbstractServerChannel<LocalChannel,LocalAddress,LocalAddress>
AServerChannelfor the local transport which allows in VM communication.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.netty5.channel.AbstractChannel
AbstractChannel.DefaultAbstractChannelPipeline, AbstractChannel.ReadSink, AbstractChannel.WriteSink
-
-
Constructor Summary
Constructors Constructor Description LocalServerChannel(EventLoop eventLoop, EventLoopGroup childEventLoopGroup)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseTransportNow()voidderegisterTransportNow()protected voiddoBind(SocketAddress localAddress)Bind theChannelto theSocketAddressprotected voiddoClose()Close theChannelprotected voiddoRead(boolean wasReadPendingAlready)Schedule a read operation.protected booleandoReadNow(AbstractChannel.ReadSink readSink)Try to read a message from the transport and dispatch it viaAbstractChannel.ReadSink.processRead(int, int, Object).booleanisActive()Returntrueif theChannelis active and so connected.booleanisOpen()Returnstrueif theChannelis open and may get active laterprotected LocalAddresslocalAddress0()Returns theSocketAddresswhich is bound locally.protected LocalChannelnewLocalChannel(LocalChannel peer)A factory method forLocalChannels.voidregisterTransportNow()-
Methods inherited from class io.netty5.channel.AbstractServerChannel
childEventLoopGroup, doConnect, doDisconnect, doFinishConnect, doShutdown, doWriteNow, filterOutboundMessage, isShutdown, remoteAddress0
-
Methods inherited from class io.netty5.channel.AbstractChannel
bufferAllocator, cacheAddresses, closeFuture, closeTransport, compareTo, doClearScheduledRead, equals, executor, finishConnect, getExtendedOption, getOption, hashCode, id, isConnectPending, isExtendedOptionSupported, isOptionSupported, isReadPending, isRegistered, isSupportingDisconnect, isWriteFlushedScheduled, localAddress, newChannelPipeline, newSupportedIdentityOptionsSet, parent, pipeline, prepareToClose, readBufferAllocator, readHandle, readIfIsAutoRead, readLoopComplete, readNow, remoteAddress, setExtendedOption, setOption, shutdownReadSide, toString, validateEventLoopGroup, validateFileRegion, writableBytes, writeFlushed, writeFlushedNow, writeHandle, writeLoopComplete
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty5.channel.Channel
bind, bufferAllocator, close, closeFuture, connect, connect, deregister, disconnect, executor, flush, getOption, id, isOptionSupported, isWritable, localAddress, parent, pipeline, read, read, register, remoteAddress, sendOutboundEvent, setOption, shutdown, writableBytes, write, writeAndFlush
-
Methods inherited from interface io.netty5.channel.ChannelOutboundInvoker
newFailedFuture, newPromise, newSucceededFuture, newSucceededFuture
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface io.netty5.channel.IoHandle
isRegistered
-
-
-
-
Constructor Detail
-
LocalServerChannel
public LocalServerChannel(EventLoop eventLoop, EventLoopGroup childEventLoopGroup)
-
-
Method Detail
-
isOpen
public boolean isOpen()
Description copied from interface:ChannelReturnstrueif theChannelis open and may get active later
-
isActive
public boolean isActive()
Description copied from interface:ChannelReturntrueif theChannelis active and so connected.
-
localAddress0
protected LocalAddress localAddress0()
Description copied from class:AbstractChannelReturns theSocketAddresswhich is bound locally.- Specified by:
localAddress0in classAbstractChannel<LocalChannel,LocalAddress,LocalAddress>- Returns:
- the local address if any,
nullotherwise.
-
doBind
protected void doBind(SocketAddress localAddress) throws Exception
Description copied from class:AbstractChannelBind theChannelto theSocketAddress- Specified by:
doBindin classAbstractChannel<LocalChannel,LocalAddress,LocalAddress>- Parameters:
localAddress- theSocketAddressto bound to.- Throws:
Exception- when an error happens.
-
doClose
protected void doClose() throws ExceptionDescription copied from class:AbstractChannelClose theChannel- Specified by:
doClosein classAbstractChannel<LocalChannel,LocalAddress,LocalAddress>- Throws:
Exception- thrown on error.
-
doRead
protected void doRead(boolean wasReadPendingAlready) throws ExceptionDescription copied from class:AbstractChannelSchedule a read operation.- Specified by:
doReadin classAbstractChannel<LocalChannel,LocalAddress,LocalAddress>- Parameters:
wasReadPendingAlready-trueif a read was already pending whenChannel.read()was called.- Throws:
Exception- thrown on error.
-
doReadNow
protected boolean doReadNow(AbstractChannel.ReadSink readSink)
Description copied from class:AbstractChannelTry to read a message from the transport and dispatch it viaAbstractChannel.ReadSink.processRead(int, int, Object). This method is called in a loop until there is nothing more messages to read or the channel was shutdown / closed. This method should never be called directly by sub-classes, useAbstractChannel.readNow()instead.- Specified by:
doReadNowin classAbstractChannel<LocalChannel,LocalAddress,LocalAddress>- Parameters:
readSink- theAbstractChannel.ReadSinkthat should be called with messages that are read from the transport to propagate these.- Returns:
trueif the channel should be shutdown / closed.
-
newLocalChannel
protected LocalChannel newLocalChannel(LocalChannel peer)
A factory method forLocalChannels. Users may override it to create custom instances ofLocalChannels.
-
registerTransportNow
public void registerTransportNow()
-
deregisterTransportNow
public void deregisterTransportNow()
-
closeTransportNow
public void closeTransportNow()
-
-