Class SaxonEventMulticaster
java.lang.Object
com.icl.saxon.trace.SaxonEventMulticaster
- All Implemented Interfaces:
TraceListener, EventListener
A class which implements efficient and thread-safe multi-cast event
dispatching for the TraceListener evants.
Grabbed from java.awt.AWTEventMulticaster
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates an event multicaster instance which chains listener-a with listener-b. -
Method Summary
Modifier and TypeMethodDescriptionstatic TraceListeneradd(TraceListener a, TraceListener b) Adds trace-listener-a with trace-listener-b and returns the resulting multicast listener.protected static EventListenerReturns the resulting multicast listener from adding listener-a and listener-b together.voidclose()Called at endvoidCalled when an element of the stylesheet gets processedvoidenterSource(NodeHandler handler, Context context) Called when a node of the source tree gets processedvoidCalled after an element of the stylesheet got processedvoidleaveSource(NodeHandler handler, Context context) Called after a node of the source tree got processedvoidopen()Called at startstatic TraceListenerremove(TraceListener l, TraceListener oldl) Removes the old trace-listener from trace-listener-l and returns the resulting multicast listener.protected EventListenerremove(EventListener oldl) Removes a listener from this multicaster and returns the resulting multicast listener.protected static EventListenerremoveInternal(EventListener l, EventListener oldl) Returns the resulting multicast listener after removing the old listener from listener-l.voidCalled for all top level elements
-
Field Details
-
a
-
b
-
-
Constructor Details
-
SaxonEventMulticaster
Creates an event multicaster instance which chains listener-a with listener-b.- Parameters:
a- listener-ab- listener-b
-
-
Method Details
-
remove
Removes a listener from this multicaster and returns the resulting multicast listener.- Parameters:
oldl- the listener to be removed
-
open
-
close
-
toplevel
Called for all top level elements- Specified by:
toplevelin interfaceTraceListener
-
enterSource
Called when a node of the source tree gets processed- Specified by:
enterSourcein interfaceTraceListener
-
leaveSource
Called after a node of the source tree got processed- Specified by:
leaveSourcein interfaceTraceListener
-
enter
Called when an element of the stylesheet gets processed- Specified by:
enterin interfaceTraceListener
-
leave
Called after an element of the stylesheet got processed- Specified by:
leavein interfaceTraceListener
-
add
Adds trace-listener-a with trace-listener-b and returns the resulting multicast listener.- Parameters:
a- trace-listener-ab- trace-listener-b
-
remove
Removes the old trace-listener from trace-listener-l and returns the resulting multicast listener.- Parameters:
l- trace-listener-loldl- the trace-listener being removed
-
addInternal
Returns the resulting multicast listener from adding listener-a and listener-b together. If listener-a is null, it returns listener-b; If listener-b is null, it returns listener-a If neither are null, then it creates and returns a new EventMulticaster instance which chains a with b.- Parameters:
a- event listener-ab- event listener-b
-
removeInternal
Returns the resulting multicast listener after removing the old listener from listener-l. If listener-l equals the old listener OR listener-l is null, returns null. Else if listener-l is an instance of SaxonEventMulticaster, then it removes the old listener from it. Else, returns listener l.- Parameters:
l- the listener being removed fromoldl- the listener being removed
-