All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.ibm.beans.dip.Dip

public interface interface Dip
extends Serializable, DipInfo
This interface describes a dip that can be applied to a class or instance that implements the Dippable interface. Unless there is a good reason, all beans that implement the Dip interface should be created as final classes. Being a final class helps protect the security of the dip.

Any dip can be implemented as a singleton. The Dip interface does not imply the use of a singleton, but it does not prevent it either.

To implement a singleton, follow the pattern described in 'Design Patterns' by Gamma, Helm, Johnson, and Vlissides. If the dip is implemented as a singleton, it should make its constructors protected or private. Any singleton dip should provide special implementations of the writeObject() and readObject() methods.

See Also:
Serializable

Method Index

 o createEventFireListener(Object, String[])
Creates an array of this dip's event fire listeners.
 o createImplementation(Object)
Provides the optional dip implementation object.
 o createMethodCallListener(Object, String[])
Creates an array of this dip's method call listeners.
 o createPropertyChangeListener(Object, String[])
Creates an array of this dip's property change listeners.
 o createVetoableChangeListener(Object, String[])
Creates an array of this dip's vetoable property change listeners.
 o createVetoableEventListener(Object, String[])
Creates an array of this dip's vetoable event fire listeners.
 o createVetoableMethodListener(Object, String[])
Creates an array of this dip's vetoable method call listeners.
 o includeInMorphedClass(String)
Determines if a method should be included in a morphed class.
 o releaseImplementation()
Provides a point where the Dip interface can manage resource allocation or other cleanup before the dip is removed from the dippable instance.

Methods

 o createImplementation
 public abstract Object createImplementation(Object obj) throws DipRejectAdditionException
Provides the optional dip implementation object. This method is called when the dip is being added to the dippable object and provides these functions:

Understanding the Dip Implementation Object

Each dip should decide if it wants to create an implementation separate from itself.

For example, the dip might want an optional dip implementation object if the dip wanted to be a singleton, but the dip also wanted to attach unique data to each instance being dipped. In this example, the singleton would manage any logic universal to dipping all instances, while the separate implementation object would be created for each instance being dipped to manage any logic and data unique to each dipped instance.

Parameters:
obj - The object being dipped. This is the only handle to the bean provided by the dip.
Returns:
null if the dip decides not to have a separate implementation; otherwise this method returns the dip implemation object.
Throws: DipRejectAdditionException
Thrown if the dip rejects being added to the bean.
 o releaseImplementation
 public abstract void releaseImplementation()
Provides a point where the Dip interface can manage resource allocation or other cleanup before the dip is removed from the dippable instance.

If the Dip retained a pointer to the original bean during the createImplementation() method, this method is when that pointer should be nulled out for garbage collection.

 o includeInMorphedClass
 public abstract 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 to used to determine if a dip agrees to including a specific method.

This method is called by the DippableGenerator class when the dipsSpecifyOverrides option is chosen.

Parameters:
methodName - The name of the method to be considered for including in a dippable class.
Returns:
true if the method should be overridden in the new dippable class; false otherwise.
 o createPropertyChangeListener
 public abstract DipPropertyChangeListener[] createPropertyChangeListener(Object imp,
                                                                          String methods[]) throws DipRejectAdditionException
Creates an array of this dip's property change listeners. DipPropertyChangeListener[i] is notified after the property change occurs in method[i].

There is a one-to-one mapping between the array of listeners and the methods parameter. DipPropertyChangeListener[i] is used with the Method corresponding to methods[i]. Obviously, the lengths of the two arrays are equal. Because the dip may not care to listen to every property change method, not every entry in the DipPropertyChangeListener array needs to be set. A null entry in DipPropertyChangeListener[i] means there is no listener for the corresponding property change in method[i]. Also, the dip may assign the same listener to more than one property change method. Therefore, different entries in the DipPropertyChangeListener array may point to the same listener.

Parameters:
imp - The implementation returned from the createImplementation() method call.
methods -
The String array of the names of the property change methods in the dippable bean. These are the fully qualified method names determined by PropertyDescriptor.getWriteMethod().toString() for each of the PropertyDescriptors in the dippable bean.
Returns:
null if the dip supplies no DipPropertyChangeListeners array; otherwise, the array of listeners.
Throws: DipRejectAdditionException
Thrown if the dip rejects being added to the bean.
 o createVetoableChangeListener
 public abstract DipVetoableChangeListener[] createVetoableChangeListener(Object imp,
                                                                          String methods[]) throws DipRejectAdditionException
Creates an array of this dip's vetoable property change listeners. DipVetoableChangeListener[i] is allowed to veto the property change in method[i] before it happens.

There is a one-to-one mapping between the array of listeners and the methods parameter. DipVetoableChangeListener[i] is used with the Method corresponding to methods[i]. Obviously, the lengths of the two arrays are equal. Because the dip may not care to listen to every property change method, not every entry in the DipVetoableChangeListener array needs to be set. A null entry in DipVetoableChangeListener[i] means there is no listener for the corresponding property change in method[i]. Also, the dip may assign the same listener to more than one property change method. Therefore, different entries in the DipVetoableChangeListener array may point to the same listener.

Parameters:
imp - The implementation returned from the createImplementation() method call.
methods -
The String array of the names of the property change methods in the dippable bean. These are the fully qualified method names determined by PropertyDescriptor.getWriteMethod().toString() for each of the PropertyDescriptors in the dippable bean.
Returns:
null if the dip supplies no DipVetoableChangeListeners array; otherwise, the array of listeners.
Throws: DipRejectAdditionException
Thrown if the dip rejects being added to the bean.
 o createMethodCallListener
 public abstract DipMethodCallListener[] createMethodCallListener(Object imp,
                                                                  String methods[]) throws DipRejectAdditionException
Creates an array of this dip's method call listeners. DipMethodCallListener[i] is notified after the general method call occurs in method[i].

There is a one-to-one mapping between the array of listeners and the methods parameter. DipMethodCallListener[i] is used with the Method corresponding to methods[i]. Obviously, the lengths of the two arrays are equal. Because the dip may not care to listen to every general method call, not every entry in the DipMethodCallListener array needs to be set. A null entry in DipMethodCallListener[i] means there is no listener for the corresponding general method in method[i]. Also, the dip may assign the same listener to more than one general method call. Therefore, different entries in the DipMethodCallListener array may point to the same listener.

Parameters:
imp - The implementation returned from the createImplementation() method call.
methods -
The String array of the names of the general methods in the dippable bean. These are the fully qualified general method names. A method is a general method if it is not a property change method or a event call method.
Returns:
null if the dip supplies no DipMethodCallListeners array; otherwise, the array of listeners.
Throws: DipRejectAdditionException
Thrown if the dip rejects being added to the bean.
 o createVetoableMethodListener
 public abstract DipVetoableMethodListener[] createVetoableMethodListener(Object imp,
                                                                          String methods[]) throws DipRejectAdditionException
Creates an array of this dip's vetoable method call listeners. DipVetoableMethodListener[i] is allowed to veto the general method call in method[i] before it happens.

There is a one-to-one mapping between the array of listeners and the methods parameter. DipVetoableMethodListener[i] is used with the Method corresponding to methods[i]. Obviously, the lengths of the two arrays are equal. Because the dip may not care to listen to every general method call, not every entry in the DipVetoableMethodListener array needs to be set. A null entry in DipVetoableMethodListener[i] means there is no listener for the corresponding general method in method[i]. Also, the dip may assign the same listener to more than one general method call. Therefore, different entries in the DipVetoableMethodListener array may point to the same listener.

Parameters:
imp - The implementation returned from the createImplementation() method call.
methods -
The String array of the names of the general methods in the dippable bean. These are the fully qualified general method names. A method is a general method if it is not a property change method or a event call method.
Returns:
null if the dip supplies no DipVetoableMethodListeners array; otherwise, the array of listeners.
Throws: DipRejectAdditionException
Thrown if the dip rejects being added to the bean.
 o createEventFireListener
 public abstract DipEventFireListener[] createEventFireListener(Object imp,
                                                                String methods[]) throws DipRejectAdditionException
Creates an array of this dip's event fire listeners. DipEventFireListener[i] is notified after the event call occurs in method[i].

There is a one-to-one mapping between the array of listeners and the methods parameter. DipEventFireListener[i] is used with the Method corresponding to methods[i]. Obviously, the lengths of the two arrays are equal. Because the dip may not care to listen to every event call method, not every entry in the DipEventFireListener array needs to be set. A null entry in DipEventFireListener[i] means there is no listener for the corresponding event call in method[i]. Also, the dip may assign the same listener to more than one event call method. Therefore, different entries in the DipEventFireListener array may point to the same listener.

Parameters:
imp - The implementation returned from the createImplementation() method call.
methods -
The String array of the names of the event call methods in the dippable bean. These are the fully qualified method names, where the method name is "fire<EventSetName>" for a non-AWT event, or the method name is "process<EventSetName>" for an AWT event.
Returns:
null if the dip supplies no DipEventFireListeners array; otherwise, the array of listeners.
Throws: DipRejectAdditionException
Thrown if the dip rejects being added to the bean.
 o createVetoableEventListener
 public abstract DipVetoableEventListener[] createVetoableEventListener(Object imp,
                                                                        String methods[]) throws DipRejectAdditionException
Creates an array of this dip's vetoable event fire listeners. DipVetoableEventListener[i] is allowed to veto the event call in method[i] before it happens.

There is a one-to-one mapping between the array of listeners and the methods parameter. DipVetoableEventListener[i] is used with the Method corresponding to methods[i]. Obviously, the lengths of the two arrays are equal. Because the dip may not care to listen to every event call method, not every entry in the DipVetoableEventListener array needs to be set. A null entry in DipVetoableEventListener[i] means there is no listener for the corresponding event call in method[i]. Also, the dip may assign the same listener to more than one event call method. Therefore, different entries in the DipVetoableEventListener array may point to the same listener.

Parameters:
imp - The implementation returned from the createImplementation() method call.
methods -
The String array of the names of the event call methods in the dippable bean. These are the fully qualified method names, where the method name is "fire<EventSetName>" for a non-AWT event, or the method name is "process<EventSetName>" for an AWT event.
Returns:
null if the dip supplies no DipVetoableEventListeners array; otherwise, the array of listeners.
Throws: DipRejectAdditionException
Thrown if the dip rejects being added to the bean.

All Packages  Class Hierarchy  This Package  Previous  Next  Index