org.glassfish.grizzly.utils
Class LogFilter

java.lang.Object
  extended by org.glassfish.grizzly.filterchain.BaseFilter
      extended by org.glassfish.grizzly.utils.LogFilter
All Implemented Interfaces:
Filter

public class LogFilter
extends BaseFilter

Simple log Filter

Author:
Alexey Stashok

Constructor Summary
LogFilter()
           
LogFilter(java.util.logging.Logger logger)
           
LogFilter(java.util.logging.Logger logger, java.util.logging.Level level)
           
 
Method Summary
 void exceptionOccurred(FilterChainContext ctx, java.lang.Throwable error)
          Notification about exception, occurred on the FilterChain
 java.util.logging.Level getLevel()
           
 java.util.logging.Logger getLogger()
           
 NextAction handleAccept(FilterChainContext ctx)
          Execute a unit of processing work to be performed, when server channel has accepted the client connection.
 NextAction handleClose(FilterChainContext ctx)
          Execute a unit of processing work to be performed, when connection has been closed.
 NextAction handleConnect(FilterChainContext ctx)
          Execute a unit of processing work to be performed, when channel gets connected.
 NextAction handleRead(FilterChainContext ctx)
          Execute a unit of processing work to be performed, when channel will become available for reading.
 NextAction handleWrite(FilterChainContext ctx)
          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 passed FilterChain.
 void onFilterChainChanged(FilterChain filterChain)
          Method is called, when the FilterChain this Filter is part of, has been changed.
 void onRemoved(FilterChain filterChain)
          Method is called, when the Filter has been removed from the passed FilterChain.
 
Methods inherited from class org.glassfish.grizzly.filterchain.BaseFilter
createContext, getFilterChain, getIndex, handleEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogFilter

public LogFilter()

LogFilter

public LogFilter(java.util.logging.Logger logger)

LogFilter

public LogFilter(java.util.logging.Logger logger,
                 java.util.logging.Level level)
Method Detail

getLogger

public java.util.logging.Logger getLogger()

getLevel

public java.util.logging.Level getLevel()

onAdded

public void onAdded(FilterChain filterChain)
Description copied from interface: Filter
Method is called, when the Filter has been added to the passed FilterChain.

Specified by:
onAdded in interface Filter
Overrides:
onAdded in class BaseFilter
Parameters:
filterChain - the FilterChain this Filter was added to.

onRemoved

public void onRemoved(FilterChain filterChain)
Description copied from interface: Filter
Method is called, when the Filter has been removed from the passed FilterChain.

Specified by:
onRemoved in interface Filter
Overrides:
onRemoved in class BaseFilter
Parameters:
filterChain - the FilterChain this Filter was removed from.

onFilterChainChanged

public void onFilterChainChanged(FilterChain filterChain)
Description copied from interface: Filter
Method is called, when the FilterChain this Filter is part of, has been changed.

Specified by:
onFilterChainChanged in interface Filter
Overrides:
onFilterChainChanged in class BaseFilter
Parameters:
filterChain - the FilterChain.

handleRead

public NextAction handleRead(FilterChainContext ctx)
                      throws java.io.IOException
Description copied from class: BaseFilter
Execute a unit of processing work to be performed, when channel will become available for reading. This Filter may either complete the required processing and return false, or delegate remaining processing to the next Filter in a FilterChain containing this Filter by returning true.

Specified by:
handleRead in interface Filter
Overrides:
handleRead in class BaseFilter
Parameters:
ctx - FilterChainContext
Returns:
NextAction instruction for FilterChain, how it should continue the execution
Throws:
java.io.IOException

handleWrite

public NextAction handleWrite(FilterChainContext ctx)
                       throws java.io.IOException
Description copied from class: BaseFilter
Execute a unit of processing work to be performed, when some data should be written on channel. This Filter may either complete the required processing and return false, or delegate remaining processing to the next Filter in a FilterChain containing this Filter by returning true.

Specified by:
handleWrite in interface Filter
Overrides:
handleWrite in class BaseFilter
Parameters:
ctx - FilterChainContext
Returns:
NextAction instruction for FilterChain, how it should continue the execution
Throws:
java.io.IOException

handleConnect

public NextAction handleConnect(FilterChainContext ctx)
                         throws java.io.IOException
Description copied from class: BaseFilter
Execute a unit of processing work to be performed, when channel gets connected. This Filter may either complete the required processing and return false, or delegate remaining processing to the next Filter in a FilterChain containing this Filter by returning true.

Specified by:
handleConnect in interface Filter
Overrides:
handleConnect in class BaseFilter
Parameters:
ctx - FilterChainContext
Returns:
NextAction instruction for FilterChain, how it should continue the execution
Throws:
java.io.IOException

handleAccept

public NextAction handleAccept(FilterChainContext ctx)
                        throws java.io.IOException
Description copied from class: BaseFilter
Execute a unit of processing work to be performed, when server channel has accepted the client connection. This Filter may either complete the required processing and return false, or delegate remaining processing to the next Filter in a FilterChain containing this Filter by returning true.

Specified by:
handleAccept in interface Filter
Overrides:
handleAccept in class BaseFilter
Parameters:
ctx - FilterChainContext
Returns:
NextAction instruction for FilterChain, how it should continue the execution
Throws:
java.io.IOException

handleClose

public NextAction handleClose(FilterChainContext ctx)
                       throws java.io.IOException
Description copied from class: BaseFilter
Execute a unit of processing work to be performed, when connection has been closed. This Filter may either complete the required processing and return false, or delegate remaining processing to the next Filter in a FilterChain containing this Filter by returning true.

Specified by:
handleClose in interface Filter
Overrides:
handleClose in class BaseFilter
Parameters:
ctx - FilterChainContext
Returns:
NextAction instruction for FilterChain, how it should continue the execution
Throws:
java.io.IOException

exceptionOccurred

public void exceptionOccurred(FilterChainContext ctx,
                              java.lang.Throwable error)
Description copied from class: BaseFilter
Notification about exception, occurred on the FilterChain

Specified by:
exceptionOccurred in interface Filter
Overrides:
exceptionOccurred in class BaseFilter
Parameters:
ctx - event processing FilterChainContext
error - error, which occurred during FilterChain execution


Copyright © 2012 Oracle Corporation. All Rights Reserved.