com.instantbank.lettertemplate.control.ejb
Class StateMachine
java.lang.Object
|
+--com.instantbank.lettertemplate.control.ejb.StateMachine
- All Implemented Interfaces:
- java.io.Serializable
- public class StateMachine
- extends java.lang.Object
- implements java.io.Serializable
This class is a Universal front back end of an application which ties all
EJB components together dynamically at runtime. It is a javaBean which works
for Controller EJB. This class should not be updated to handle various event
types. This class will use StateHandler objects to handle events that
require processing beyond the scope of this class. A second option to event
handling is to do so in the XML descriptor itself. State may be stored in
the attributeMap Configuration of this file is via an XML descriptor.
- Author:
- Instant-bank (Consuelo Franky)
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
sccejb
private LetterTemplateControllerEJB sccejb
mum
private ModelUpdateManager mum
attributeMap
private java.util.HashMap attributeMap
handlerMap
private java.util.HashMap handlerMap
sc
private javax.ejb.SessionContext sc
debug
private Debug debug
StateMachine
public StateMachine(LetterTemplateControllerEJB sccejb,
javax.ejb.SessionContext sc)
- constructor: instances attributes
- Parameters:
sccejb
- controller ejbsc
- context
handleEvent
public java.util.Collection handleEvent(LetterTemplateEvent ese)
throws java.rmi.RemoteException,
LetterTemplateEventException
- process event corresponding to user request, through associated handler
- Parameters:
ese
- event corresponding to user request- Returns:
- list of names of model objects that changed with the event processing;
this list is builded by num (ModelUpdateManager).
In addition, the first element of the list contains the service answer
(or the "" string when this answer is not required)
- Throws:
LetterTemplateEventException
- java.rmi.RemoteException
- Description of the Exception
getHandlerName
private java.lang.String getHandlerName(java.lang.String eventName)
throws LetterTemplateEventException
- get in context the name of handler class for the event
- Parameters:
eventName
- name of event corresponding to user request- Returns:
- The handlerName value
- Throws:
LetterTemplateEventException
-
setAttribute
public void setAttribute(java.lang.String key,
java.lang.Object value)
- register a attribute of the user session
- Parameters:
key
- The new attribute keyvalue
- The new attribute value
getAttribute
public java.lang.Object getAttribute(java.lang.String key)
- get value of user session attribute
- Parameters:
key
- attribute key- Returns:
- The attribute value
getLetterTemplateControllerEJB
public LetterTemplateControllerEJB getLetterTemplateControllerEJB()
- get reference to controller ejb
- Returns:
- The LetterTemplateControllerEJB value
getSessionContext
public javax.ejb.SessionContext getSessionContext()
- get SessionContext
- Returns:
- The sessionContext value