|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The ConfigurableEntity provides the interface to an Entity that can be configured at runtime by associating properties via name-value pairs. The values are permanently associated with the entity by use of the EntityPropertyManager.
The name to associate the value with is made of an optional scope name and a key. The scope name defines a namespace for keys. Duplicates keys are allowed in different scopes and not specifying the scope name means the default scope.
The ConfigurableEntity also describes an interface by which Entities can be included in a hierachy of successors. The resulting hierarchy is searched upward when getting Properties and BusinessPolicies. This design pattern models the Chain of Responsibility Pattern (Gamma et al).
Entities that derive from ConfigurableEntity will require that the EntitPropertyManager and SchemaGroupName environment variables be set. The EntityPropertyManager is a stateless session bean that is used to persist the runtime properties. That bean in turn can be configured to persist its properties in a separate set of tables.
EntityPropertyManager
,
ConfigurableEntityImpl
,
BusinessPolicy
Field Summary | |
static java.lang.String |
RESERVED_SCOPE_NAME
keyword for external scope |
Method Summary | |
void |
addPropertyValue(java.lang.String scopeName,
java.lang.String key,
java.lang.Object propertyValue)
Add the specified property value to the collection of values associated with the named key for the specified scope. |
void |
addPropertyValueMapped(java.lang.String scopeName,
java.lang.String propertyKey,
java.lang.String mappedKey,
java.lang.Object propertyValue)
Add the specified property value to the map object associated with the named key for the specified scope. |
PersistableHandle |
getPersistableHandle()
This method is used to create a long lived handle to an EJB object that can be persisted into a database. |
java.lang.Object |
getProperty(java.lang.String key,
java.lang.Object defaultValue)
Retrieve the value associated with the named key in the default scope. |
java.lang.Object |
getProperty(java.lang.String scopeName,
java.lang.String key,
ConfigurableEntity successor,
java.lang.Object defaultValue)
Retrieve the value associated with the named key in the specified scope. |
java.lang.String |
getPropertyAsString(java.lang.String key,
java.lang.String defaultValue)
Retrieve the String value of the property associated the named key in the default scope. |
java.lang.String |
getPropertyAsString(java.lang.String scopeName,
java.lang.String key,
ConfigurableEntity successor,
java.lang.String defaultValue)
Retrieve the String value of the property associated the named key in the specified scope. |
java.lang.Object |
getPropertyDefault(java.lang.String scopeName,
java.lang.String key,
ConfigurableEntity successor)
Retrieve the default value from the Schema for the named key and the specified scope. |
java.lang.Object |
getPropertyNoDefault(java.lang.String scopeName,
java.lang.String key,
ConfigurableEntity successor)
Retrieve the value associated with the named key in the specified scope but does not return a default value if the property does not exist for the entity of in the hierarchy of successors. |
ConfigurableEntity |
getSuccessor(java.lang.String scopeName)
Retrieve the successor associated with this ConfigurableEntity for the specified scope. |
long |
getUniqueId()
Retrieve the unique identifier generated for this ConfigurableEntity. |
java.lang.Object |
removeProperty(java.lang.String key)
Remove the property associated with the named key in the default scope. |
java.lang.Object |
removeProperty(java.lang.String scopeName,
java.lang.String key)
Remove the property associated with the named key in the specified scope. |
java.lang.Object |
removePropertyValue(java.lang.String scopeName,
java.lang.String key,
java.lang.Object propertyValue)
Remove the property value object from the collection associated with the named key in the specified scope. |
java.lang.Object |
removePropertyValueMapped(java.lang.String scopeName,
java.lang.String propertyKey,
java.lang.String mappedKey)
Remove the property value object from the map associated with the named key in the specified scope. |
ConfigurableEntity |
removeSuccessor(java.lang.String scopeName)
Remove the successor for the specified scope. |
void |
setProperty(java.lang.String key,
java.lang.Object value)
Associate the specified value with the named key in the default scope. |
void |
setProperty(java.lang.String scopeName,
java.lang.String key,
java.lang.Object property)
Associate the specified value with the named key in the specified scope. |
void |
setSuccessor(java.lang.String scopeName,
ConfigurableEntity successor)
Set the successor for the specified scope. |
Methods inherited from interface com.beasys.commerce.foundation.BusinessPolicyManager |
addBusinessPolicy,
getBusinessPolicy,
removeBusinessPolicy |
Field Detail |
public static final java.lang.String RESERVED_SCOPE_NAME
Method Detail |
public void addPropertyValue(java.lang.String scopeName, java.lang.String key, java.lang.Object propertyValue) throws SystemException, java.rmi.RemoteException
scopeName
- The name of the scope.key
- The name to associate the collection of values with.propertyValue
- The value to associate with the key and scope.public void addPropertyValueMapped(java.lang.String scopeName, java.lang.String propertyKey, java.lang.String mappedKey, java.lang.Object propertyValue) throws SystemException, java.rmi.RemoteException
scopeName
- The name of the scope.propertykey
- The name to associate the map object with.mappedkey
- The map key to associate the value in the map.propertyValue
- The value put in the map for the map key.public java.lang.Object getProperty(java.lang.String key, java.lang.Object defaultValue) throws SystemException, java.rmi.RemoteException
key
- The name of the property to retrieve.defaultValue
- The value to return if that property is
not set and there is not default value
found in the Schema.public java.lang.Object getProperty(java.lang.String scopeName, java.lang.String key, ConfigurableEntity successor, java.lang.Object defaultValue) throws SystemException, java.rmi.RemoteException
scopeName
- The name of the scope.key
- 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.defaultValue
- The value to return if that property is not set.public java.lang.String getPropertyAsString(java.lang.String key, java.lang.String defaultValue) throws SystemException, java.rmi.RemoteException
key
- The name of the property to retrieve.defaultValue
- The String to return if that property is not set.getProperty(String key, Object defaultValue)
public java.lang.String getPropertyAsString(java.lang.String scopeName, java.lang.String key, ConfigurableEntity successor, java.lang.String defaultValue) throws SystemException, java.rmi.RemoteException
scopeName
- The name of the scope.key
- 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.defaultValue
- The String to return if that property is not set.getProperty(String scopeName, String key, ConfigurableEntity successor, Object defaultValue)
public java.lang.Object getPropertyDefault(java.lang.String scopeName, java.lang.String key, ConfigurableEntity successor) throws SystemException, java.rmi.RemoteException
scopeName
- The name of the scope.key
- 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.public java.lang.Object getPropertyNoDefault(java.lang.String scopeName, java.lang.String key, ConfigurableEntity successor) throws SystemException, java.rmi.RemoteException
scopeName
- The name of the scope.key
- 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.public ConfigurableEntity getSuccessor(java.lang.String scopeName) throws SystemException, java.rmi.RemoteException
scopeName
- The name of the scope.public long getUniqueId() throws SystemException, java.rmi.RemoteException
public java.lang.Object removeProperty(java.lang.String key) throws SystemException, java.rmi.RemoteException
key
- The name of the property to remove.public java.lang.Object removeProperty(java.lang.String scopeName, java.lang.String key) throws SystemException, java.rmi.RemoteException
scopeName
- The name of the scope.key
- The name of the property to remove.public java.lang.Object removePropertyValue(java.lang.String scopeName, java.lang.String key, java.lang.Object propertyValue) throws SystemException, java.rmi.RemoteException
scopeName
- The name of the scope.key
- The name of the property that is associated
with the collection of values.propertyValue
- The object to remove from the collection.public java.lang.Object removePropertyValueMapped(java.lang.String scopeName, java.lang.String propertyKey, java.lang.String mappedKey) throws SystemException, java.rmi.RemoteException
scopeName
- The name of the scope.propertykey
- The name of the property that is associated
with the map.propertyValue
- The map key of the object to remove from the map.public ConfigurableEntity removeSuccessor(java.lang.String scopeName) throws java.rmi.RemoteException
scopeName
- The name of the scope.public void setProperty(java.lang.String key, java.lang.Object value) throws SystemException, java.rmi.RemoteException
name
- The name to associate the value with.value
- The value to associate with the name.public void setProperty(java.lang.String scopeName, java.lang.String key, java.lang.Object property) throws SystemException, java.rmi.RemoteException
scopeName
- The name of the scope.name
- The name to associate the value with.value
- The value to associate with the name.public void setSuccessor(java.lang.String scopeName, ConfigurableEntity successor) throws SystemException, java.rmi.RemoteException
scopeName
- The name of the scope.successor
- The scope-level successor used during the
search of a property.public PersistableHandle getPersistableHandle() throws java.rmi.RemoteException
|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |