jsr107/jsr107spec — Issue #48: Implement Interceptors
Author: yannis666
Created: 2011-12-06 01:39:23+00:00
State: open

A more formal proposal will follow but creating a new issue here to allow [https://github.com/jsr107/jsr107spec/issues/32](Issue 32) and [https://github.com/jsr107/jsr107spec/issues/43](Issue 43) to be closed.

Instead of listeners the proposal is for Interceptors. Conceptually these will be registrable at well defined points in the call cycle of Cache operations. They will occur in the line of execution of blocking calls. If registered before the "low level" key operation (e.g get/put) from the cache they will be able to block the operation (e.g. by throwing an exception), or to modify any value being submitted. If after the key operation they may modify the return value. Interceptors may be chained. The proposal replaces Listeners but will provide clear semantics and potentially far greater power in that some cache topologies may provide multiple points where interceptors may be registered. For the purpose of 107 which does not define topologies the 2 points where interception will be defined is immediately before and immediately after the "low level: operation.