Package org.apache.sis.storage.event
Class CascadedStoreEvent<E extends CascadedStoreEvent<E>>
Object
EventObject
StoreEvent
CascadedStoreEvent<E>
- Type Parameters:
- E- the type of the event subclass.
- All Implemented Interfaces:
- Serializable,- Localized
- Direct Known Subclasses:
- CloseEvent
An event which, when occurring on a parent resource, is also fired by all children resources.
 For example, when an Difference between 
 By default 
Aggregate (typically a data store) is closed,
 a CloseEvent is automatically fired by all resources that are components of the aggregate.
 This is similar to "cascade delete" in SQL databases.
 Difference between StoreEvent and CascadedStoreEvent
 By default StoreEvents are propagated from children to parents.
 For example, when a WarningEvent occurs in a child resource,
 all listeners registered on that resource are notified,
 then all listeners registered on the parent resource, and so forth until the root resource.
 All those listeners receive the same WarningEvent instance,
 i.e. the event source is always the resource where the warning occurred.
 By contrast CascadedStoreEvent are fired in the opposite direction, from parent to children.
 Furthermore, each child creates its own CascadedStoreEvent. For example if a CloseEvent is
 fired in a DataStore, then it causes all resources of that data store to fire
 their own CloseEvent declaring themselves as the event source.
- Since:
- 1.3
- See Also:
Defined in the sis-storage module
- 
Field SummaryFields inherited from class EventObjectsource
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCascadedStoreEvent(Resource source) Constructs an event that occurred in the given resource.
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract EforSource(Resource child) Creates a new event of the same type than this event but with a different source.Methods inherited from class StoreEventconsume, getLocale, getSource, isConsumedMethods inherited from class EventObjecttoString
- 
Constructor Details- 
CascadedStoreEventConstructs an event that occurred in the given resource.- Parameters:
- source- the resource where the event occurred.
- Throws:
- IllegalArgumentException- if the given source is null.
 
 
- 
- 
Method Details- 
forSourceCreates a new event of the same type than this event but with a different source. This method is invoked for creating the event to be fired by the children of the resource where the original event occurred.- Parameters:
- child- the child resource for which to create the event to cascade.
- Returns:
- an event of the same type than this event but with the given resource.
 
 
-