1 package org.apache.maven.continuum.release;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.ArrayList;
23 import java.util.Collections;
24 import java.util.List;
25
26 import org.apache.maven.shared.release.ReleaseManagerListener;
27
28
29
30
31
32 public class DefaultReleaseManagerListener
33 implements ReleaseManagerListener, ContinuumReleaseManagerListener
34 {
35 private String goalName;
36
37 private List<String> completedPhases;
38
39 private String inProgress;
40
41 private List<String> phases;
42
43 private String error;
44
45 private int state;
46
47 public void goalStart( String name, List phases )
48 {
49 state = LISTENING;
50 goalName = name;
51 this.phases = phases;
52 completedPhases = Collections.synchronizedList( new ArrayList<String>() );
53 inProgress = null;
54 }
55
56 public void phaseStart( String name )
57 {
58 inProgress = name;
59 }
60
61 public void phaseEnd()
62 {
63 completedPhases.add( inProgress );
64
65 inProgress = null;
66 }
67
68 public void phaseSkip( String name )
69 {
70 completedPhases.add( name );
71 }
72
73 public void goalEnd()
74 {
75 state = FINISHED;
76 }
77
78 public void error( String message )
79 {
80 error = message;
81 goalEnd();
82 }
83
84 public List<String> getCompletedPhases()
85 {
86 return completedPhases;
87 }
88
89 public String getInProgress()
90 {
91 return inProgress;
92 }
93
94 public List<String> getPhases()
95 {
96 return phases;
97 }
98
99 public String getGoalName()
100 {
101 return goalName;
102 }
103
104 public String getError()
105 {
106 return error;
107 }
108
109 public int getState()
110 {
111 return state;
112 }
113 }