Package com.ibm.wsspi.cache
Interface EventSource
public interface EventSource
Runtime objects implement this when they are an event source
Java objects can be registered with an EventSource. The listeners
are called when the fireEvent, cacheEntryChanged, or
shouldInvalidate methods is called.
Here are the functions for the interface:
- To add invalidation, pre-invalidation and change listeners.
- To remove invalidation, pre-invalidation and change listeners.
- To fire invalidation, pre-invalidation and change events.
- To find how many listeners registered.
- Since:
- WAS7.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(ChangeListener listener) Invokes this method when a change listener is being added.void
addListener
(InvalidationListener listener) Invokes this method when an invalidation listener is being added.void
addListener
(PreInvalidationListener listener) Invokes this method when a pre-invalidation listener is being added.void
cacheEntryChanged
(ChangeEvent event) Invokes this method when the change event is being fired.void
fireEvent
(InvalidationEvent event) Invokes this method when the invalidation event is being fired.int
Returns mumber of change listeners registered.int
Returns number of invalidation listeners registered.int
Returns number of pre-invalidation listener registered.void
removeListener
(ChangeListener listener) Invokes this method when a change listener is being removed.void
removeListener
(InvalidationListener listener) Invokes this method when an invalidation listener is being removed.void
removeListener
(PreInvalidationListener listener) Invokes this method when a pre-invalidation listener is being removed.boolean
shouldInvalidate
(Object id, int source, int cause) Invokes this method prior to the invalidation event occuring and is used to provide a callback that allows the listener to approve/deny an invalidation from occuring.
-
Method Details
-
getInvalidationListenerCount
int getInvalidationListenerCount()Returns number of invalidation listeners registered.- Returns:
- invalidation listener count
-
getPreInvalidationListenerCount
int getPreInvalidationListenerCount()Returns number of pre-invalidation listener registered. It should be 0 or 1.- Returns:
- pre-invalidation listener count
-
getChangeListenerCount
int getChangeListenerCount()Returns mumber of change listeners registered.- Returns:
- change listener count
-
fireEvent
Invokes this method when the invalidation event is being fired. -
shouldInvalidate
Invokes this method prior to the invalidation event occuring and is used to provide a callback that allows the listener to approve/deny an invalidation from occuring. -
cacheEntryChanged
Invokes this method when the change event is being fired. -
addListener
Invokes this method when an invalidation listener is being added.- Parameters:
listener
- the invalidation listener object- See Also:
-
removeListener
Invokes this method when an invalidation listener is being removed.- Parameters:
listener
- the invalidation listener object- See Also:
-
addListener
Invokes this method when a change listener is being added.- Parameters:
listener
- the invalidation listener object- See Also:
-
removeListener
Invokes this method when a change listener is being removed.- Parameters:
listener
- the change listener object- See Also:
-
addListener
Invokes this method when a pre-invalidation listener is being added.- Parameters:
listener
- the pre-invalidation listener object- See Also:
-
removeListener
Invokes this method when a pre-invalidation listener is being removed.- Parameters:
listener
- the pre-invalidation listener object- See Also:
-