Interface COM.ibm.jaws.mofw.KeyedCollection
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface COM.ibm.jaws.mofw.KeyedCollection

public interface KeyedCollection
extends Object
extends QueryableCollection
The KeyedCollection is the highest level collection in the class tree that can return a single object via a unique name called a keyPath.

Select a KeyedCollection in your application object's methods when there is no need to specify how the entries in a collection are created and/or bound. Otherwise, select one of its subtypes (BaseCollection or NamedCollection).


Method Index

 o dispatch(String, CommandOn)
Use this method to resolve a target by a key and execute a command against it (with parameters already set).
 o resolve(String)
Use this method to locate an object by its keyPath.

Methods

 o resolve
  public abstract Object resolve(String keyPath) throws InvalidKeyError
Use this method to locate an object by its keyPath. There are 2 cases for each component in the keyPath, depending on how the key component was determined: (name or identifier). The user of resolve() does not have to be aware of this difference.

The key must be relative to the KC. The rules for implementing resolve() are (eg, keyPath is "abc/xyz"):

Parameters:
keyPath - a String that indicates the object to be retrieved.
Returns:
the Object identified by the key.
Throws: InvalidKeyError
is thrown when the key is not valid.
 o dispatch
  public abstract CommandOn dispatch(String key,
                                     CommandOn command) throws InvalidKeyError, InvalidTargetError, CommandOnNotReadyError
Use this method to resolve a target by a key and execute a command against it (with parameters already set).

The same rules apply to the resolve as for the resolve() method.

The command will end up in the "done" or "error" states where the result can be retrieved and possibly undone.

Parameters:
key - a string representing the key of the object to be used as the target in the command.
command - a CommandOn object that is ready to run (i.e. has parameters set) on the target represented by the key.
Returns:
a CommandOn object in the done/error state.
Throws: InvalidKeyError
is thrown when the key format is bad.
Throws: InvalidTargetError
is thrown when the key resolves to an object that cannot be the CommandOn target.
Throws: CommandOnNotReadyError
is thrown when the CommandOn object needs parameters set.

All Packages  Class Hierarchy  This Package  Previous  Next  Index