|
Oracle Fusion Middleware Java API for Oracle WebLogic Portal 10g Release 3 (10.3.2) E14255-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.bea.p13n.property.AbstractConfigurableEntity
com.bea.p13n.property.ConfigurableEntityImpl
public abstract class ConfigurableEntityImpl
Abstract base class for ConfigurableEntity EJB's.
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 property set name and a key. Property sets define namespaces for keys. Duplicate keys are allowed in different property sets, and not specifying a property set means the "default" property set.
Entities that derive from ConfigurableEntity will require that the EntityPropertyManager and PropertySetType environment variables be set in their EJB deployment descriptors.
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.
PropertySet
, EntityPropertyManager
, Serialized FormField Summary | |
---|---|
protected javax.ejb.EntityContext |
_ctx cached entity context |
protected Context |
_environmentNamingContext cached environment context |
protected static String |
COMMERCE_POOL the name of the jdbc pool resource |
protected static String |
ENTITY_PROPERTY_MANAGER names used to lookup ejb-refs |
protected EntityPropertyManager |
entityPropertyManager Cached reference to this entity's entityPropertyManager |
protected static String |
JNDI_NAME variable name for JNDI lookup name |
protected static String |
PROPERTY_SET_MANAGER |
protected static String |
PROPERTY_SET_TYPE variable name for property set type |
protected PropertyLocator |
propertyLocator Cached propertyLocator for this entity; used when requesting properties from the EntityPropertyManager |
protected PropertySetManager |
psManager Cached reference to the PropertySetManager |
protected static com.bea.p13n.i18n.PropertyExceptionTextFormatter |
textFormatter Exception class |
long |
uid The unique numeric id of this entity |
Fields inherited from class com.bea.p13n.property.AbstractConfigurableEntity |
---|
CE_METHOD_CACHE, instanceClass, PREFIX_GET, PREFIX_SET, propertyCache |
Fields inherited from interface com.bea.p13n.property.ConfigurableEntity |
---|
RESERVED_PROPERTY_SET |
Constructor Summary | |
---|---|
ConfigurableEntityImpl() Default constructor |
Method Summary | |
---|---|
protected long |
createUniqueId(Object aPK) Use the EntityPropertyManager to create a new unique id for the entity represented by the given primary key. |
void |
ejbActivate() Prepare to activate this entity by resetting its naming context and EntityPropertyManager reference. |
ConfigurableEntityPk |
ejbCreate(ConfigurableEntityPk aPK) Creates a record for a new ConfigurableEntity using the given primary key |
ConfigurableEntityPk |
ejbFindByPrimaryKey(ConfigurableEntityPk pk) Look for the entity in the main entity table, keyed by the pk's identifier, and the jndi name (fully scoped with application name). |
void |
ejbLoad() Resets this entity's attributes so that it will reload from the EntityPropertyManager. |
void |
ejbPassivate() Prepare to passivate this entity by closing the cached naming context. |
void |
ejbPostCreate(ConfigurableEntityPk aPK) Post-creation method; not implemented. |
void |
ejbRemove() Remove the record for this entity, and all of its associated properties. |
void |
ejbStore() ConfigurableEntity sets properties on the fly, so there is nothing to store at the end of a transaction |
protected Connection |
getConnection() Get a connection from the "jdbc/commercePool" DataSource environment entry for the EJB. |
protected String |
getDefaultSqlBundleName() Return the name of the ResourceBundle which stores externalized sql strings. |
javax.ejb.EntityContext |
getEntityContext() Retrieve the cached entity context |
protected EntityPropertyManager |
getEntityPropertyManager() Find the entity property manager assigned to this ConfigurableEntity |
protected Context |
getEnvironmentNamingContext() Returns the bean's environment naming context. |
Object |
getEnvironmentProperty(String propertyName) This method returns the value of the specified environment property. |
Object |
getEnvironmentProperty(String propertyName, Object defaultValue) This method returns the value of the specified environment property or the specified default value if the environment property is not found. |
String |
getJndiName() Retrieve the jndi name for an entity. |
String |
getPkString() Retrieve the pk string for an entity. |
Object |
getProperty(String propertySet, String propertyName) Retrieve the value that was persisted for this entity for the given property, within the given property set. |
EntityPropertyCache |
getPropertyCache() Allocate the property map and load it using the EntityPropertyManager. |
protected Object |
getPropertyDefault(String propertySet, String propertyName) Retrieve the default value from the Schema for the named key and the specified scope. |
protected PropertyLocator |
getPropertyLocator() Create and return a PropertyLocator to represent this entity. |
protected PropertyLocator |
getPropertyLocator(Object aPk) Create and return a PropertyLocator to represent the entity identified by the primary key |
protected PropertySetManager |
getPropertySetManager() Get a reference to the PropertySetManager session bean. |
protected PreparedStatement |
getStatement(Connection conn, String key) Use the provided connection to prepare the SQL statement named by the provided key. |
long |
getUniqueId() Retrieve the unique identifier generated for this ConfigurableEntity. |
Object |
removeProperty(String propertySet, String propertyName) Remove the property associated with the named key in the specified property set. |
void |
setEntityContext(javax.ejb.EntityContext ctx) Sets the entity context. |
void |
setProperty(String propertySet, String propertyName, Object value) Associate the specified value with the named key in the specified property set. |
void |
unsetEntityContext() Resets the entity context. |
protected boolean |
useEntityPropertyManager() Determine if this class should try to use the EntityPropertyManager. |
Methods inherited from class com.bea.p13n.property.AbstractConfigurableEntity |
---|
createMapKey, getCachedProperty, getExplicitProperty, getExplicitSetter, getImplicitProperty, getPropertyAsString, getPropertyNoDefault, hasExplicitGetter, hasExplicitSetter, removeExplicitProperty, setExplicitProperty, upcaseFirst |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected javax.ejb.EntityContext _ctx
protected transient Context _environmentNamingContext
public long uid
protected static final String ENTITY_PROPERTY_MANAGER
protected static final String PROPERTY_SET_MANAGER
protected static final String PROPERTY_SET_TYPE
protected static final String JNDI_NAME
protected static final String COMMERCE_POOL
protected transient EntityPropertyManager entityPropertyManager
protected transient PropertySetManager psManager
protected transient PropertyLocator propertyLocator
protected static final com.bea.p13n.i18n.PropertyExceptionTextFormatter textFormatter
Constructor Detail |
---|
public ConfigurableEntityImpl()
Method Detail |
---|
public ConfigurableEntityPk ejbCreate(ConfigurableEntityPk aPK) throws javax.ejb.CreateException
aPK
- the primary key to createjavax.ejb.CreateException
public void ejbPostCreate(ConfigurableEntityPk aPK) throws javax.ejb.CreateException
javax.ejb.CreateException
public void ejbPassivate() throws javax.ejb.EJBException
ejbPassivate
in interface javax.ejb.EntityBean
javax.ejb.EJBException
public void ejbActivate() throws javax.ejb.EJBException
ejbActivate
in interface javax.ejb.EntityBean
javax.ejb.EJBException
public void ejbLoad() throws javax.ejb.EJBException
ejbLoad
in interface javax.ejb.EntityBean
javax.ejb.EJBException
public void ejbStore() throws javax.ejb.EJBException
ejbStore
in interface javax.ejb.EntityBean
javax.ejb.EJBException
public void ejbRemove() throws javax.ejb.RemoveException
ejbRemove
in interface javax.ejb.EntityBean
javax.ejb.RemoveException
public ConfigurableEntityPk ejbFindByPrimaryKey(ConfigurableEntityPk pk) throws javax.ejb.FinderException
Subclasses can override this method to search for the entity in a different table, if they extend the entity and it makes more sense to do that.
pk
- the primary key to look forjavax.ejb.FinderException
- if the entity is not foundpublic void setEntityContext(javax.ejb.EntityContext ctx) throws javax.ejb.EJBException
setEntityContext
in interface javax.ejb.EntityBean
ctx
- SessionContext Context for sessionjavax.ejb.EJBException
public void unsetEntityContext() throws javax.ejb.EJBException
unsetEntityContext
in interface javax.ejb.EntityBean
javax.ejb.EJBException
public javax.ejb.EntityContext getEntityContext()
public Object getProperty(String propertySet, String propertyName) throws RemoteException
getProperty
in interface ConfigurableEntity
getProperty
in class AbstractConfigurableEntity
propertySet
- The name of the property set to look inpropertyName
- The name of the property to retrieve.RemoteException
public void setProperty(String propertySet, String propertyName, Object value) throws PropertyValidationException
setProperty
in interface ConfigurableEntity
setProperty
in class AbstractConfigurableEntity
propertySet
- The name of the property set.propertyName
- The name of the property to assignvalue
- The value to associate with the property namePropertyValidationException
- If the property value does not match the PropertyDefinition for this property setpublic Object removeProperty(String propertySet, String propertyName)
NOTE: if an explicit setter method is found for this property, this method will set the value to null.
removeProperty
in interface ConfigurableEntity
removeProperty
in class AbstractConfigurableEntity
propertySet
- The name of the property set.propertyName
- The name of the property to remove.public long getUniqueId() throws RemoteException
getUniqueId
in interface ConfigurableEntity
getUniqueId
in class AbstractConfigurableEntity
RemoteException
public String getPkString() throws RemoteException
getPkString
in interface ConfigurableEntity
getPkString
in class AbstractConfigurableEntity
RemoteException
protected Object getPropertyDefault(String propertySet, String propertyName) throws RemoteException
propertySet
- the property set to look inpropertyName
- the name of the propertyRemoteException
protected long createUniqueId(Object aPK) throws ConfigurableEntityCreateException, RemoteException
aPK
- the primary key to createConfigurableEntityCreateException
- if there is an errorRemoteException
- if there is an error from the EntityPropertyManagerprotected boolean useEntityPropertyManager()
public EntityPropertyCache getPropertyCache() throws RemoteException
getPropertyCache
in class AbstractConfigurableEntity
RemoteException
protected PropertyLocator getPropertyLocator() throws RemoteException
RemoteException
protected PropertyLocator getPropertyLocator(Object aPk) throws RemoteException
aPk
- the primary key of the entityRemoteException
public String getJndiName()
getJndiName
in interface ConfigurableEntity
getJndiName
in class AbstractConfigurableEntity
protected EntityPropertyManager getEntityPropertyManager() throws RemoteException
RemoteException
protected PropertySetManager getPropertySetManager() throws RemoteException
RemoteException
public Object getEnvironmentProperty(String propertyName) throws NamingException
NamingException
- - if a naming exception is encounteredpublic Object getEnvironmentProperty(String propertyName, Object defaultValue) throws NamingException
NamingException
- - if a naming exception is encounteredprotected Context getEnvironmentNamingContext() throws NamingException
NamingException
- - if a naming exception is encounteredprotected Connection getConnection()
ConfigurableEntitySystemException
- if there is a problemprotected PreparedStatement getStatement(Connection conn, String key) throws SQLException
conn
- a valid database connectionkey
- the key to lookup a SQL statement withSQLException
- if an error occurs creating the statementprotected String getDefaultSqlBundleName()
|
Oracle Fusion Middleware Java API for Oracle WebLogic Portal 10g Release 3 (10.3.2) E14255-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2010, Oracle. All rights reserved.