Package io.netty.channel.local
Class LocalServerChannel
- java.lang.Object
-
- io.netty.util.DefaultAttributeMap
-
- io.netty.channel.AbstractChannel
-
- io.netty.channel.AbstractServerChannel
-
- io.netty.channel.local.LocalServerChannel
-
- All Implemented Interfaces:
Channel
,ChannelOutboundInvoker
,ServerChannel
,AttributeMap
,java.lang.Comparable<Channel>
public class LocalServerChannel extends AbstractServerChannel
AServerChannel
for the local transport which allows in VM communication.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.netty.channel.AbstractChannel
AbstractChannel.AbstractUnsafe
-
Nested classes/interfaces inherited from interface io.netty.channel.Channel
Channel.Unsafe
-
-
Constructor Summary
Constructors Constructor Description LocalServerChannel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChannelConfig
config()
Returns the configuration of this channel.protected void
doBeginRead()
Schedule a read operation.protected void
doBind(java.net.SocketAddress localAddress)
Bind theChannel
to theSocketAddress
protected void
doClose()
Close theChannel
protected void
doDeregister()
protected void
doRegister(ChannelPromise promise)
boolean
isActive()
Returntrue
if theChannel
is active and so connected.protected boolean
isCompatible(EventLoop loop)
Returntrue
if the givenEventLoop
is compatible with this instance.boolean
isOpen()
Returnstrue
if theChannel
is open and may get active laterLocalAddress
localAddress()
Returns the local address where this channel is bound to.protected java.net.SocketAddress
localAddress0()
Returns theSocketAddress
which is bound locally.protected LocalChannel
newLocalChannel(LocalChannel peer)
A factory method forLocalChannel
s.protected AbstractChannel.AbstractUnsafe
newUnsafe()
Create a newAbstractChannel.AbstractUnsafe
instance which will be used for the life-time of theChannel
LocalAddress
remoteAddress()
Returns the remote address where this channel is connected to.-
Methods inherited from class io.netty.channel.AbstractServerChannel
doDisconnect, doWrite, filterOutboundMessage, metadata, remoteAddress0
-
Methods inherited from class io.netty.channel.AbstractChannel
closeFuture, compareTo, doRegister, doShutdownOutput, equals, eventLoop, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, maxMessagesPerWrite, newChannelPipeline, newId, parent, pipeline, toString, unsafe, validateFileRegion, voidPromise
-
Methods inherited from class io.netty.util.DefaultAttributeMap
attr, hasAttr
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty.util.AttributeMap
attr, hasAttr
-
Methods inherited from interface io.netty.channel.Channel
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, eventLoop, flush, getOption, id, isRegistered, isWritable, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, setOption, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlush
-
-
-
-
Method Detail
-
config
public ChannelConfig config()
Description copied from interface:Channel
Returns the configuration of this channel.
-
localAddress
public LocalAddress localAddress()
Description copied from interface:Channel
Returns the local address where this channel is bound to. The returnedSocketAddress
is supposed to be down-cast into more concrete type such asInetSocketAddress
to retrieve the detailed information.- Specified by:
localAddress
in interfaceChannel
- Overrides:
localAddress
in classAbstractChannel
- Returns:
- the local address of this channel.
null
if this channel is not bound.
-
remoteAddress
public LocalAddress remoteAddress()
Description copied from interface:Channel
Returns the remote address where this channel is connected to. The returnedSocketAddress
is supposed to be down-cast into more concrete type such asInetSocketAddress
to retrieve the detailed information.- Specified by:
remoteAddress
in interfaceChannel
- Overrides:
remoteAddress
in classAbstractServerChannel
- Returns:
- the remote address of this channel.
null
if this channel is not connected. If this channel is not connected but it can receive messages from arbitrary remote addresses (e.g.DatagramChannel
, useDefaultAddressedEnvelope.recipient()
to determine the origination of the received message as this method will returnnull
.
-
isOpen
public boolean isOpen()
Description copied from interface:Channel
Returnstrue
if theChannel
is open and may get active later
-
isActive
public boolean isActive()
Description copied from interface:Channel
Returntrue
if theChannel
is active and so connected.
-
isCompatible
protected boolean isCompatible(EventLoop loop)
Description copied from class:AbstractChannel
Returntrue
if the givenEventLoop
is compatible with this instance.- Specified by:
isCompatible
in classAbstractChannel
-
localAddress0
protected java.net.SocketAddress localAddress0()
Description copied from class:AbstractChannel
Returns theSocketAddress
which is bound locally.- Specified by:
localAddress0
in classAbstractChannel
-
doRegister
protected void doRegister(ChannelPromise promise)
Description copied from class:AbstractChannel
Is called after theChannel
is registered with itsEventLoop
as part of the register process. Subclasses may override this method- Overrides:
doRegister
in classAbstractChannel
- Parameters:
promise
-ChannelPromise
that must be notified once done to continue the registration.
-
doBind
protected void doBind(java.net.SocketAddress localAddress) throws java.lang.Exception
Description copied from class:AbstractChannel
Bind theChannel
to theSocketAddress
- Specified by:
doBind
in classAbstractChannel
- Throws:
java.lang.Exception
-
doClose
protected void doClose() throws java.lang.Exception
Description copied from class:AbstractChannel
Close theChannel
- Specified by:
doClose
in classAbstractChannel
- Throws:
java.lang.Exception
-
doDeregister
protected void doDeregister() throws java.lang.Exception
Description copied from class:AbstractChannel
- Overrides:
doDeregister
in classAbstractChannel
- Throws:
java.lang.Exception
-
doBeginRead
protected void doBeginRead() throws java.lang.Exception
Description copied from class:AbstractChannel
Schedule a read operation.- Specified by:
doBeginRead
in classAbstractChannel
- Throws:
java.lang.Exception
-
newLocalChannel
protected LocalChannel newLocalChannel(LocalChannel peer)
A factory method forLocalChannel
s. Users may override it to create custom instances ofLocalChannel
s.
-
newUnsafe
protected AbstractChannel.AbstractUnsafe newUnsafe()
Description copied from class:AbstractChannel
Create a newAbstractChannel.AbstractUnsafe
instance which will be used for the life-time of theChannel
- Overrides:
newUnsafe
in classAbstractServerChannel
-
-