java.lang.Object
org.glassfish.grizzly.filterchain.BaseFilter
- All Implemented Interfaces:
Filter
- Direct Known Subclasses:
AbstractCodecFilter
,ActivityCheckFilter
,DelayFilter
,EchoFilter
,GZipFilter
,IdleTimeoutFilter
,LogFilter
,LZMAFilter
,SilentConnectionFilter
,SSLBaseFilter
,TCPNIOTransportFilter
,TransportFilter
,UDPNIOTransportFilter
Provides empty implementation for
Filter
processing methods.- Author:
- Alexey Stashok
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateContext
(Connection connection, FilterChainContext.Operation operation) void
exceptionOccurred
(FilterChainContext ctx, Throwable error) Notification about exception, occurred on theFilterChain
Execute a unit of processing work to be performed, when server channel has accepted the client connection.Execute a unit of processing work to be performed, when connection has been closed.Execute a unit of processing work to be performed, when channel gets connected.handleEvent
(FilterChainContext ctx, FilterChainEvent event) Handle custom event associated with theConnection
.Execute a unit of processing work to be performed, when channel will become available for reading.Execute a unit of processing work to be performed, when some data should be written on channel.void
onAdded
(FilterChain filterChain) Method is called, when the Filter has been added to the passedFilterChain
.void
onFilterChainChanged
(FilterChain filterChain) Method is called, when theFilterChain
this Filter is part of, has been changed.void
onRemoved
(FilterChain filterChain) Method is called, when the Filter has been removed from the passedFilterChain
.toString()
-
Constructor Details
-
BaseFilter
public BaseFilter()
-
-
Method Details
-
onAdded
Method is called, when the Filter has been added to the passedFilterChain
.- Specified by:
onAdded
in interfaceFilter
- Parameters:
filterChain
- theFilterChain
this Filter was added to.
-
onFilterChainChanged
Method is called, when theFilterChain
this Filter is part of, has been changed.- Specified by:
onFilterChainChanged
in interfaceFilter
- Parameters:
filterChain
- theFilterChain
.
-
onRemoved
Method is called, when the Filter has been removed from the passedFilterChain
.- Specified by:
onRemoved
in interfaceFilter
- Parameters:
filterChain
- theFilterChain
this Filter was removed from.
-
handleRead
Execute a unit of processing work to be performed, when channel will become available for reading. ThisFilter
may either complete the required processing and return false, or delegate remaining processing to the nextFilter
in aFilterChain
containing thisFilter
by returning true.- Specified by:
handleRead
in interfaceFilter
- Parameters:
ctx
-FilterChainContext
- Returns:
NextAction
instruction forFilterChain
, how it should continue the execution- Throws:
IOException
-
handleWrite
Execute a unit of processing work to be performed, when some data should be written on channel. ThisFilter
may either complete the required processing and return false, or delegate remaining processing to the nextFilter
in aFilterChain
containing thisFilter
by returning true.- Specified by:
handleWrite
in interfaceFilter
- Parameters:
ctx
-FilterChainContext
- Returns:
NextAction
instruction forFilterChain
, how it should continue the execution- Throws:
IOException
-
handleConnect
Execute a unit of processing work to be performed, when channel gets connected. ThisFilter
may either complete the required processing and return false, or delegate remaining processing to the nextFilter
in aFilterChain
containing thisFilter
by returning true.- Specified by:
handleConnect
in interfaceFilter
- Parameters:
ctx
-FilterChainContext
- Returns:
NextAction
instruction forFilterChain
, how it should continue the execution- Throws:
IOException
-
handleAccept
Execute a unit of processing work to be performed, when server channel has accepted the client connection. ThisFilter
may either complete the required processing and return false, or delegate remaining processing to the nextFilter
in aFilterChain
containing thisFilter
by returning true.- Specified by:
handleAccept
in interfaceFilter
- Parameters:
ctx
-FilterChainContext
- Returns:
NextAction
instruction forFilterChain
, how it should continue the execution- Throws:
IOException
-
handleEvent
Handle custom event associated with theConnection
. ThisFilter
may either complete the required processing and returnStopAction
, or delegate remaining processing to the nextFilter
in aFilterChain
containing thisFilter
by returningInvokeAction
.- Specified by:
handleEvent
in interfaceFilter
- Parameters:
ctx
-FilterChainContext
- Returns:
NextAction
instruction forFilterChain
, how it should continue the execution- Throws:
IOException
-
handleClose
Execute a unit of processing work to be performed, when connection has been closed. ThisFilter
may either complete the required processing and return false, or delegate remaining processing to the nextFilter
in aFilterChain
containing thisFilter
by returning true.- Specified by:
handleClose
in interfaceFilter
- Parameters:
ctx
-FilterChainContext
- Returns:
NextAction
instruction forFilterChain
, how it should continue the execution- Throws:
IOException
-
exceptionOccurred
Notification about exception, occurred on theFilterChain
- Specified by:
exceptionOccurred
in interfaceFilter
- Parameters:
ctx
- event processingFilterChainContext
error
- error, which occurred during FilterChain execution
-
createContext
public FilterChainContext createContext(Connection connection, FilterChainContext.Operation operation) -
toString
-