1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.module.launcher; |
8 | |
|
9 | |
import java.util.Collections; |
10 | |
import java.util.Map; |
11 | |
import java.util.concurrent.ConcurrentHashMap; |
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | 0 | public class DeploymentStatusTracker implements DeploymentListener |
17 | |
{ |
18 | |
|
19 | 0 | public static enum DeploymentState |
20 | |
{ |
21 | |
|
22 | 0 | DEPLOYING, |
23 | |
|
24 | 0 | FAILED, |
25 | |
|
26 | 0 | DEPLOYED |
27 | |
} |
28 | |
|
29 | 0 | protected Map<String, DeploymentState> deploymentStates = new ConcurrentHashMap<String, DeploymentState>(); |
30 | |
|
31 | |
public Map<String, DeploymentState> getDeploymentStates() |
32 | |
{ |
33 | 0 | return Collections.unmodifiableMap(deploymentStates); |
34 | |
} |
35 | |
|
36 | |
public void onDeploymentStart(String appName) |
37 | |
{ |
38 | 0 | deploymentStates.put(appName, DeploymentState.DEPLOYING); |
39 | 0 | } |
40 | |
|
41 | |
public void onDeploymentSuccess(String appName) |
42 | |
{ |
43 | 0 | deploymentStates.put(appName, DeploymentState.DEPLOYED); |
44 | 0 | } |
45 | |
|
46 | |
public void onDeploymentFailure(String appName, Throwable failureCause) |
47 | |
{ |
48 | 0 | deploymentStates.put(appName, DeploymentState.FAILED); |
49 | 0 | } |
50 | |
|
51 | |
} |