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.AbstractChannelAChannelfor the local transport. This is a bit different than 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.ChannelPromiseconnectPromiseprotected static AtomicReferenceFieldUpdater<VirtualChannel,io.netty.util.concurrent.Future>FINISH_READ_FUTURE_UPDATERprotected io.netty.util.concurrent.Future<?>finishReadFuture(package private) Queue<Object>inboundBufferprotected VirtualAddresslocalAddressprotected booleanreadInProgressprotected SocketAddressremoteAddressprotected io.quarkus.netty.runtime.virtual.VirtualChannel.Statestate(package private) VirtualClientConnectionvirtualConnectionprotected booleanwriteInProgress
-
Constructor Summary
Constructors Modifier Constructor Description protectedVirtualChannel(VirtualServerChannel parent, VirtualClientConnection connection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.channel.ChannelConfigconfig()protected voiddoBeginRead()protected voiddoBind(SocketAddress localAddress)protected voiddoClose()protected voiddoDeregister()protected voiddoDisconnect()protected voiddoRegister()protected voiddoWrite(io.netty.channel.ChannelOutboundBuffer in)booleanisActive()protected booleanisCompatible(io.netty.channel.EventLoop loop)booleanisOpen()VirtualAddresslocalAddress()protected SocketAddresslocalAddress0()io.netty.channel.ChannelMetadatametadata()protected io.netty.channel.AbstractChannel.AbstractUnsafenewUnsafe()VirtualServerChannelparent()protected voidreadInbound()SocketAddressremoteAddress()protected SocketAddressremoteAddress0()-
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:
parentin interfaceio.netty.channel.Channel- Overrides:
parentin classio.netty.channel.AbstractChannel
-
localAddress
public VirtualAddress localAddress()
- Specified by:
localAddressin interfaceio.netty.channel.Channel- Overrides:
localAddressin classio.netty.channel.AbstractChannel
-
remoteAddress
public SocketAddress remoteAddress()
- Specified by:
remoteAddressin interfaceio.netty.channel.Channel- Overrides:
remoteAddressin classio.netty.channel.AbstractChannel
-
isOpen
public boolean isOpen()
-
isActive
public boolean isActive()
-
newUnsafe
protected io.netty.channel.AbstractChannel.AbstractUnsafe newUnsafe()
- Specified by:
newUnsafein classio.netty.channel.AbstractChannel
-
isCompatible
protected boolean isCompatible(io.netty.channel.EventLoop loop)
- Specified by:
isCompatiblein classio.netty.channel.AbstractChannel
-
localAddress0
protected SocketAddress localAddress0()
- Specified by:
localAddress0in classio.netty.channel.AbstractChannel
-
remoteAddress0
protected SocketAddress remoteAddress0()
- Specified by:
remoteAddress0in classio.netty.channel.AbstractChannel
-
doRegister
protected void doRegister() throws Exception- Overrides:
doRegisterin classio.netty.channel.AbstractChannel- Throws:
Exception
-
doBind
protected void doBind(SocketAddress localAddress) throws Exception
- Specified by:
doBindin classio.netty.channel.AbstractChannel- Throws:
Exception
-
doDisconnect
protected void doDisconnect() throws Exception- Specified by:
doDisconnectin classio.netty.channel.AbstractChannel- Throws:
Exception
-
doClose
protected void doClose() throws Exception- Specified by:
doClosein classio.netty.channel.AbstractChannel- Throws:
Exception
-
doDeregister
protected void doDeregister() throws Exception- Overrides:
doDeregisterin classio.netty.channel.AbstractChannel- Throws:
Exception
-
readInbound
protected void readInbound()
-
doBeginRead
protected void doBeginRead() throws Exception- Specified by:
doBeginReadin classio.netty.channel.AbstractChannel- Throws:
Exception
-
-