1    package com.instantbank.lettertemplate.control.ejb.handlers;
2    
3    import java.io.Serializable;
4    import com.instantbank.lettertemplate.control.ejb.StateMachine;
5    import com.instantbank.lettertemplate.control.LetterTemplateEventException;
6    import com.instantbank.lettertemplate.control.event.LetterTemplateEvent;
7    
8    /**
9     *  superclass for event handlers
10    *
11    * @author Instant-bank (Consuelo Franky)
12    * @created August 2002
13    */
14   public class StateHandlerSupport
15       implements Serializable, StateHandler {
16   
17     /**
18      *  StateMachine
19      */
20     protected StateMachine machine = null;
21   
22   
23     /**
24      *  every handler is instanced and initialized by the StateMachine javaBean;
25      *  the handler gets the StateMachine reference by parameter
26      *
27      * @param machine StateMachine
28      */
29     public void init(StateMachine machine) {
30       this.machine = machine;
31     }
32   
33   
34     /**
35      *  doStart: before event processing
36      */
37     public void doStart() { }
38   
39   
40     /**
41      *  processing of event
42      *
43      * @param event event corresponding to user request
44      * @return answer to event
45      * @exception LetterTemplateEventException
46      */
47     public Object perform(LetterTemplateEvent event)
48        throws LetterTemplateEventException {
49       return null;
50     }
51   
52   
53     /**
54      *  DdoEnd: after event processing
55      */
56     public void doEnd() { }
57   }
58   
59