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.


Constructor Index

 o TraceDip()
Constructs the TraceDip instance.

Method Index

 o createEventFireListener(Object, String[])
Creates an array of DipEventFireListener instances describing the methods to call after the dipped bean handleEventFire() method is called.
 o createImplementation(Object)
Indicates whether this dip can have a separate instantiation.
 o createMethodCallListener(Object, String[])
Creates an array of DipMethodCallListener instances describing the methods to call after the dipped bean handleMethodCall() method is called.
 o createPropertyChangeListener(Object, String[])
Creates an array of DipPropertyChangeListener instances describing the methods to call after the dipped bean propertyChange() method is called.
 o createVetoableChangeListener(Object, String[])
Creates an array of DipVetoableChangeListener instances describing the methods to call before the dipped bean vetoableChange() method is called.
 o createVetoableEventListener(Object, String[])
Creates an array of DipVetoableEventListener instances describing the methods to call before the dipped bean handleVetoableEvent() method is called.
 o createVetoableMethodListener(Object, String[])
Creates an array of DipVetoableMethodListener instances describing the method to call before the dipped bean vetoableMethodCall() method is called.
 o getMsgDispHostName()
Gets the msgDispHostName value that is the machine name where the MsgDispServer GUI is running.
 o getTraceEventsFlag()
Gets the traceEventsFlag value, which controls whether the dippalbe bean's events are traced.
 o getTraceMethodsFlag()
Gets the traceMethodsFlag value, which controls whether the dippable bean's methods are traced.
 o getTracePropertiesFlag()
Gets the tracePropertiesFlag value, which controls whether the dippable bean's properties are traced.
 o handleEventFire(EventFireEvent)
Logs a message describing the event that was fired.
 o handleMethodCall(MethodCallEvent)
Logs a message describing the method that was called.
 o handleVetoableEvent(EventFireEvent)
Logs a message describing the event that was fired.
 o handleVetoableMethod(MethodCallEvent)
Logs a message describing the method that was called.
 o includeInMorphedClass(String)
Determines if a method should be included in a morphed class.
 o isRemovable()
Indicates whether the dip can be removed from the dipped bean.
 o logTraceOutput(String)
Uses a MsgDispClient instance to log messages to a MsgDispServer GUI.
 o needsArguments()
Indicates whether the implementation of the MethodCallListener instance needs arguments marshaled in the MethodCallEvent instance.
 o priority()
Gets the priority of this dip in relation to all other dips.
 o propertyChange(PropertyChangeEvent)
Logs a message describing the property when a bound property is changed.
 o recoverFromEventVeto(EventFireEvent)
Allow listeners to perform recovery operations when a constrained event was vetoed.
 o recoverFromMethodVeto(MethodCallEvent)
Allows listeners to perform recovery operations when a constrained method is vetoed.
 o releaseImplementation()
Indicates that the TraceDip instance has nothing that needs to be released when the dip is removed from the bean.
 o retrieveDip()
Retrieves a pointer to the dip that created the listener.
 o setMsgDispHostName(String)
Sets the msgDispHostName that is the machine name where the MsgDispServer GUI is running.
 o setTraceEventsFlag(boolean)
Sets the traceEventsFlag .
 o setTraceMethodsFlag(boolean)
Sets the traceMethodsFlag .
 o setTracePropertiesFlag(boolean)
Sets the tracePropertiesFlag .
 o typeName()
Gets the dip type name as a String.
 o vetoableChange(PropertyChangeEvent)
Logs a message describing the property when a bound property is changed.
 o worksWith(String)
Indicates whether another dip can work with this dip.

Constructors

 o TraceDip
 public TraceDip()
Constructs the TraceDip instance.

Methods

 o 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.
 o typeName
 public String typeName()
Gets the dip type name as a String.

Returns:
The type name of the dip.
 o 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.
 o isRemovable
 public boolean isRemovable()
Indicates whether the dip can be removed from the dipped bean.

Returns:
true if dip can be removed; false otherwise.
 o 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.
 o 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
 o 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
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o logTraceOutput
 public void logTraceOutput(String MessageToLog)
Uses a MsgDispClient instance to log messages to a MsgDispServer GUI.

Parameters:
MessageToLog - The message to log.
 o 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.
 o getMsgDispHostName
 public String getMsgDispHostName()
Gets the msgDispHostName value that is the machine name where the MsgDispServer GUI is running.

Returns:
The machine name.
 o 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.
 o retrieveDip
 public Dip retrieveDip()
Retrieves a pointer to the dip that created the listener. In this implementation, the dip returns itself.

Returns:
This dip.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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