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