Package io.netty.channel.embedded
Klasse Plc4xEmbeddedChannel
java.lang.Object
io.netty.util.DefaultAttributeMap
io.netty.channel.AbstractChannel
io.netty.channel.embedded.Plc4xEmbeddedChannel
- Alle implementierten Schnittstellen:
EventLoopProvider,io.netty.channel.Channel,io.netty.channel.ChannelOutboundInvoker,io.netty.util.AttributeMap,Comparable<io.netty.channel.Channel>
public class Plc4xEmbeddedChannel
extends io.netty.channel.AbstractChannel
implements EventLoopProvider
Base class for
Channel implementations that are used in an embedded fashion.-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen io.netty.channel.AbstractChannel
io.netty.channel.AbstractChannel.AbstractUnsafeVon Schnittstelle geerbte verschachtelte Klassen/Schnittstellen io.netty.channel.Channel
io.netty.channel.Channel.Unsafe -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCreate a new instance with anEmbeddedChannelIdand an empty pipeline.Plc4xEmbeddedChannel(boolean register, boolean hasDisconnect, io.netty.channel.ChannelHandler... handlers) Create a new instance with the pipeline initialized with the specified handlers.Plc4xEmbeddedChannel(boolean hasDisconnect, io.netty.channel.ChannelHandler... handlers) Create a new instance with the pipeline initialized with the specified handlers.Plc4xEmbeddedChannel(io.netty.channel.ChannelHandler... handlers) Create a new instance with the pipeline initialized with the specified handlers.Plc4xEmbeddedChannel(io.netty.channel.ChannelId channelId) Create a new instance with the specified ID and an empty pipeline.Plc4xEmbeddedChannel(io.netty.channel.ChannelId channelId, boolean register, boolean hasDisconnect, io.netty.channel.ChannelHandler... handlers) Create a new instance with the channel ID set to the given ID and the pipeline initialized with the specified handlers.Plc4xEmbeddedChannel(io.netty.channel.ChannelId channelId, boolean hasDisconnect, io.netty.channel.ChannelConfig config, io.netty.channel.ChannelHandler... handlers) Create a new instance with the channel ID set to the given ID and the pipeline initialized with the specified handlers.Plc4xEmbeddedChannel(io.netty.channel.ChannelId channelId, boolean hasDisconnect, io.netty.channel.ChannelHandler... handlers) Create a new instance with the channel ID set to the given ID and the pipeline initialized with the specified handlers.Plc4xEmbeddedChannel(io.netty.channel.ChannelId channelId, io.netty.channel.ChannelHandler... handlers) Create a new instance with the channel ID set to the given ID and the pipeline initialized with the specified handlers.Plc4xEmbeddedChannel(io.netty.channel.Channel parent, io.netty.channel.ChannelId channelId, boolean register, boolean hasDisconnect, io.netty.channel.ChannelHandler... handlers) Create a new instance with the channel ID set to the given ID and the pipeline initialized with the specified handlers. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidCheck if there was anyThrowablereceived and if so rethrow it.final io.netty.channel.ChannelFutureclose()final io.netty.channel.ChannelFutureclose(io.netty.channel.ChannelPromise promise) io.netty.channel.ChannelConfigconfig()final io.netty.channel.ChannelFuturefinal io.netty.channel.ChannelFuturedisconnect(io.netty.channel.ChannelPromise promise) protected voidprotected voiddoBind(SocketAddress localAddress) protected voiddoClose()protected voidprotected voidprotected voiddoWrite(io.netty.channel.ChannelOutboundBuffer in) protected final voidEnsure theChannelis open and if not throw an exception.booleanfinish()Mark thisChannelas finished.booleanMark thisChannelas finished and release all pending message in the inbound and outbound buffer.Flushes the inbound of thisChannel.Flushes the outbound of thisChannel.io.netty.channel.EventLoopprotected voidCalled for each inbound message.protected voidCalled for each outbound message.booleanisActive()protected booleanisCompatible(io.netty.channel.EventLoop loop) booleanisOpen()booleanVeraltet.Veraltet.protected SocketAddressio.netty.channel.ChannelMetadatametadata()protected final io.netty.channel.DefaultChannelPipelineprotected io.netty.channel.AbstractChannel.AbstractUnsafe<T> TReturn received data from thisChannel<T> TRead data from the outbound.voidregister()Register thisChannelon itsEventLoop.booleanRelease all buffered inbound messages and returntrueif any were in the inbound buffer,falseotherwise.booleanRelease all buffered outbound messages and returntrueif any were in the outbound buffer,falseotherwise.protected SocketAddressvoidRun all tasks (which also includes scheduled tasks) that are pending in theEventLoopfor thisChannellongRun all pending scheduled tasks in theEventLoopfor thisChanneland return thenanosecondswhen the next scheduled task is ready to run.io.netty.channel.Channel.Unsafeunsafe()booleanwriteInbound(Object... msgs) Write messages to the inbound of thisChannel.io.netty.channel.ChannelFuturewriteOneInbound(Object msg) Writes one message to the inbound of thisChanneland does not flush it.io.netty.channel.ChannelFuturewriteOneInbound(Object msg, io.netty.channel.ChannelPromise promise) Writes one message to the inbound of thisChanneland does not flush it.io.netty.channel.ChannelFuturewriteOneOutbound(Object msg) Writes one message to the outbound of thisChanneland does not flush it.io.netty.channel.ChannelFuturewriteOneOutbound(Object msg, io.netty.channel.ChannelPromise promise) Writes one message to the outbound of thisChanneland does not flush it.booleanwriteOutbound(Object... msgs) Write messages to the outbound of thisChannel.Von Klasse geerbte Methoden io.netty.channel.AbstractChannel
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, doDeregister, doShutdownOutput, equals, eventLoop, filterOutboundMessage, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isWritable, localAddress, maxMessagesPerWrite, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, toString, validateFileRegion, voidPromise, write, write, writeAndFlush, writeAndFlushVon Klasse geerbte Methoden io.netty.util.DefaultAttributeMap
attr, hasAttrVon Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden io.netty.util.AttributeMap
attr, hasAttr
-
Konstruktordetails
-
Plc4xEmbeddedChannel
public Plc4xEmbeddedChannel()Create a new instance with anEmbeddedChannelIdand an empty pipeline. -
Plc4xEmbeddedChannel
public Plc4xEmbeddedChannel(io.netty.channel.ChannelId channelId) Create a new instance with the specified ID and an empty pipeline.- Parameter:
channelId- theChannelIdthat will be used to identify this channel
-
Plc4xEmbeddedChannel
public Plc4xEmbeddedChannel(io.netty.channel.ChannelHandler... handlers) Create a new instance with the pipeline initialized with the specified handlers.- Parameter:
handlers- theChannelHandlers which will be add in theChannelPipeline
-
Plc4xEmbeddedChannel
public Plc4xEmbeddedChannel(boolean hasDisconnect, io.netty.channel.ChannelHandler... handlers) Create a new instance with the pipeline initialized with the specified handlers.- Parameter:
hasDisconnect-falseif thisChannelwill delegatedisconnect()toclose(), false otherwise.handlers- theChannelHandlers which will be add in theChannelPipeline
-
Plc4xEmbeddedChannel
public Plc4xEmbeddedChannel(boolean register, boolean hasDisconnect, io.netty.channel.ChannelHandler... handlers) Create a new instance with the pipeline initialized with the specified handlers.- Parameter:
register-trueif thisChannelis registered to theEventLoopin the constructor. Iffalsethe user will need to callregister().hasDisconnect-falseif thisChannelwill delegatedisconnect()toclose(), false otherwise.handlers- theChannelHandlers which will be add in theChannelPipeline
-
Plc4xEmbeddedChannel
public Plc4xEmbeddedChannel(io.netty.channel.ChannelId channelId, io.netty.channel.ChannelHandler... handlers) Create a new instance with the channel ID set to the given ID and the pipeline initialized with the specified handlers.- Parameter:
channelId- theChannelIdthat will be used to identify this channelhandlers- theChannelHandlers which will be add in theChannelPipeline
-
Plc4xEmbeddedChannel
public Plc4xEmbeddedChannel(io.netty.channel.ChannelId channelId, boolean hasDisconnect, io.netty.channel.ChannelHandler... handlers) Create a new instance with the channel ID set to the given ID and the pipeline initialized with the specified handlers.- Parameter:
channelId- theChannelIdthat will be used to identify this channelhasDisconnect-falseif thisChannelwill delegatedisconnect()toclose(), false otherwise.handlers- theChannelHandlers which will be add in theChannelPipeline
-
Plc4xEmbeddedChannel
public Plc4xEmbeddedChannel(io.netty.channel.ChannelId channelId, boolean register, boolean hasDisconnect, io.netty.channel.ChannelHandler... handlers) Create a new instance with the channel ID set to the given ID and the pipeline initialized with the specified handlers.- Parameter:
channelId- theChannelIdthat will be used to identify this channelregister-trueif thisChannelis registered to theEventLoopin the constructor. Iffalsethe user will need to callregister().hasDisconnect-falseif thisChannelwill delegatedisconnect()toclose(), false otherwise.handlers- theChannelHandlers which will be add in theChannelPipeline
-
Plc4xEmbeddedChannel
public Plc4xEmbeddedChannel(io.netty.channel.Channel parent, io.netty.channel.ChannelId channelId, boolean register, boolean hasDisconnect, io.netty.channel.ChannelHandler... handlers) Create a new instance with the channel ID set to the given ID and the pipeline initialized with the specified handlers.- Parameter:
parent- the parentChannelof thisEmbeddedChannel.channelId- theChannelIdthat will be used to identify this channelregister-trueif thisChannelis registered to theEventLoopin the constructor. Iffalsethe user will need to callregister().hasDisconnect-falseif thisChannelwill delegatedisconnect()toclose(), false otherwise.handlers- theChannelHandlers which will be add in theChannelPipeline
-
Plc4xEmbeddedChannel
public Plc4xEmbeddedChannel(io.netty.channel.ChannelId channelId, boolean hasDisconnect, io.netty.channel.ChannelConfig config, io.netty.channel.ChannelHandler... handlers) Create a new instance with the channel ID set to the given ID and the pipeline initialized with the specified handlers.- Parameter:
channelId- theChannelIdthat will be used to identify this channelhasDisconnect-falseif thisChannelwill delegatedisconnect()toclose(), false otherwise.config- theChannelConfigwhich will be returned byconfig().handlers- theChannelHandlers which will be add in theChannelPipeline
-
-
Methodendetails
-
getEventLoop
public io.netty.channel.EventLoop getEventLoop()- Angegeben von:
getEventLoopin SchnittstelleEventLoopProvider
-
isRegistered
public boolean isRegistered()- Angegeben von:
isRegisteredin Schnittstelleio.netty.channel.Channel- Setzt außer Kraft:
isRegisteredin Klasseio.netty.channel.AbstractChannel
-
register
Register thisChannelon itsEventLoop.- Löst aus:
Exception
-
newChannelPipeline
protected final io.netty.channel.DefaultChannelPipeline newChannelPipeline()- Setzt außer Kraft:
newChannelPipelinein Klasseio.netty.channel.AbstractChannel
-
metadata
public io.netty.channel.ChannelMetadata metadata()- Angegeben von:
metadatain Schnittstelleio.netty.channel.Channel
-
config
public io.netty.channel.ChannelConfig config()- Angegeben von:
configin Schnittstelleio.netty.channel.Channel
-
isOpen
public boolean isOpen()- Angegeben von:
isOpenin Schnittstelleio.netty.channel.Channel
-
isActive
public boolean isActive()- Angegeben von:
isActivein Schnittstelleio.netty.channel.Channel
-
inboundMessages
-
lastInboundBuffer
Veraltet. -
outboundMessages
-
lastOutboundBuffer
Veraltet. -
readInbound
public <T> T readInbound()Return received data from thisChannel -
readOutbound
public <T> T readOutbound()Read data from the outbound. This may returnnullif nothing is readable. -
writeInbound
Write messages to the inbound of thisChannel.- Parameter:
msgs- the messages to be written- Gibt zurück:
trueif the write operation did add something to the inbound buffer
-
writeOneInbound
Writes one message to the inbound of thisChanneland does not flush it. This method is conceptually equivalent toAbstractChannel.write(Object).- Siehe auch:
-
writeOneInbound
public io.netty.channel.ChannelFuture writeOneInbound(Object msg, io.netty.channel.ChannelPromise promise) Writes one message to the inbound of thisChanneland does not flush it. This method is conceptually equivalent toAbstractChannel.write(Object, ChannelPromise).- Siehe auch:
-
flushInbound
Flushes the inbound of thisChannel. This method is conceptually equivalent toAbstractChannel.flush().- Siehe auch:
-
writeOutbound
Write messages to the outbound of thisChannel.- Parameter:
msgs- the messages to be written- Gibt zurück:
- bufferReadable returns
trueif the write operation did add something to the outbound buffer
-
writeOneOutbound
Writes one message to the outbound of thisChanneland does not flush it. This method is conceptually equivalent toAbstractChannel.write(Object).- Siehe auch:
-
writeOneOutbound
public io.netty.channel.ChannelFuture writeOneOutbound(Object msg, io.netty.channel.ChannelPromise promise) Writes one message to the outbound of thisChanneland does not flush it. This method is conceptually equivalent toAbstractChannel.write(Object, ChannelPromise).- Siehe auch:
-
flushOutbound
Flushes the outbound of thisChannel. This method is conceptually equivalent toAbstractChannel.flush().- Siehe auch:
-
finish
public boolean finish()Mark thisChannelas finished. Any further try to write data to it will fail.- Gibt zurück:
- bufferReadable returns
trueif any of the used buffers has something left to read
-
finishAndReleaseAll
public boolean finishAndReleaseAll()Mark thisChannelas finished and release all pending message in the inbound and outbound buffer. Any further try to write data to it will fail.- Gibt zurück:
- bufferReadable returns
trueif any of the used buffers has something left to read
-
releaseInbound
public boolean releaseInbound()Release all buffered inbound messages and returntrueif any were in the inbound buffer,falseotherwise. -
releaseOutbound
public boolean releaseOutbound()Release all buffered outbound messages and returntrueif any were in the outbound buffer,falseotherwise. -
close
public final io.netty.channel.ChannelFuture close()- Angegeben von:
closein Schnittstelleio.netty.channel.ChannelOutboundInvoker- Setzt außer Kraft:
closein Klasseio.netty.channel.AbstractChannel
-
disconnect
public final io.netty.channel.ChannelFuture disconnect()- Angegeben von:
disconnectin Schnittstelleio.netty.channel.ChannelOutboundInvoker- Setzt außer Kraft:
disconnectin Klasseio.netty.channel.AbstractChannel
-
close
public final io.netty.channel.ChannelFuture close(io.netty.channel.ChannelPromise promise) - Angegeben von:
closein Schnittstelleio.netty.channel.ChannelOutboundInvoker- Setzt außer Kraft:
closein Klasseio.netty.channel.AbstractChannel
-
disconnect
public final io.netty.channel.ChannelFuture disconnect(io.netty.channel.ChannelPromise promise) - Angegeben von:
disconnectin Schnittstelleio.netty.channel.ChannelOutboundInvoker- Setzt außer Kraft:
disconnectin Klasseio.netty.channel.AbstractChannel
-
runPendingTasks
public void runPendingTasks()Run all tasks (which also includes scheduled tasks) that are pending in theEventLoopfor thisChannel -
runScheduledPendingTasks
public long runScheduledPendingTasks()Run all pending scheduled tasks in theEventLoopfor thisChanneland return thenanosecondswhen the next scheduled task is ready to run. If no other task was scheduled it will return-1. -
checkException
public void checkException()Check if there was anyThrowablereceived and if so rethrow it. -
ensureOpen
protected final void ensureOpen()Ensure theChannelis open and if not throw an exception. -
isCompatible
protected boolean isCompatible(io.netty.channel.EventLoop loop) - Angegeben von:
isCompatiblein Klasseio.netty.channel.AbstractChannel
-
localAddress0
- Angegeben von:
localAddress0in Klasseio.netty.channel.AbstractChannel
-
remoteAddress0
- Angegeben von:
remoteAddress0in Klasseio.netty.channel.AbstractChannel
-
doRegister
- Setzt außer Kraft:
doRegisterin Klasseio.netty.channel.AbstractChannel- Löst aus:
Exception
-
doBind
- Angegeben von:
doBindin Klasseio.netty.channel.AbstractChannel- Löst aus:
Exception
-
doDisconnect
- Angegeben von:
doDisconnectin Klasseio.netty.channel.AbstractChannel- Löst aus:
Exception
-
doClose
- Angegeben von:
doClosein Klasseio.netty.channel.AbstractChannel- Löst aus:
Exception
-
doBeginRead
- Angegeben von:
doBeginReadin Klasseio.netty.channel.AbstractChannel- Löst aus:
Exception
-
newUnsafe
protected io.netty.channel.AbstractChannel.AbstractUnsafe newUnsafe()- Angegeben von:
newUnsafein Klasseio.netty.channel.AbstractChannel
-
unsafe
public io.netty.channel.Channel.Unsafe unsafe()- Angegeben von:
unsafein Schnittstelleio.netty.channel.Channel- Setzt außer Kraft:
unsafein Klasseio.netty.channel.AbstractChannel
-
doWrite
- Angegeben von:
doWritein Klasseio.netty.channel.AbstractChannel- Löst aus:
Exception
-
handleOutboundMessage
Called for each outbound message.- Siehe auch:
-
handleInboundMessage
Called for each inbound message.
-
inboundMessages()