Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2004 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.property
Interface HierarchicalEntity

All Superinterfaces:
  ConfigurableEntity

All Known Implementing Classes:
  AbstractHierarchicalEntity

public interface HierarchicalEntity
extends ConfigurableEntity

HierarchicalEntity extends ConfigurableEntity by describing an interface by which Entities can be included in a hierachy of successors. The resulting hierarchy is searched upward when getting Properties. This design pattern models the Chain of Responsibility Pattern (Gamma et al).

For example, if an entity A has a successor entity B, and A is queried for a property but does not have a value persisted for that property, it will lookup entity B and query it for that property.

Also, "explicit" successors can be specified as part of a getProperty method call. These are other ConfigurableEntities that should be queried after the current entity, but before any persisted successors.

A HierarchicalEntity can have one successor persisted for each property set, as well as a "default" successor that is not associated with a property set. The default successor will be queried in the case that the current entity does not have a value, the explicit successor (if one is specified) does not have a value, and the successor for the property's property set does not have a value.

Field Summary
`static String` | `SUCCESSOR` property name for an entity's successor

Fields inherited from interface com.bea.p13n.property.ConfigurableEntity
`RESERVED_PROPERTY_SET`

Method Summary
`Object` | `getProperty(String propertySet, String propertyName, ConfigurableEntity successor)` Retrieve the value associated with the named key in the specified property set.
`String` | `getPropertyAsString(String propertySet, String propertyName, ConfigurableEntity successor)` Convenience method to return the property as a String.
`Object` | `getPropertyNoDefault(String propertySet, String propertyName, ConfigurableEntity successor)` Retrieve the value associated with the property in the specified property set, but does not return a default value from the property's PropertyDefinition if the property does not exist for the entity or in the hierarchy of successors.
`ConfigurableEntity` | `getSuccessor(String propertySet)` Retrieve the successor for the specified property set.
`void` | `removeSuccessor(String propertySet)` Remove the successor for the specified property set
`void` | `setSuccessor(String propertySet, ConfigurableEntity successor)` Set the successor for the specified property set

Methods inherited from interface com.bea.p13n.property.ConfigurableEntity
`getJndiName, getPkString, getProperty, getPropertyAsString, getPropertyNoDefault, getUniqueId, removeProperty, setProperty`

Field Detail

### SUCCESSOR

    public static final String SUCCESSOR

  property name for an entity's successor

  See Also:
    Constant Field Values

Method Detail

### getProperty

    public Object getProperty(String propertySet,
                              String propertyName,
                              ConfigurableEntity successor)
                       throws RemoteException

  Retrieve the value associated with the named key in the specified property set. If the entity does not have a value defined for that property, the property will be searched in the successor hiearchy using the explicit successor first and then the successor for the specified scope, and finally the entity's default successor. If this search does not return a value, the default value from the property set will be returned.

  Parameters:
    `propertySet` - The name of the property set
    `propertyName` - The name of the property to retrieve.
    `successor` - The explicit successor to use for sucessor hiearchy search if the entity does not have the property defined.
  Throws:
    `RemoteException`

### getPropertyAsString

    public String getPropertyAsString(String propertySet,
                                      String propertyName,
                                      ConfigurableEntity successor)
                               throws RemoteException

  Convenience method to return the property as a String. Follows the same search order as the getProperty method.

  Parameters:
    `propertySet` - The name of the property set
    `propertyName` - The name of the property to retrieve.
    `successor` - The explicit successor to use for sucessor hiearchy search if the entity does not have the property defined.
  Throws:
    `RemoteException`

### getPropertyNoDefault

    public Object getPropertyNoDefault(String propertySet,
                                       String propertyName,
                                       ConfigurableEntity successor)
                                throws RemoteException

  Retrieve the value associated with the property in the specified property set, but does not return a default value from the property's PropertyDefinition if the property does not exist for the entity or in the hierarchy of successors. This method is used by the implementation of the getProperty methods so that the search in the successor hierarchy does not return a default value from the PropertySet.

  Parameters:
    `propertySet` - The name of the property set
    `propertyName` - The name of the property to retrieve.
    `successor` - The explicit successor to use for sucessor hiearchy search if the entity does not have the property defined.
  Throws:
    `RemoteException`

### getSuccessor

    public ConfigurableEntity getSuccessor(String propertySet)
                                    throws RemoteException

  Retrieve the successor for the specified property set.

  Parameters:
    `propertySet` - The name of the property set
  Throws:
    `RemoteException`

### removeSuccessor

    public void removeSuccessor(String propertySet)
                         throws RemoteException

  Remove the successor for the specified property set

  Parameters:
    `propertySet` - The name of the property set
  Throws:
    `RemoteException`

### setSuccessor

    public void setSuccessor(String propertySet,
                             ConfigurableEntity successor)
                      throws RemoteException

  Set the successor for the specified property set

  Parameters:
    `propertySet` - The name of the property set
    `successor` - The property set-level successor used during the search of a property.
  Throws:
    `RemoteException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2004 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 BEA Systems, Inc. All Rights Reserved