Package net.sf.saxon.trace
Class TraceEventMulticaster
java.lang.Object
net.sf.saxon.trace.TraceEventMulticaster
- All Implemented Interfaces:
TraceListener
A class which implements efficient and thread-safe multi-cast event
dispatching for the TraceListener evants.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates an event multicaster instance which chains listener-a with listener-b. -
Method Summary
Modifier and TypeMethodDescriptionstatic TraceListener
add
(TraceListener a, TraceListener b) Adds trace-listener-a with trace-listener-b and returns the resulting multicast listener.protected static TraceListener
Returns the resulting multicast listener from adding listener-a and listener-b together.void
close()
Called at endvoid
endCurrentItem
(Item item) Called when an item ceases to be the current itemvoid
endRuleSearch
(Object rule, SimpleMode mode, Item item) Called at the end of a rule searchvoid
Called when an element of the stylesheet gets processedvoid
Called after an element of the stylesheet got processedvoid
open
(Controller controller) Called at startprotected TraceListener
remove
(TraceListener oldl) Removes a listener from this multicaster and returns the resulting multicast listener.static TraceListener
remove
(TraceListener l, TraceListener oldl) Removes the old trace-listener from trace-listener-l and returns the resulting multicast listener.protected static TraceListener
removeInternal
(TraceListener l, TraceListener oldl) Returns the resulting multicast listener after removing the old listener from listener-l.void
setOutputDestination
(Logger stream) Method called to supply the destination for output.void
startCurrentItem
(Item item) Called when an item becomes currentvoid
Called at the start of a rule searchMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.sf.saxon.lib.TraceListener
checkpoint, endRuleSearch, recover
-
Field Details
-
a
-
b
-
-
Constructor Details
-
TraceEventMulticaster
Creates an event multicaster instance which chains listener-a with listener-b.- Parameters:
a
- listener-ab
- listener-b
-
-
Method Details
-
setOutputDestination
Description copied from interface:TraceListener
Method called to supply the destination for output. The default implementation does nothing.- Specified by:
setOutputDestination
in interfaceTraceListener
- Parameters:
stream
- a Logger to which any output produced by the TraceListener should be written
-
remove
Removes a listener from this multicaster and returns the resulting multicast listener.- Parameters:
oldl
- the listener to be removed- Returns:
- the resulting mulitcast listener
-
open
Called at start- Specified by:
open
in interfaceTraceListener
- Parameters:
controller
- identifies the transformation controller, and provides the listener with access to context and configuration information
-
close
public void close()Called at end- Specified by:
close
in interfaceTraceListener
-
enter
Called when an element of the stylesheet gets processed- Specified by:
enter
in interfaceTraceListener
- Parameters:
element
- gives information about the instruction being executed, and about the context in which it is executed. This object is mutable, so if information from the InstructionInfo is to be retained, it must be copied.properties
- extra information about the instruction to be included in the tracecontext
- the XPath evaluation context
-
leave
Called after an element of the stylesheet got processed- Specified by:
leave
in interfaceTraceListener
- Parameters:
element
- the element
-
startCurrentItem
Called when an item becomes current- Specified by:
startCurrentItem
in interfaceTraceListener
- Parameters:
item
- the new current item. Item objects are not mutable; it is safe to retain a reference to the Item for later use.
-
endCurrentItem
Called when an item ceases to be the current item- Specified by:
endCurrentItem
in interfaceTraceListener
- Parameters:
item
- the item that was current, whose processing is now complete. This will represent the same underlying item as the corresponding startCurrentItem() call, though it will not necessarily be the same actual object.
-
startRuleSearch
public void startRuleSearch()Called at the start of a rule search- Specified by:
startRuleSearch
in interfaceTraceListener
-
endRuleSearch
Called at the end of a rule search- Parameters:
rule
- the rule (or possible built-in ruleset) that has been selectedmode
- the mode in operationitem
- the item that was checked against
-
add
Adds trace-listener-a with trace-listener-b and returns the resulting multicast listener.- Parameters:
a
- trace-listener-ab
- trace-listener-b- Returns:
- the resulting multicast listener
-
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- Returns:
- the resulting multicast listener
-
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- Returns:
- the resulting multicast listener
-
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- Returns:
- the resulting multicast listener
-