com.beasys.commerce.foundation
Class SessionImpl

java.lang.Object
  extended by com.beasys.commerce.foundation.SessionImpl
Direct Known Subclasses:
CatalogServiceImpl, CatalogWSImpl, DecryptorImpl, EncryptorImpl, ShippingHelperImpl

public abstract class SessionImpl
extends Object

This is the base implementation of the Business Smart Component (BSC) Session interface. For each BSC Session derived interface, there will be a corresponding BSC SessionImpl with business methods that are mirrored. It also provides storage for an SessionContext and an implementation of the Set and Get Session Context methods.

See Also

Session Beans also implement the SmartUpdate API. See the EntityImpl comments for more details. Although SmartUpdate is intended primarily for BMP, Session Beans may find it useful as well.


Field Summary
 SessionContext _ctx
           
protected  Context _environmentNamingContext
           
protected  Hashtable _environmentPropertyCache
           
protected  boolean _isDirty
           
 
Constructor Summary
SessionImpl()
          SessionImpl constructor.
 
Method Summary
 void clearRelationalBinding(String attributeIdentifier, Collection collection)
           
 void clearRelationalBinding(String attributeIdentifier, Collection collection, Object o)
           
 void clearRelationalBinding(String attributeIdentifier, Map map)
           
 void clearRelationalBinding(String attributeIdentifier, Map map, Object key)
           
protected  Collection doRelationalBinding(String attributeIdentifier, Collection collection)
          Add relational information to each element in a collection, AND synchronize the collection with the persistence cache This feature is implemented by a plugin and by default is turned off
protected  Map doRelationalBinding(String attributeIdentifier, Map map)
          Add relational information to each element in a map, AND synchronize the map with the persistence cache This feature is implemented by a plugin and by default is turned off
protected  Belonging doRelationalBindingOnElement(String attributeIdentifier, Belonging value)
          Add relational information to a belonging This feature is implemented by a plugin and by default is turned off
protected  Object doRelationalBindingOnElement(String attributeIdentifier, Object value)
          Add relational information to a dependent object.
protected  Belonging doRelationalBindingOnSingleton(String attributeIdentifier, Belonging value)
          Add relational information to a belonging This feature is implemented by a plugin and by default is turned off
protected  Object doRelationalBindingOnSingleton(String attributeIdentifier, Object value)
          Add relational information to a dependent object.
protected  Object doRelationalBindingWithMapKey(String attributeIdentifier, Belonging belonging, Object key)
          Add relational information to an element in a map, AND synchronize the element with the persistence cache This feature is implemented by a plugin and by default is turned off
protected  Object doRelationalBindingWithMapKey(String attributeIdentifier, Object object, Object key)
          Add relational information to an element in a map, AND synchronize the element with the persistence cache This feature is implemented by a plugin and by default is turned off
 void ejbActivate()
          ejbActivate method.
 void ejbCreate()
          ejbCreate method.
 void ejbPassivate()
          ejbPassivate method.
 void ejbPostCreate()
          ejbPostCreate method.
 void ejbRemove()
          ejbRemove method.
protected  Collection enumerateRelationalBinding(String attributeIdentifier, Collection collection)
          Add relational information to each element in a collection, but do not synchronize the collection with the persistence cache This feature is implemented by a plugin and by default is turned off
protected  Map enumerateRelationalBinding(String attributeIdentifier, Map map)
          Add relational information to each element in a map, but do not synchronize the map with the persistence cache This feature is implemented by a plugin and by default is turned off
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.
protected  Hashtable getEnvironmentPropertyCache()
          Returns the bean's environment property cache
 PersistenceHelperPlugin getPersistenceHelperPlugin()
          Instantiates PersistenceHelperPlugin based on "...PersistenceHelperPlugin" property in commerce.properties file.
 SessionContext getSessionContext()
          getSessionContext method.
 void setSessionContext(SessionContext ctx)
          setSessionContext method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_isDirty

protected transient boolean _isDirty

_ctx

public SessionContext _ctx

_environmentNamingContext

protected transient Context _environmentNamingContext

_environmentPropertyCache

protected transient Hashtable _environmentPropertyCache
Constructor Detail

SessionImpl

public SessionImpl()
SessionImpl constructor.

Method Detail

ejbActivate

public void ejbActivate()
                 throws EJBException
ejbActivate method.

Throws
EJBException

ejbCreate

public void ejbCreate()
               throws CreateException,
                      EJBException
ejbCreate method.

Throws
CreateException
EJBException

ejbPassivate

public void ejbPassivate()
                  throws EJBException
ejbPassivate method.

Throws
EJBException

ejbPostCreate

public void ejbPostCreate()
                   throws CreateException,
                          EJBException
ejbPostCreate method.

Throws
CreateException
EJBException

ejbRemove

public void ejbRemove()
               throws EJBException
ejbRemove method.

Throws
EJBException

setSessionContext

public void setSessionContext(SessionContext ctx)
                       throws EJBException
setSessionContext method.

Throws
EJBException

getSessionContext

public SessionContext getSessionContext()
getSessionContext method.


getEnvironmentNamingContext

protected Context getEnvironmentNamingContext()
                                       throws NamingException
Returns the bean's environment naming context.

Throws
NamingException - - if a naming exception is encountered

getEnvironmentPropertyCache

protected Hashtable getEnvironmentPropertyCache()
Returns the bean's environment property cache


getEnvironmentProperty

public Object getEnvironmentProperty(String propertyName)
                              throws NamingException
This method returns the value of the specified environment property.

Throws
NamingException - - if a naming exception is encountered

getEnvironmentProperty

public Object getEnvironmentProperty(String propertyName,
                                     Object defaultValue)
                              throws NamingException
This method returns the value of the specified environment property or the specified default value if the environment property is not found.

Throws
NamingException - - if a naming exception is encountered

doRelationalBindingOnElement

protected Object doRelationalBindingOnElement(String attributeIdentifier,
                                              Object value)
Add relational information to a dependent object. This feature is implemented by a plugin and by default is turned off

Parameters
attributeIdentifier - identifier for an attribute on a bean e.g. examples.buybeans.BeanieHat.numberOfPropellers
value - instance of a dependent object
entityImpl - implementation of an entity bean
Returns
the input value with relational information added.

doRelationalBindingOnElement

protected Belonging doRelationalBindingOnElement(String attributeIdentifier,
                                                 Belonging value)
Add relational information to a belonging This feature is implemented by a plugin and by default is turned off

Parameters
attributeIdentifier - identifier for an attribute on a bean e.g. examples.buybeans.BeanieHat.numberOfPropellers
belonging - instance of a belonging
entityImpl - implementation of an entity bean
Returns
the input value, with relational inforamtion added.

doRelationalBindingOnSingleton

protected Object doRelationalBindingOnSingleton(String attributeIdentifier,
                                                Object value)
Add relational information to a dependent object. This feature is implemented by a plugin and by default is turned off

Parameters
attributeIdentifier - identifier for an attribute on a bean e.g. examples.buybeans.BeanieHat.numberOfPropellers
value - instance of a dependent object
entityImpl - implementation of an entity bean
Returns
the input value with relational information added.

doRelationalBindingOnSingleton

protected Belonging doRelationalBindingOnSingleton(String attributeIdentifier,
                                                   Belonging value)
Add relational information to a belonging This feature is implemented by a plugin and by default is turned off

Parameters
attributeIdentifier - identifier for an attribute on a bean e.g. examples.buybeans.BeanieHat.numberOfPropellers
belonging - instance of a belonging
entityImpl - implementation of an entity bean
Returns
the input value, with relational inforamtion added.

doRelationalBindingWithMapKey

protected Object doRelationalBindingWithMapKey(String attributeIdentifier,
                                               Object object,
                                               Object key)
Add relational information to an element in a map, AND synchronize the element with the persistence cache This feature is implemented by a plugin and by default is turned off

Parameters
attributeIdentifier - identifier for an attribute on a bean e.g. examples.buybeans.BeanieHat.numberOfPropellers
collection - the target collection
Returns
the input collection

doRelationalBindingWithMapKey

protected Object doRelationalBindingWithMapKey(String attributeIdentifier,
                                               Belonging belonging,
                                               Object key)
Add relational information to an element in a map, AND synchronize the element with the persistence cache This feature is implemented by a plugin and by default is turned off

Parameters
attributeIdentifier - identifier for an attribute on a bean e.g. examples.buybeans.BeanieHat.numberOfPropellers
collection - the target collection
Returns
the input collection

doRelationalBinding

protected Collection doRelationalBinding(String attributeIdentifier,
                                         Collection collection)
Add relational information to each element in a collection, AND synchronize the collection with the persistence cache This feature is implemented by a plugin and by default is turned off

Parameters
attributeIdentifier - identifier for an attribute on a bean e.g. examples.buybeans.BeanieHat.numberOfPropellers
collection - the target collection
Returns
the input collection

doRelationalBinding

protected Map doRelationalBinding(String attributeIdentifier,
                                  Map map)
Add relational information to each element in a map, AND synchronize the map with the persistence cache This feature is implemented by a plugin and by default is turned off

Parameters
attributeIdentifier - identifier for an attribute on a bean e.g. examples.buybeans.BeanieHat.numberOfPropellers
map - the target map
Returns
the input map

enumerateRelationalBinding

protected Collection enumerateRelationalBinding(String attributeIdentifier,
                                                Collection collection)
Add relational information to each element in a collection, but do not synchronize the collection with the persistence cache This feature is implemented by a plugin and by default is turned off

Parameters
attributeIdentifier - identifier for an attribute on a bean e.g. examples.buybeans.BeanieHat.numberOfPropellers
collection - the target collection
Returns
the input collection

enumerateRelationalBinding

protected Map enumerateRelationalBinding(String attributeIdentifier,
                                         Map map)
Add relational information to each element in a map, but do not synchronize the map with the persistence cache This feature is implemented by a plugin and by default is turned off

Parameters
attributeIdentifier - identifier for an attribute on a bean e.g. examples.buybeans.BeanieHat.numberOfPropellers
map - the target map
Returns
the input map

clearRelationalBinding

public void clearRelationalBinding(String attributeIdentifier,
                                   Collection collection)

clearRelationalBinding

public void clearRelationalBinding(String attributeIdentifier,
                                   Collection collection,
                                   Object o)

clearRelationalBinding

public void clearRelationalBinding(String attributeIdentifier,
                                   Map map,
                                   Object key)

clearRelationalBinding

public void clearRelationalBinding(String attributeIdentifier,
                                   Map map)

getPersistenceHelperPlugin

public PersistenceHelperPlugin getPersistenceHelperPlugin()
Instantiates PersistenceHelperPlugin based on "...PersistenceHelperPlugin" property in commerce.properties file. This property can be specified either for each session, or as a "DefaultPersistenceHelperPlugin" property.

Returns
PersistenceHelperPlugin specific class that implements PersistenceHelperPlugin or null, if no HelperPlugin is specified


Copyright © 2006 BEA Systems, Inc. All Rights Reserved