All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.samples.dips.perform.PerformanceDip
java.lang.Object
|
+----com.ibm.beans.dip.SimpleDip
|
+----com.ibm.beans.samples.dips.perform.PerformanceDip
- public class PerformanceDip
- extends SimpleDip
- implements Serializable, DipMethodCallListener, DipVetoableMethodListener, DipPropertyChangeListener, DipVetoableChangeListener, DipEventFireListener, DipVetoableEventListener
This dip outputs how long each method call, property change, and event fire takes.
-
PerformanceDip()
- Default constructor, invoked when the Dipping Framework calls
Beans.instantiate() to create an instance of this dip, in order to
apply to a dippable bean.
-
createEventFireListener(Object, String[])
- Wires the dip to receive notification immediately after the specified
events of the dippable bean are fired.
-
createMethodCallListener(Object, String[])
- Wires the dip to receive notification immediately after the specified
methods of the dippable bean are called.
-
createPropertyChangeListener(Object, String[])
- Wires the dip to receive notification immediately after the specified
properties of the dippable bean are changed.
-
createVetoableChangeListener(Object, String[])
- Wires the dip to receive notification immediately before the specified
properties of the dippable bean are changed.
-
createVetoableEventListener(Object, String[])
- Wires the dip to receive notification immediately before the specified
events of the dippable bean are fired.
-
createVetoableMethodListener(Object, String[])
- Wires the dip to receive notification immediately before the specified
methods of the dippable bean are called.
-
handleEventFire(EventFireEvent)
- This method is called when a bound event is fired.
-
handleMethodCall(MethodCallEvent)
- Responds to a bound method of the dippable bean being invoked.
-
handleVetoableEvent(EventFireEvent)
- This method is called when a constrained event is fired.
-
handleVetoableMethod(MethodCallEvent)
- Responds to a constrained method of the dippable bean being invoked.
-
needsArguments()
- Communicates to the dipping framework whether this dip requires
the arguments for intercepted methods of the dippable bean.
-
propertyChange(PropertyChangeEvent)
- Responds to a bound property of the dippable bean being 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.
-
typeName()
- Returns the dip type name as a String.
-
vetoableChange(PropertyChangeEvent)
- Responds to a constrained property of the dippable bean being changed.
-
worksWith(String)
- Indicates whether this dip will allow another dip to be applied to its
dippable bean.
PerformanceDip
public PerformanceDip()
- Default constructor, invoked when the Dipping Framework calls
Beans.instantiate() to create an instance of this dip, in order to
apply to a dippable bean. After the constructor runs, the dip's
createImplementation() method will be invoked.
typeName
public String typeName()
- Returns the dip type name as a String. The typeName() method of
SimpleDip is abstract, so typeName() must be implemented here.
- Returns:
- A descriptive string describing the type of dip.
- Overrides:
- typeName in class SimpleDip
- See Also:
- typeName
worksWith
public boolean worksWith(String dipTypeName)
- Indicates whether this dip will allow another dip to be applied to its
dippable bean. The default implementation in SimpleDip is to always
allow any other dip to be applied.
The Performance Dip always returns false, so that other dips won't
interfere with performance measurements.
- Parameters:
- dipTypeName - The new dip requesting to be added to the bean.
- Returns:
- boolean indicating if new dip is allowed to be added.
- Overrides:
- worksWith in class SimpleDip
- See Also:
- worksWith
createMethodCallListener
public DipMethodCallListener[] createMethodCallListener(Object impl,
String methods[]) throws DipRejectAdditionException
- Wires the dip to receive notification immediately after the specified
methods of the dippable bean are called.
- Parameters:
- impl - This value should be null. There is no separate implementation.
- methods - An array of method signatures from the dippable bean.
- Returns:
- Array of DipMethodCallListeners with this dip set to
listen at the appropriate method indices.
- Throws: DipRejectAdditionException
- This exception is thrown if the
dip rejects being added to the bean.
- Overrides:
- createMethodCallListener in class SimpleDip
- See Also:
- handleMethodCall, createMethodCallListener
needsArguments
public boolean needsArguments()
- Communicates to the dipping framework whether this dip requires
the arguments for intercepted methods of the dippable bean. Returning
false avoids the performance impact of parameter marshaling.
- Returns:
- boolean indicating whether this dip requires the arguments
from intercepted methods.
- See Also:
- needsArguments
handleMethodCall
public void handleMethodCall(MethodCallEvent evt)
- Responds to a bound method of the dippable bean being invoked.
- Parameters:
- evt - A MethodCallEvent object describing the event source
and the property that changed.
- See Also:
- handleMethodCall
createVetoableMethodListener
public DipVetoableMethodListener[] createVetoableMethodListener(Object impl,
String methods[]) throws DipRejectAdditionException
- Wires the dip to receive notification immediately before the specified
methods of the dippable bean are called. The dip will also have the
option of vetoing the method call in progress.
- Parameters:
- impl - This value should be null. This dip has no separate implementation.
- methods - An array of method signatures from the dippable bean.
- Returns:
- Array of DipVetoableMethodListeners with this dip set to
listen at the appropriate method indices.
- Throws: DipRejectAdditionException
- This exception is thrown if the
dip rejects being added to the bean.
- Overrides:
- createVetoableMethodListener in class SimpleDip
- See Also:
- handleVetoableMethod, createVetoableMethodListener
handleVetoableMethod
public void handleVetoableMethod(MethodCallEvent evt) throws MethodVetoException
- Responds to a constrained method of the dippable bean being invoked.
- 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.
- See Also:
- handleVetoableMethod
recoverFromMethodVeto
public void recoverFromMethodVeto(MethodCallEvent evt)
- Allows listeners to perform recovery operations when a constrained method is vetoed.
- Parameters:
- evt - A MethodCallEvent object describing the event source
and the method that was called.
- See Also:
- recoverFromMethodVeto
createPropertyChangeListener
public DipPropertyChangeListener[] createPropertyChangeListener(Object impl,
String methods[]) throws DipRejectAdditionException
- Wires the dip to receive notification immediately after the specified
properties of the dippable bean are changed.
- Parameters:
- impl - This value should be null. This dip has no separate implementation.
- methods - An array of method signatures from the dippable bean.
- Returns:
- Array of DipPropertyChangeListeners with this dip set to
listen at the appropriate method indices.
- Throws: DipRejectAdditionException
- This exception is thrown if the
dip rejects being added to the bean.
- Overrides:
- createPropertyChangeListener in class SimpleDip
- See Also:
- propertyChange, createPropertyChangeListener
propertyChange
public void propertyChange(PropertyChangeEvent evt)
- Responds to a bound property of the dippable bean being changed.
- Parameters:
- evt - A PropertyChangeEvent object describing the event
source and the property that changed.
- See Also:
- propertyChange
createVetoableChangeListener
public DipVetoableChangeListener[] createVetoableChangeListener(Object impl,
String methods[]) throws DipRejectAdditionException
- Wires the dip to receive notification immediately before the specified
properties of the dippable bean are changed. The dip will also have the
option of vetoing the property change in progress.
- Parameters:
- impl - This value should be null. This dip has no separate implementation.
- methods - An array of method signatures from the dippable bean.
- Returns:
- Array of DipVetoableMethodListeners with this dip set to
listen at the appropriate method indices.
- Throws: DipRejectAdditionException
- This exception is thrown if the
dip rejects being added to the bean.
- Overrides:
- createVetoableChangeListener in class SimpleDip
- See Also:
- vetoableChange, createVetoableChangeListener
vetoableChange
public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException
- Responds to a constrained property of the dippable bean being changed.
Note that, unlike the method and event listeners, there is no
recoverFromPropertyVeto() method that will get called if another
dip vetoes the property change; instead, vetoableChange() will
get called again, and its PropertyChangeEvent parameter will
contain the original value of the property.
- Parameters:
- evt - A PropertyChangeEvent object describing the
event source and the property that changed.
- Throws: PropertyVetoException
- This exception is thrown if the dip
does not approve of the property change in progress.
- See Also:
- vetoableChange
createEventFireListener
public DipEventFireListener[] createEventFireListener(Object impl,
String methods[]) throws DipRejectAdditionException
- Wires the dip to receive notification immediately after the specified
events of the dippable bean are fired.
- Parameters:
- impl - This value should be null. This dip has no separate implementation.
- methods - An array of method signatures from the dippable bean.
- Returns:
- Array of DipEventFireListeners with this dip set to listen at
the appropriate method indices.
- Throws: DipRejectAdditionException
- This exception is thrown if the
dip rejects being added to the bean.
- Overrides:
- createEventFireListener in class SimpleDip
- See Also:
- handleEventFire, createEventFireListener
handleEventFire
public void handleEventFire(EventFireEvent evt)
- 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.
- See Also:
- handleEventFire
createVetoableEventListener
public DipVetoableEventListener[] createVetoableEventListener(Object impl,
String methods[]) throws DipRejectAdditionException
- Wires the dip to receive notification immediately before the specified
events of the dippable bean are fired. The dip will also have the
option of vetoing the event fire in progress.
- Parameters:
- impl - This value should be null. This dip has no separate implementation.
- methods - An array of method signatures from the dippable bean.
- Returns:
- Array of DipVetoableEventListeners with this dip set to listen at
the appropriate method indices.
- Throws: DipRejectAdditionException
- This exception is thrown if the
dip rejects being added to the bean.
- Overrides:
- createVetoableEventListener in class SimpleDip
- See Also:
- handleVetoableEvent, createVetoableEventListener
handleVetoableEvent
public void handleVetoableEvent(EventFireEvent evt) throws EventVetoException
- This method is 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.
- See Also:
- handleVetoableEvent
recoverFromEventVeto
public void recoverFromEventVeto(EventFireEvent evt)
- Allow listeners to perform recovery operations when a constrained event was vetoed.
- Parameters:
- evt - An EventFireEvent object describing the event source
and the event that was vetoed.
- See Also:
- recoverFromEventVeto
All Packages Class Hierarchy This Package Previous Next Index