public class EventCartridge extends Object
Note that Event Handlers follow a filter pattern, with multiple event handlers allowed for each event. When the appropriate event occurs, all the appropriate event handlers are called in the sequence they were added to the Event Cartridge. See the javadocs of the specific event handler interfaces for more details.
Constructor and Description |
---|
EventCartridge() |
Modifier and Type | Method and Description |
---|---|
boolean |
addEventHandler(EventHandler ev)
Adds an event handler(s) to the Cartridge.
|
void |
addIncludeEventHandler(IncludeEventHandler ev)
Add an include event handler to the Cartridge.
|
void |
addInvalidReferenceEventHandler(InvalidReferenceEventHandler ev)
Add an invalid reference event handler to the Cartridge.
|
void |
addMethodExceptionHandler(MethodExceptionEventHandler ev)
Add a method exception event handler to the Cartridge.
|
void |
addReferenceInsertionEventHandler(ReferenceInsertionEventHandler ev)
Add a reference insertion event handler to the Cartridge.
|
boolean |
attachToContext(Context context)
Attached the EventCartridge to the context
Final because not something one should mess with lightly :)
|
Iterator |
getIncludeEventHandlers()
Iterate through all the stored IncludeEventHandlers objects
|
Iterator |
getInvalidReferenceEventHandlers()
Iterate through all the stored InvalidReferenceEventHandlers objects
|
Iterator |
getMethodExceptionEventHandlers()
Iterate through all the stored MethodExceptionEventHandler objects
|
Iterator |
getReferenceInsertionEventHandlers()
Iterate through all the stored ReferenceInsertionEventHandler objects
|
void |
initialize(RuntimeServices rs)
Initialize the handlers.
|
boolean |
removeEventHandler(EventHandler ev)
Removes an event handler(s) from the Cartridge.
|
public boolean addEventHandler(EventHandler ev)
ev
- object implementing a valid EventHandler-derived interfacepublic void addReferenceInsertionEventHandler(ReferenceInsertionEventHandler ev)
ev
- ReferenceInsertionEventHandlerpublic void addMethodExceptionHandler(MethodExceptionEventHandler ev)
ev
- MethodExceptionEventHandlerpublic void addIncludeEventHandler(IncludeEventHandler ev)
ev
- IncludeEventHandlerpublic void addInvalidReferenceEventHandler(InvalidReferenceEventHandler ev)
ev
- InvalidReferenceEventHandlerpublic boolean removeEventHandler(EventHandler ev)
ev
- object impementing a valid EventHandler-derived interfacepublic Iterator getReferenceInsertionEventHandlers()
public Iterator getMethodExceptionEventHandlers()
public Iterator getIncludeEventHandlers()
public Iterator getInvalidReferenceEventHandlers()
public final boolean attachToContext(Context context)
context
- context to attach topublic void initialize(RuntimeServices rs)
rs
- Copyright © 2000–2016 The Apache Software Foundation. All rights reserved.