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) voidexceptionOccurred(FilterChainContext ctx, Throwable error) Notification about exception, occurred on theFilterChainExecute 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.voidonAdded(FilterChain filterChain) Method is called, when the Filter has been added to the passedFilterChain.voidonFilterChainChanged(FilterChain filterChain) Method is called, when theFilterChainthis Filter is part of, has been changed.voidonRemoved(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:
onAddedin interfaceFilter- Parameters:
filterChain- theFilterChainthis Filter was added to.
-
onFilterChainChanged
Method is called, when theFilterChainthis Filter is part of, has been changed.- Specified by:
onFilterChainChangedin interfaceFilter- Parameters:
filterChain- theFilterChain.
-
onRemoved
Method is called, when the Filter has been removed from the passedFilterChain.- Specified by:
onRemovedin interfaceFilter- Parameters:
filterChain- theFilterChainthis Filter was removed from.
-
handleRead
Execute a unit of processing work to be performed, when channel will become available for reading. ThisFiltermay either complete the required processing and return false, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returning true.- Specified by:
handleReadin interfaceFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction 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. ThisFiltermay either complete the required processing and return false, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returning true.- Specified by:
handleWritein interfaceFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleConnect
Execute a unit of processing work to be performed, when channel gets connected. ThisFiltermay either complete the required processing and return false, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returning true.- Specified by:
handleConnectin interfaceFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction 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. ThisFiltermay either complete the required processing and return false, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returning true.- Specified by:
handleAcceptin interfaceFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleEvent
Handle custom event associated with theConnection. ThisFiltermay either complete the required processing and returnStopAction, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returningInvokeAction.- Specified by:
handleEventin interfaceFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleClose
Execute a unit of processing work to be performed, when connection has been closed. ThisFiltermay either complete the required processing and return false, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returning true.- Specified by:
handleClosein interfaceFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
exceptionOccurred
Notification about exception, occurred on theFilterChain- Specified by:
exceptionOccurredin interfaceFilter- Parameters:
ctx- event processingFilterChainContexterror- error, which occurred during FilterChain execution
-
createContext
public FilterChainContext createContext(Connection connection, FilterChainContext.Operation operation) -
toString
-