rackspace/repose — pull request #179 by zinic (2011-12-14 06:58:54+00:00)
Title: Implementing FilterChain Garbage Collection

## FilterChain Garbage Collection and FilterChain Descoping

When Repose reloads a new filter chain, whether it be because of an update to the deployment artifacts or a new system model, the previously used FilterChain must be drained of consuming clients so that resources may be descoped in a safe, user-friendly manner.

## Implementation

The FilterChain garbage collector is registered as a JNDI service under the context name `powerapi:/services/filter-chain-gc` and has a polling thread set to sweep filter chains that are being garbage collected. The polling interval is low but should be scaled back after performance metrics are gathered for FilterChain swapping and garbage collection.

The garbage collector ensures that `destroy()` is called on every filter instance that's been marked for collection.