BEA Systems, Inc.

theory.smart.ebusiness.session
Class EBusinessSessionManagerImpl

java.lang.Object
  |
  +--theory.smart.foundation.SessionImpl
        |
        +--theory.smart.ebusiness.session.EBusinessSessionManagerImpl

public class EBusinessSessionManagerImpl
extends SessionImpl

The EBusinessSessionManager (Manager) is a repository for EBusinessSessions (Session). It manages the complete life cycle of its Sessions. Each Session is assigned a unique identifier by the Manager. The identifiers are generated by an AlphaNumericSequencer. The programmer can either accept a default sequence generator shared by all session managers, create a new one by passing in a name in the constructor, or create their own and pass the name into the constructor.

See Also:
EBusinessSession, EBusinessSessionManager, EBusinessSessionManagerHome, Serialized Form

Field Summary
 boolean allowMultipleSessionsPerCustomer
           allowMultipleSessionsPerCustomer [EBusinessSessionManager] <*>------> [boolean]
 OrderManager orderManager
           
 EBusinessSessionHome sessionHome
           
 SmartHandle sessionIdGenerator
           sessionIdGenerator [EBusinessSessionManager] <>------> [theory.smart.axiom.util.AlphaNumericSequencer]
 
Fields inherited from class theory.smart.foundation.SessionImpl
ctx
 
Constructor Summary
EBusinessSessionManagerImpl()
           
 
Method Summary
 EBusinessSession createGuestSession()
          This method allocates a new session Id and then uses the EBusinessSession home interface to create a new session associated with that Id.
 EBusinessSession createRegisteredSession(java.lang.String customerKey)
          This method will create a EBusinessSession that is associated with the specified customer.
 void deleteSession(EBusinessSession session)
          Removes the EBusinessSession.
 void ejbActivate()
           
 void ejbCreate()
           
 void ejbPassivate()
           
 void ejbPostCreate()
           
 void ejbRemove()
           
 boolean getAllowMultipleSessionsPerCustomer()
          Get the value of allowMultipleSessionsPerCustomer
 java.util.Vector getEBusinessSessionByCustomer(java.lang.String customerKey)
          Finds all sessions associated with a particular Customer.
 EBusinessSession getEBusinessSessionBySession(java.lang.String sessionKey)
          Finds an EBusinessSession based on the session's key.
 AlphaNumericSequencer getSessionIdGenerator()
          Get the remote object reference of sessionIdGenerator
 void setAllowMultipleSessionsPerCustomer(boolean allowMultipleSessionsPerCustomer)
          Set the value of allowMultipleSessionsPerCustomer
 void setSessionContext(javax.ejb.SessionContext ctx)
           
 void setSessionIdGenerator(AlphaNumericSequencer sessionIdGenerator)
          Set the remote object reference of sessionIdGenerator
 void setSessionIdGenerator(java.lang.String sequencerKey)
          This method can be used to control the sessionIdGeneration .
 
Methods inherited from class theory.smart.foundation.SessionImpl
getSessionContext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

orderManager

public transient OrderManager orderManager

sessionHome

public transient EBusinessSessionHome sessionHome

allowMultipleSessionsPerCustomer

public boolean allowMultipleSessionsPerCustomer
                  allowMultipleSessionsPerCustomer
 [EBusinessSessionManager] <*>------> [boolean]

 

sessionIdGenerator

public SmartHandle sessionIdGenerator
                  sessionIdGenerator
 [EBusinessSessionManager] <>------> [theory.smart.axiom.util.AlphaNumericSequencer]

 
Constructor Detail

EBusinessSessionManagerImpl

public EBusinessSessionManagerImpl()
                            throws javax.ejb.CreateException
Method Detail

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException,
                      java.rmi.RemoteException
Overrides:
ejbCreate in class SessionImpl

ejbPostCreate

public void ejbPostCreate()
                   throws javax.ejb.CreateException,
                          java.rmi.RemoteException
Overrides:
ejbPostCreate in class SessionImpl

ejbActivate

public void ejbActivate()
                 throws java.rmi.RemoteException
Overrides:
ejbActivate in class SessionImpl

ejbPassivate

public void ejbPassivate()
                  throws java.rmi.RemoteException
Overrides:
ejbPassivate in class SessionImpl

ejbRemove

public void ejbRemove()
               throws java.rmi.RemoteException
Overrides:
ejbRemove in class SessionImpl

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
                       throws java.rmi.RemoteException
Overrides:
setSessionContext in class SessionImpl

getAllowMultipleSessionsPerCustomer

public boolean getAllowMultipleSessionsPerCustomer()
                                            throws java.rmi.RemoteException
Get the value of allowMultipleSessionsPerCustomer
Returns:
allowMultipleSessionsPerCustomer.

setAllowMultipleSessionsPerCustomer

public void setAllowMultipleSessionsPerCustomer(boolean allowMultipleSessionsPerCustomer)
                                         throws java.rmi.RemoteException
Set the value of allowMultipleSessionsPerCustomer
Parameters:
allowMultipleSessionsPerCustomer - allowMultipleSessionsPerCustomer to be added

getSessionIdGenerator

public AlphaNumericSequencer getSessionIdGenerator()
                                            throws java.rmi.RemoteException
Get the remote object reference of sessionIdGenerator
Returns:
sessionIdGenerator.

setSessionIdGenerator

public void setSessionIdGenerator(AlphaNumericSequencer sessionIdGenerator)
                           throws java.rmi.RemoteException
Set the remote object reference of sessionIdGenerator
Parameters:
sessionIdGenerators - sessionIdGenerator to be added

getEBusinessSessionBySession

public EBusinessSession getEBusinessSessionBySession(java.lang.String sessionKey)
                                              throws java.rmi.RemoteException,
                                                     javax.ejb.FinderException
Finds an EBusinessSession based on the session's key. This method is used by client applications that maintain a session key on the client and wish to re-establish context when a new "page" is activated.

getEBusinessSessionByCustomer

public java.util.Vector getEBusinessSessionByCustomer(java.lang.String customerKey)
                                               throws java.rmi.RemoteException,
                                                      javax.ejb.FinderException
Finds all sessions associated with a particular Customer. The SessionManager can be configured to allow multiple sessions for a given customer. The client application is responsible for deciding which of the sessions returned that it will use. Returns a Vector of EBusinessSessions

setSessionIdGenerator

public void setSessionIdGenerator(java.lang.String sequencerKey)
                           throws java.rmi.RemoteException,
                                  javax.ejb.CreateException
This method can be used to control the sessionIdGeneration . It accepts a sequencer id. If that sequencer does not exist it will create one. If the sequencer id is null it will default it to "EBusinessSessionManager".

createGuestSession

public EBusinessSession createGuestSession()
                                    throws java.rmi.RemoteException,
                                           javax.ejb.CreateException
This method allocates a new session Id and then uses the EBusinessSession home interface to create a new session associated with that Id. The new session will have a NULL customer reference and will be be placed in the Guest state by applying the "createGuestSession" event to the newly create state machine .

createRegisteredSession

public EBusinessSession createRegisteredSession(java.lang.String customerKey)
                                         throws java.rmi.RemoteException,
                                                javax.ejb.FinderException
This method will create a EBusinessSession that is associated with the specified customer. If the customer does not exist a guest session is created. It is the responsibility of the client to detect that the session is not associated with a customer and delete the resulting sessio if it is not to be used.

deleteSession

public void deleteSession(EBusinessSession session)
                   throws java.rmi.RemoteException,
                          javax.ejb.RemoveException
Removes the EBusinessSession.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved