Package io.quarkus.netty.runtime.virtual
Class VirtualChannel
- java.lang.Object
-
- io.netty.util.DefaultAttributeMap
-
- io.netty.channel.AbstractChannel
-
- io.quarkus.netty.runtime.virtual.VirtualChannel
-
- All Implemented Interfaces:
io.netty.channel.Channel
,io.netty.channel.ChannelOutboundInvoker
,io.netty.util.AttributeMap
,Comparable<io.netty.channel.Channel>
public class VirtualChannel extends io.netty.channel.AbstractChannel
AChannel
for the local transport. This is a bit different from a LocalChannel in regular Netty as it does not require a client event loop and exposes the client inbound queue directly. The queue exposed is a blocking queue so that local virtual clients can block on this queue and obtain messages directly for processing.
-
-
Field Summary
Fields Modifier and Type Field Description protected io.netty.channel.ChannelPromise
connectPromise
protected static AtomicReferenceFieldUpdater<VirtualChannel,io.netty.util.concurrent.Future>
FINISH_READ_FUTURE_UPDATER
protected io.netty.util.concurrent.Future<?>
finishReadFuture
(package private) Queue<Object>
inboundBuffer
protected VirtualAddress
localAddress
protected boolean
readInProgress
protected SocketAddress
remoteAddress
protected io.quarkus.netty.runtime.virtual.VirtualChannel.State
state
(package private) VirtualClientConnection
virtualConnection
protected boolean
writeInProgress
-
Constructor Summary
Constructors Modifier Constructor Description protected
VirtualChannel(VirtualServerChannel parent, VirtualClientConnection connection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.channel.ChannelConfig
config()
protected void
doBeginRead()
protected void
doBind(SocketAddress localAddress)
protected void
doClose()
protected void
doDeregister()
protected void
doDisconnect()
protected void
doRegister()
protected void
doWrite(io.netty.channel.ChannelOutboundBuffer in)
boolean
isActive()
protected boolean
isCompatible(io.netty.channel.EventLoop loop)
boolean
isOpen()
VirtualAddress
localAddress()
protected SocketAddress
localAddress0()
io.netty.channel.ChannelMetadata
metadata()
protected io.netty.channel.AbstractChannel.AbstractUnsafe
newUnsafe()
VirtualServerChannel
parent()
protected void
readInbound()
SocketAddress
remoteAddress()
protected SocketAddress
remoteAddress0()
-
Methods inherited from class io.netty.channel.AbstractChannel
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doShutdownOutput, equals, eventLoop, filterOutboundMessage, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, maxMessagesPerWrite, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, toString, unsafe, validateFileRegion, voidPromise, write, write, writeAndFlush, writeAndFlush
-
-
-
-
Field Detail
-
FINISH_READ_FUTURE_UPDATER
protected static final AtomicReferenceFieldUpdater<VirtualChannel,io.netty.util.concurrent.Future> FINISH_READ_FUTURE_UPDATER
-
virtualConnection
final VirtualClientConnection virtualConnection
-
state
protected volatile io.quarkus.netty.runtime.virtual.VirtualChannel.State state
-
localAddress
protected volatile VirtualAddress localAddress
-
remoteAddress
protected volatile SocketAddress remoteAddress
-
connectPromise
protected volatile io.netty.channel.ChannelPromise connectPromise
-
readInProgress
protected volatile boolean readInProgress
-
writeInProgress
protected volatile boolean writeInProgress
-
finishReadFuture
protected volatile io.netty.util.concurrent.Future<?> finishReadFuture
-
-
Constructor Detail
-
VirtualChannel
protected VirtualChannel(VirtualServerChannel parent, VirtualClientConnection connection)
-
-
Method Detail
-
metadata
public io.netty.channel.ChannelMetadata metadata()
-
config
public io.netty.channel.ChannelConfig config()
-
parent
public VirtualServerChannel parent()
- Specified by:
parent
in interfaceio.netty.channel.Channel
- Overrides:
parent
in classio.netty.channel.AbstractChannel
-
localAddress
public VirtualAddress localAddress()
- Specified by:
localAddress
in interfaceio.netty.channel.Channel
- Overrides:
localAddress
in classio.netty.channel.AbstractChannel
-
remoteAddress
public SocketAddress remoteAddress()
- Specified by:
remoteAddress
in interfaceio.netty.channel.Channel
- Overrides:
remoteAddress
in classio.netty.channel.AbstractChannel
-
isOpen
public boolean isOpen()
-
isActive
public boolean isActive()
-
newUnsafe
protected io.netty.channel.AbstractChannel.AbstractUnsafe newUnsafe()
- Specified by:
newUnsafe
in classio.netty.channel.AbstractChannel
-
isCompatible
protected boolean isCompatible(io.netty.channel.EventLoop loop)
- Specified by:
isCompatible
in classio.netty.channel.AbstractChannel
-
localAddress0
protected SocketAddress localAddress0()
- Specified by:
localAddress0
in classio.netty.channel.AbstractChannel
-
remoteAddress0
protected SocketAddress remoteAddress0()
- Specified by:
remoteAddress0
in classio.netty.channel.AbstractChannel
-
doRegister
protected void doRegister() throws Exception
- Overrides:
doRegister
in classio.netty.channel.AbstractChannel
- Throws:
Exception
-
doBind
protected void doBind(SocketAddress localAddress) throws Exception
- Specified by:
doBind
in classio.netty.channel.AbstractChannel
- Throws:
Exception
-
doDisconnect
protected void doDisconnect() throws Exception
- Specified by:
doDisconnect
in classio.netty.channel.AbstractChannel
- Throws:
Exception
-
doClose
protected void doClose() throws Exception
- Specified by:
doClose
in classio.netty.channel.AbstractChannel
- Throws:
Exception
-
doDeregister
protected void doDeregister() throws Exception
- Overrides:
doDeregister
in classio.netty.channel.AbstractChannel
- Throws:
Exception
-
readInbound
protected void readInbound()
-
doBeginRead
protected void doBeginRead() throws Exception
- Specified by:
doBeginRead
in classio.netty.channel.AbstractChannel
- Throws:
Exception
-
-