com.opensymphony.oscache.base
Interface LifecycleAware
- All Known Implementing Classes:
- AbstractBroadcastingListener, JavaGroupsBroadcastingListener, JMS10BroadcastingListener, JMSBroadcastingListener
public interface LifecycleAware
Event handlers implement this so they can be notified when a cache
is created and also when it is destroyed. This allows event handlers
to load any configuration and/or resources they need on startup and
then release them again when the cache is shut down.
- Author:
- Chris Miller
- See Also:
CacheEventListener
|
Method Summary |
void |
finialize()
Called by the cache administrator class when a cache is destroyed. |
void |
initialize(Cache cache,
Config config)
Called by the cache administrator class when a cache is instantiated. |
initialize
void initialize(Cache cache,
Config config)
throws InitializationException
- Called by the cache administrator class when a cache is instantiated.
- Parameters:
cache - the cache instance that this listener is attached to.config - The cache's configuration details. This allows the event handler
to initialize itself based on the cache settings, and also to receive additional
settings that were part of the cache configuration but that the cache
itself does not care about. If you are using cache.properties
for your configuration, simply add any additional properties that your event
handler requires and they will be passed through in this parameter.
- Throws:
InitializationException - thrown when there was a problem initializing the
listener. The cache administrator will log this error and disable the listener.
finialize
void finialize()
throws FinalizationException
- Called by the cache administrator class when a cache is destroyed.
- Throws:
FinalizationException - thrown when there was a problem finalizing the
listener. The cache administrator will catch and log this error.
|