1 package com.explosion.utilities.process.threads;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 /***
24 * @author Stephen Cowx Date created:@12-Feb-2003
25 */
26 public interface UnitisedProcess extends Process
27 {
28
29 /***
30 * Finalise normally. <br>
31 */
32 public void finaliseProcessing() throws Exception;
33
34 /***
35 * Finalise abnormally. <br>
36 */
37 public void finaliseProcessing(Exception e);
38
39 /***
40 * Initialise. <br>
41 */
42 public void initialiseProcessing() throws Exception;
43
44 /***
45 * Called just before processUnit
46 */
47 public void beginProcessUnit() throws Exception;
48
49 /***
50 * This should perform a single unit of processing
51 */
52 public void processUnit() throws Exception;
53
54 /***
55 * Called after getProcessUnitCompletionStatus() if
56 * getProcessUnitCompletionStatus() returns COMPLETE_SUCCSSFULLY or
57 * COMPLETE_UNSUCCESSFULY
58 */
59 public void endProcessUnit() throws Exception;
60
61 /***
62 * Returns an indicator of the competion status
63 */
64 public boolean processUnitComplete();
65
66 }