public class LifeCycleFilter extends BaseFilter
Filter
, which tracks the connections
lifecycle. The new connections could be either accepted if we have server,
or connected, if we establish client connection.Constructor and Description |
---|
LifeCycleFilter() |
Modifier and Type | Method and Description |
---|---|
Set<Connection> |
getActiveConnections()
Returns the
Set of currently active Connection s. |
int |
getTotalConnections()
Returns the total number of connections ever
created by the
Transport |
NextAction |
handleAccept(FilterChainContext ctx)
Method is called, when new
Connection was
accepted by a Transport |
NextAction |
handleClose(FilterChainContext ctx)
Method is called, when the
Connection is getting closed |
NextAction |
handleConnect(FilterChainContext ctx)
Method is called, when new client
Connection was
connected to some endpoint |
createContext, exceptionOccurred, handleEvent, handleRead, handleWrite, onAdded, onFilterChainChanged, onRemoved
public NextAction handleAccept(FilterChainContext ctx) throws IOException
Connection
was
accepted by a Transport
handleAccept
in interface Filter
handleAccept
in class BaseFilter
ctx
- the filter chain contextIOException
public NextAction handleConnect(FilterChainContext ctx) throws IOException
Connection
was
connected to some endpointhandleConnect
in interface Filter
handleConnect
in class BaseFilter
ctx
- the filter chain contextIOException
public NextAction handleClose(FilterChainContext ctx) throws IOException
Connection
is getting closedhandleClose
in interface Filter
handleClose
in class BaseFilter
ctx
- the filter chain contextIOException
public int getTotalConnections()
Transport
Transport
public Set<Connection> getActiveConnections()
Set
of currently active Connection
s.Set
of currently active Connection
sCopyright © 2014 Oracle Corporation. All rights reserved.