Package org.glassfish.grizzly.utils
Class LogFilter
- java.lang.Object
-
- org.glassfish.grizzly.filterchain.BaseFilter
-
- org.glassfish.grizzly.utils.LogFilter
-
- All Implemented Interfaces:
Filter
public class LogFilter extends BaseFilter
Simple logFilter- Author:
- Alexey Stashok
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexceptionOccurred(FilterChainContext ctx, Throwable error)Notification about exception, occurred on theFilterChainLevelgetLevel()LoggergetLogger()NextActionhandleAccept(FilterChainContext ctx)Execute a unit of processing work to be performed, when server channel has accepted the client connection.NextActionhandleClose(FilterChainContext ctx)Execute a unit of processing work to be performed, when connection has been closed.NextActionhandleConnect(FilterChainContext ctx)Execute a unit of processing work to be performed, when channel gets connected.NextActionhandleRead(FilterChainContext ctx)Execute a unit of processing work to be performed, when channel will become available for reading.NextActionhandleWrite(FilterChainContext ctx)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.-
Methods inherited from class org.glassfish.grizzly.filterchain.BaseFilter
createContext, handleEvent, toString
-
-
-
-
Method Detail
-
getLogger
public Logger getLogger()
-
getLevel
public Level getLevel()
-
onAdded
public void onAdded(FilterChain filterChain)
Description copied from class:BaseFilterMethod is called, when the Filter has been added to the passedFilterChain.- Specified by:
onAddedin interfaceFilter- Overrides:
onAddedin classBaseFilter- Parameters:
filterChain- theFilterChainthis Filter was added to.
-
onRemoved
public void onRemoved(FilterChain filterChain)
Description copied from class:BaseFilterMethod is called, when the Filter has been removed from the passedFilterChain.- Specified by:
onRemovedin interfaceFilter- Overrides:
onRemovedin classBaseFilter- Parameters:
filterChain- theFilterChainthis Filter was removed from.
-
onFilterChainChanged
public void onFilterChainChanged(FilterChain filterChain)
Description copied from class:BaseFilterMethod is called, when theFilterChainthis Filter is part of, has been changed.- Specified by:
onFilterChainChangedin interfaceFilter- Overrides:
onFilterChainChangedin classBaseFilter- Parameters:
filterChain- theFilterChain.
-
handleRead
public NextAction handleRead(FilterChainContext ctx) throws IOException
Description copied from class:BaseFilterExecute 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- Overrides:
handleReadin classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleWrite
public NextAction handleWrite(FilterChainContext ctx) throws IOException
Description copied from class:BaseFilterExecute 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- Overrides:
handleWritein classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleConnect
public NextAction handleConnect(FilterChainContext ctx) throws IOException
Description copied from class:BaseFilterExecute 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- Overrides:
handleConnectin classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleAccept
public NextAction handleAccept(FilterChainContext ctx) throws IOException
Description copied from class:BaseFilterExecute 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- Overrides:
handleAcceptin classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleClose
public NextAction handleClose(FilterChainContext ctx) throws IOException
Description copied from class:BaseFilterExecute 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- Overrides:
handleClosein classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
exceptionOccurred
public void exceptionOccurred(FilterChainContext ctx, Throwable error)
Description copied from class:BaseFilterNotification about exception, occurred on theFilterChain- Specified by:
exceptionOccurredin interfaceFilter- Overrides:
exceptionOccurredin classBaseFilter- Parameters:
ctx- event processingFilterChainContexterror- error, which occurred during FilterChain execution
-
-