public abstract class ConnectionBase extends Object
| Modifier and Type | Field and Description |
|---|---|
protected io.netty.channel.ChannelHandlerContext |
chctx |
static VertxException |
CLOSED_EXCEPTION
An exception used to signal a closed connection to an exception handler.
|
protected ContextInternal |
context |
protected VertxInternal |
vertx |
io.netty.channel.VoidChannelPromise |
voidPromise |
| Modifier | Constructor and Description |
|---|---|
protected |
ConnectionBase(VertxInternal vertx,
io.netty.channel.ChannelHandlerContext chctx,
ContextInternal context) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addFuture(Handler<AsyncResult<Void>> completionHandler,
io.netty.channel.ChannelFuture future) |
io.netty.channel.Channel |
channel() |
io.netty.channel.ChannelPromise |
channelFuture() |
io.netty.channel.ChannelHandlerContext |
channelHandlerContext() |
protected void |
checkContext() |
void |
close()
Close the connection
|
void |
close(Handler<AsyncResult<Void>> handler)
Close the connection and notifies the
handler |
ConnectionBase |
closeHandler(Handler<Void> handler) |
void |
doPause() |
void |
doResume() |
void |
doSetWriteQueueMaxSize(int size) |
protected Handler<Throwable> |
exceptionHandler() |
ConnectionBase |
exceptionHandler(Handler<Throwable> handler) |
void |
fail(Throwable error)
Fail the connection, the
error will be sent to the pipeline and the connection will
stop processing any further message. |
void |
flush()
Asynchronous flush.
|
void |
flush(io.netty.channel.ChannelPromise promise)
Asynchronous flush.
|
ContextInternal |
getContext() |
protected void |
handleClosed() |
protected void |
handleException(Throwable t) |
protected void |
handleIdle()
Called by the Netty handler when the connection becomes idle.
|
protected abstract void |
handleInterestedOpsChanged() |
void |
handleMessage(Object msg) |
VertxHandler |
handler() |
String |
indicatedServerName() |
boolean |
isNotWritable() |
boolean |
isSsl() |
SocketAddress |
localAddress() |
Object |
metric() |
void |
metric(Object metric) |
abstract NetworkMetrics |
metrics() |
X509Certificate[] |
peerCertificateChain() |
SocketAddress |
remoteAddress() |
String |
remoteName() |
void |
reportBytesRead(long numberOfBytes) |
void |
reportBytesWritten(long numberOfBytes) |
protected io.netty.channel.ChannelFuture |
sendFile(RandomAccessFile raf,
long offset,
long length) |
SSLSession |
sslSession() |
protected boolean |
supportsFileRegion() |
io.netty.channel.ChannelPromise |
toPromise(Handler<AsyncResult<Void>> handler)
Provide a promise that will call the
handler upon completion. |
void |
writeToChannel(Object obj) |
void |
writeToChannel(Object msg,
io.netty.channel.ChannelPromise promise) |
public static final VertxException CLOSED_EXCEPTION
public final io.netty.channel.VoidChannelPromise voidPromise
protected final VertxInternal vertx
protected final io.netty.channel.ChannelHandlerContext chctx
protected final ContextInternal context
protected ConnectionBase(VertxInternal vertx, io.netty.channel.ChannelHandlerContext chctx, ContextInternal context)
public void fail(Throwable error)
error will be sent to the pipeline and the connection will
stop processing any further message.error - the Throwable to propagatepublic VertxHandler handler()
public final io.netty.channel.ChannelPromise toPromise(Handler<AsyncResult<Void>> handler)
handler upon completion.
When the handler is null voidPromise is returned.handler - the handlerpublic void writeToChannel(Object msg, io.netty.channel.ChannelPromise promise)
public void writeToChannel(Object obj)
public final void flush()
public final void flush(io.netty.channel.ChannelPromise promise)
promise - the promise resolved when flush occurredpublic boolean isNotWritable()
public void close()
public void close(Handler<AsyncResult<Void>> handler)
handlerpublic ConnectionBase closeHandler(Handler<Void> handler)
public ConnectionBase exceptionHandler(Handler<Throwable> handler)
public void doPause()
public void doResume()
public void doSetWriteQueueMaxSize(int size)
protected final void checkContext()
public final io.netty.channel.Channel channel()
public final io.netty.channel.ChannelHandlerContext channelHandlerContext()
public final ContextInternal getContext()
public final void metric(Object metric)
public final Object metric()
public abstract NetworkMetrics metrics()
protected void handleException(Throwable t)
protected void handleClosed()
protected void handleIdle()
protected abstract void handleInterestedOpsChanged()
protected void addFuture(Handler<AsyncResult<Void>> completionHandler, io.netty.channel.ChannelFuture future)
protected boolean supportsFileRegion()
public void reportBytesRead(long numberOfBytes)
public void reportBytesWritten(long numberOfBytes)
protected io.netty.channel.ChannelFuture sendFile(RandomAccessFile raf, long offset, long length) throws IOException
IOExceptionpublic boolean isSsl()
public SSLSession sslSession()
public X509Certificate[] peerCertificateChain() throws SSLPeerUnverifiedException
SSLPeerUnverifiedExceptionpublic String indicatedServerName()
public io.netty.channel.ChannelPromise channelFuture()
public String remoteName()
public SocketAddress remoteAddress()
public SocketAddress localAddress()
public void handleMessage(Object msg)
Copyright © 2020. All rights reserved.