Package org.apache.felix.http.base.internal.handler

## Class FilterHandler

- java.lang.Object
- - org.apache.felix.http.base.internal.handler.FilterHandler

All Implemented Interfaces:
  `Comparable<FilterHandler>`

    public class FilterHandler
    extends Object
    implements Comparable<FilterHandler>

The filter handler handles the initialization and destruction of filter objects.

### Field Summary

Fields
`protected int` `useCount`

### Constructor Summary

Constructors
`FilterHandler​(long contextServiceId, ExtServletContext context, FilterInfo filterInfo, org.osgi.framework.BundleContext bundleContext)`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `compareTo​(FilterHandler other)`
`boolean` `destroy()`
`boolean` `dispose()`
`boolean` `equals​(Object obj)`
`ExtServletContext` `getContext()`
`long` `getContextServiceId()`
`javax.servlet.Filter` `getFilter()`
`FilterInfo` `getFilterInfo()`
`String` `getName()`
`void` `handle​(@NotNull javax.servlet.ServletRequest req, @NotNull javax.servlet.ServletResponse res, @NotNull javax.servlet.FilterChain chain)`
`int` `hashCode()`
`int` `init()` Initialize the object

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### useCount

    protected volatile int useCount

### Constructor Detail

#### FilterHandler

    public FilterHandler​(long contextServiceId,
                         ExtServletContext context,
                         FilterInfo filterInfo,
                         org.osgi.framework.BundleContext bundleContext)

### Method Detail

#### compareTo

    public int compareTo​(FilterHandler other)

Specified by:
  `compareTo` in interface `Comparable<FilterHandler>`

#### getContextServiceId

    public long getContextServiceId()

#### getContext

    public ExtServletContext getContext()

#### getFilter

    public javax.servlet.Filter getFilter()

#### getFilterInfo

    public FilterInfo getFilterInfo()

#### getName

    public String getName()

#### init

    public int init()

Initialize the object

Returns:
  {code -1} on success, a failure reason according to `DTOConstants` otherwise.

#### handle

    public void handle​(@NotNull
                       @NotNull javax.servlet.ServletRequest req,
                       @NotNull
                       @NotNull javax.servlet.ServletResponse res,
                       @NotNull
                       @NotNull javax.servlet.FilterChain chain)
                throws javax.servlet.ServletException,
                       IOException

Throws:
  `javax.servlet.ServletException`
  `IOException`

#### destroy

    public boolean destroy()

#### dispose

    public boolean dispose()

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals​(Object obj)

Overrides:
  `equals` in class `Object`