All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.dip.VetoableMethodSupport

java.lang.Object
   |
   +----com.ibm.beans.dip.VetoableMethodSupport

public class VetoableMethodSupport
extends Object
implements Serializable
This utility class can be used by beans that support constrained methods. You can inherit from this class or use an instance of this class as a member field of your bean. Once inherited or instantiated, you can delegate work to this bean.


Constructor Index

 o VetoableMethodSupport(Object)
Constructs a VetoableMethodSupport instance using the default Vector implementation.
 o VetoableMethodSupport(Object, Collection)
Constructs a VetoableMethodSupport instance using the input Collection.

Method Index

 o addVetoableMethodListener(VetoableMethodListener)
Adds a VetoableMethodListener instance to the listener list.
 o elements()
Gets an enumeration of VetoableMethodListener instances.
 o fireVetoableMethod(String, Object[])
Reports a vetoable method call to any registered listeners.
 o isEmpty()
Checks to see if the collection of listeners is empty.
 o removeVetoableMethodListener(VetoableMethodListener)
Removes a VetoableMethodListener instance from the listener list.

Constructors

 o VetoableMethodSupport
 public VetoableMethodSupport(Object sourceBean)
Constructs a VetoableMethodSupport instance using the default Vector implementation.

Parameters:
sourceBean - The bean given as the source for any event.
 o VetoableMethodSupport
 public VetoableMethodSupport(Object sourceBean,
                              Collection collection)
Constructs a VetoableMethodSupport instance using the input Collection.

Parameters:
sourceBean - The bean given as the source for any event.
collection - The type of Collection used to store the listeners.

Methods

 o addVetoableMethodListener
 public synchronized void addVetoableMethodListener(VetoableMethodListener listener)
Adds a VetoableMethodListener instance to the listener list.

Parameters:
listener - The listener to add.
 o removeVetoableMethodListener
 public synchronized void removeVetoableMethodListener(VetoableMethodListener listener)
Removes a VetoableMethodListener instance from the listener list.

Parameters:
listener - The listener to remove.
 o fireVetoableMethod
 public void fireVetoableMethod(String method,
                                Object args[]) throws MethodVetoException
Reports a vetoable method call to any registered listeners. If anyone vetos the method, then this method fires a new event preventing the original method operation.

Parameters:
method - The unique string identifying the called method.
args - The arguments passed to the called method.
Throws: MethodVetoException
May be thown if the listener wants the method operation not to be performed.
 o elements
 public final synchronized Enumeration elements()
Gets an enumeration of VetoableMethodListener instances. Use the Enumeration methods on the returned object to fetch the elements sequentially.

Returns:
An enumeration of the listeners that will be fired in the fireVetoableMethod() method.
 o isEmpty
 public final boolean isEmpty()
Checks to see if the collection of listeners is empty.

Returns:
true if empty; false otherwise.

All Packages  Class Hierarchy  This Package  Previous  Next  Index