All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.samples.dips.trace.TraceDip
java.lang.Object
|
+----com.ibm.beans.samples.dips.trace.TraceDip
- public class TraceDip
- extends Object
- implements Serializable, Dip, DipEventFireListener, DipMethodCallListener, DipVetoableEventListener, DipVetoableMethodListener, DipPropertyChangeListener, DipVetoableChangeListener
The TraceDip class defines a dip that can be applied to a
dippable bean. This dip is used for debugging. It optionally prints debug information
when entering and leaving methods, when properties change, and
when events are generated by the dippable bean.
-
TraceDip()
- Constructs the TraceDip instance.
-
createEventFireListener(Object, String[])
- Creates an array of DipEventFireListener instances describing the methods to
call after the dipped bean handleEventFire() method is called.
-
createImplementation(Object)
- Indicates whether this dip can have a separate instantiation.
-
createMethodCallListener(Object, String[])
- Creates an array of DipMethodCallListener instances describing the methods to
call after the dipped bean handleMethodCall() method is called.
-
createPropertyChangeListener(Object, String[])
- Creates an array of DipPropertyChangeListener
instances describing the methods to
call after the dipped bean propertyChange() method is called.
-
createVetoableChangeListener(Object, String[])
- Creates an array of DipVetoableChangeListener instances describing the methods to
call before the dipped bean vetoableChange() method is called.
-
createVetoableEventListener(Object, String[])
- Creates an array of DipVetoableEventListener instances describing the methods to
call before the dipped bean handleVetoableEvent() method is called.
-
createVetoableMethodListener(Object, String[])
- Creates an array of DipVetoableMethodListener instances describing the method to
call before the dipped bean vetoableMethodCall() method is called.
-
getMsgDispHostName()
- Gets the msgDispHostName value that is the machine name where
the MsgDispServer GUI is running.
-
getTraceEventsFlag()
- Gets the traceEventsFlag value, which controls whether
the dippalbe bean's events are traced.
-
getTraceMethodsFlag()
- Gets the traceMethodsFlag value, which controls whether the
dippable bean's methods are traced.
-
getTracePropertiesFlag()
- Gets the tracePropertiesFlag value,
which controls whether the dippable bean's properties are traced.
-
handleEventFire(EventFireEvent)
-
Logs a message describing the event that was fired.
-
handleMethodCall(MethodCallEvent)
- Logs a message describing the method that was called.
-
handleVetoableEvent(EventFireEvent)
- Logs a message describing the event that was fired.
-
handleVetoableMethod(MethodCallEvent)
- Logs a message describing the method that was called.
-
includeInMorphedClass(String)
- Determines if a method should be included in a morphed class.
-
isRemovable()
- Indicates whether the dip can be removed from the dipped bean.
-
logTraceOutput(String)
- Uses a MsgDispClient instance to log messages to a
MsgDispServer GUI.
-
needsArguments()
- Indicates whether the implementation of the MethodCallListener
instance needs arguments marshaled in the MethodCallEvent instance.
-
priority()
- Gets the priority of this dip in relation to all other
dips.
-
propertyChange(PropertyChangeEvent)
- Logs a message describing the property when a bound property is changed.
-
recoverFromEventVeto(EventFireEvent)
- Allow listeners to perform recovery operations when a constrained event was vetoed.
-
recoverFromMethodVeto(MethodCallEvent)
- Allows listeners to perform recovery operations when a constrained method is vetoed.
-
releaseImplementation()
- Indicates that the TraceDip instance
has nothing that needs to be released when
the dip is removed from the bean.
-
retrieveDip()
- Retrieves a pointer to the dip that created the listener.
-
setMsgDispHostName(String)
- Sets the msgDispHostName that is the machine name where
the MsgDispServer GUI is running.
-
setTraceEventsFlag(boolean)
- Sets the traceEventsFlag .
-
setTraceMethodsFlag(boolean)
- Sets the traceMethodsFlag .
-
setTracePropertiesFlag(boolean)
- Sets the tracePropertiesFlag .
-
typeName()
- Gets the dip type name as a String.
-
vetoableChange(PropertyChangeEvent)
- Logs a message describing the property when a bound property is changed.
-
worksWith(String)
- Indicates whether another dip can work with this dip.
TraceDip
public TraceDip()
- Constructs the TraceDip instance.
priority
public final int priority()
- Gets the priority of this dip in relation to all other
dips. This priority is used to determine which dips
are acted on first.
- Returns:
- The priority is 700. This priority is of a higher priority
than the default priority of 500.
typeName
public String typeName()
- Gets the dip type name as a String.
- Returns:
- The type name of the dip.
worksWith
public boolean worksWith(String dipTypeName)
- Indicates whether another dip can work with this dip.
- Parameters:
- dipTypeName - The new dip requesting to be added to the bean.
- Returns:
- true if new dip is to be added; false otherwise.
isRemovable
public boolean isRemovable()
- Indicates whether the dip can be removed from the dipped bean.
- Returns:
- true if dip can be removed; false otherwise.
createImplementation
public Object createImplementation(Object obj) throws DipRejectAdditionException
- Indicates whether this dip can have a separate instantiation.
- Parameters:
- obj - The bean being dipped. This is the only
handle to the bean provided to the dip.
- Returns:
- This implementation disallows separate instantiation, always returns null.
- Throws: DipRejectAdditionException
- This exception is thrown if the
dip rejects being added to the bean. This dip never rejects any beans.
releaseImplementation
public void releaseImplementation()
- Indicates that the TraceDip instance
has nothing that needs to be released when
the dip is removed from the bean.
- See Also:
- releaseImplementation
includeInMorphedClass
public boolean includeInMorphedClass(String methodName)
- Determines if a method should be included in a morphed class.
When the dip is applied to a class as a pre-dip during morphing,
and the user elects to only override those methods in the dippable
class that the pre-dips agrees to, this method is used to determine
if a dip agrees to including a specific method.
- Parameters:
- methodName - Name of the method to be considered
- Returns:
- boolean indicating whether to wrap given method
createPropertyChangeListener
public DipPropertyChangeListener[] createPropertyChangeListener(Object imp,
String methods[]) throws DipRejectAdditionException
- Creates an array of DipPropertyChangeListener
instances describing the methods to
call after the dipped bean propertyChange() method is called.
- Parameters:
- imp - The implementation returned from the createImplementation() method.
- methods[] - The array of event methods in the dippable bean.
- Returns:
- The array of DipPropertyChangeListener instances is a one-to-one mapping
with the methods[] input parameter. For example,
DipPropertyChangeListener[i] is used with methods[i], and
the length of the two arrays are equal.
- Throws: DipRejectAdditionException
- This exception is thrown if
the dip rejects being added to the bean.
createVetoableChangeListener
public DipVetoableChangeListener[] createVetoableChangeListener(Object imp,
String methods[]) throws DipRejectAdditionException
- Creates an array of DipVetoableChangeListener instances describing the methods to
call before the dipped bean vetoableChange() method is called.
- Parameters:
- imp - The implementation returned from createImplementation() method.
- methods[] - The array of event methods in the dippable bean.
- Returns:
- The array of DipVetoableChangeListener instances is a one-to-one mapping
with the methods[] input parameter. For example,
DipVetoableChangeListener[i] is used with methods[i], and
the length of the two arrays are equal.
- Throws: DipRejectAdditionException
- This exception is thrown if
the dip rejects being added to the bean.
createMethodCallListener
public DipMethodCallListener[] createMethodCallListener(Object imp,
String methods[]) throws DipRejectAdditionException
- Creates an array of DipMethodCallListener instances describing the methods to
call after the dipped bean handleMethodCall() method is called.
- Parameters:
- imp - The implementation returned from createImplementation() method.
- methods[] - The array of event methods in the dippable bean.
- Returns:
- The array of DipMethodCallListener instances is a one-to-one mapping
with the methods[] input parameter. For example,
DipMethodCallListener[i] is used with methods[i], and
the length of the two arrays are equal.
- Throws: DipRejectAdditionException
- This exception is thrown if
the dip rejects being added to the bean.
createVetoableMethodListener
public DipVetoableMethodListener[] createVetoableMethodListener(Object imp,
String methods[]) throws DipRejectAdditionException
- Creates an array of DipVetoableMethodListener instances describing the method to
call before the dipped bean vetoableMethodCall() method is called.
- Parameters:
- imp - The implementation returned from createImplementation() method.
- methods[] - The array of event methods in the dippable bean.
- Returns:
- The array of DipVetoableMethodListener instances is a one-to-one mapping
with the methods[] input parameter. This means
DipVetoableMethodListener[i] is used with methods[i], and
the length of the two arrays are equal.
- Throws: DipRejectAdditionException
- This exception is thrown if
the dip rejects being added to the bean.
createEventFireListener
public DipEventFireListener[] createEventFireListener(Object imp,
String methods[]) throws DipRejectAdditionException
- Creates an array of DipEventFireListener instances describing the methods to
call after the dipped bean handleEventFire() method is called.
- Parameters:
- imp - The implementation returned from createImplementation() method.
- methods[] - The array of event methods in the dippable bean.
- Returns:
- The array of DipEventFireListener instances is a one-to-one mapping
with the methods[] input parameter. For example,
DipEventFireListener[i] is used with methods[i], and
the length of the two arrays are equal.
- Throws: DipRejectAdditionException
- This exception is thrown if
the dip rejects being added to the bean.
createVetoableEventListener
public DipVetoableEventListener[] createVetoableEventListener(Object imp,
String methods[]) throws DipRejectAdditionException
- Creates an array of DipVetoableEventListener instances describing the methods to
call before the dipped bean handleVetoableEvent() method is called.
- Parameters:
- imp - The implementation returned from createImplementation() method.
- methods - The array of event methods in the dippable bean.
- Returns:
- The array of DipVetoableEventListener instances is a one-to-one mapping
with the methods[] input parameter. For example,
DipVetoableEventListener[i] will be used with methods[i], and
the length of the two arrays are equal.
- Throws: DipRejectAdditionException
- This exception is thrown if
the dip rejects being added to the bean.
setTraceEventsFlag
public void setTraceEventsFlag(boolean traceEvents)
- Sets the traceEventsFlag .
- Parameters:
- traceEvents - Indicates whether the events of a dippable
bean are traced.
true causes
events to be traced; false
disables event tracing.
setTraceMethodsFlag
public void setTraceMethodsFlag(boolean traceMethods)
- Sets the traceMethodsFlag .
- Parameters:
- traceMethods - Indicates whether the methods of a dippable
bean are traced.
true causes
methods to be traced; false disables method tracing.
setTracePropertiesFlag
public void setTracePropertiesFlag(boolean traceProperties)
- Sets the tracePropertiesFlag .
- Parameters:
- traceProperties - Indicates whether the properties of
the dippable bean are traced.
true causes properties
to be traced; false disables property tracing.
getTraceEventsFlag
public boolean getTraceEventsFlag()
- Gets the traceEventsFlag value, which controls whether
the dippalbe bean's events are traced.
- Returns:
- true if events are traced; false otherwise.
getTraceMethodsFlag
public boolean getTraceMethodsFlag()
- Gets the traceMethodsFlag value, which controls whether the
dippable bean's methods are traced.
- Returns:
- true if methods are traced; false otherwise.
getTracePropertiesFlag
public boolean getTracePropertiesFlag()
- Gets the tracePropertiesFlag value,
which controls whether the dippable bean's properties are traced.
- Returns:
- true if properties are traced; false otherwise.
logTraceOutput
public void logTraceOutput(String MessageToLog)
- Uses a MsgDispClient instance to log messages to a
MsgDispServer GUI.
- Parameters:
- MessageToLog - The message to log.
setMsgDispHostName
public void setMsgDispHostName(String ServerHost)
- Sets the msgDispHostName that is the machine name where
the MsgDispServer GUI is running.
- Parameters:
- ServerHost - The location of the MsgDispServer GUI.
getMsgDispHostName
public String getMsgDispHostName()
- Gets the msgDispHostName value that is the machine name where
the MsgDispServer GUI is running.
- Returns:
- The machine name.
handleEventFire
public void handleEventFire(EventFireEvent evt)
- Logs a message describing the event that was fired.
This method is called when a bound event is fired.
- Parameters:
- evt - An EventFireEvent object describing the event source
and the event that was fired.
retrieveDip
public Dip retrieveDip()
- Retrieves a pointer to the dip that created the listener.
In this implementation, the dip returns itself.
- Returns:
- This dip.
needsArguments
public boolean needsArguments()
- Indicates whether the implementation of the MethodCallListener
instance needs arguments marshaled in the MethodCallEvent instance.
- Returns:
- true if MethodCallListener needs arguments marshaled; false otherwise.
handleMethodCall
public void handleMethodCall(MethodCallEvent evt)
- Logs a message describing the method that was called.
This method is called when a bound method is called.
- Parameters:
- evt - A MethodCallEvent object describing the event source
and the property that changed.
handleVetoableMethod
public void handleVetoableMethod(MethodCallEvent evt) throws MethodVetoException
- Logs a message describing the method that was called.
This method gets called when a constrained method is called.
- Parameters:
- evt - An MethodCallEvent object describing the event source
and the method that was called.
- Throws: MethodVetoException
- This exception is thrown if the VetoableMethodListener
wants the method operation not to be performed.
recoverFromMethodVeto
public void recoverFromMethodVeto(MethodCallEvent evt)
- Allows listeners to perform recovery operations when a constrained method is vetoed.
The logged message describes the method that was vetoed.
- Parameters:
- evt - A MethodCallEvent object describing the event source
and the method that was called.
handleVetoableEvent
public void handleVetoableEvent(EventFireEvent evt) throws EventVetoException
- Logs a message describing the event that was fired.
This method gets called when a constrained event is fired.
- Parameters:
- evt - An EventFireEvent object describing the event source
and the event that was fired.
- Throws: EventVetoException
- This exception is thrown if the VetoableEventListener
instance wants the event firing canceled.
recoverFromEventVeto
public void recoverFromEventVeto(EventFireEvent evt)
- Allow listeners to perform recovery operations when a constrained event was vetoed.
The logged message describes the event that was vetoed.
- Parameters:
- evt - An EventFireEvent object describing the event source
and the event that was vetoed.
propertyChange
public void propertyChange(PropertyChangeEvent evt)
- Logs a message describing the property when a bound property is changed.
- Parameters:
- evt - A PropertyChangeEvent object describing the event
source and the property that changed.
vetoableChange
public void vetoableChange(PropertyChangeEvent evt)
- Logs a message describing the property when a bound property is changed.
- Parameters:
- evt - A PropertyChangeEvent object describing the
event source and the property that changed.
All Packages Class Hierarchy This Package Previous Next Index