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 public class DeploymentStatusTracker implements DeploymentListener
17 {
18
19 public static enum DeploymentState
20 {
21
22 DEPLOYING,
23
24 FAILED,
25
26 DEPLOYED
27 }
28
29 protected Map<String, DeploymentState> deploymentStates = new ConcurrentHashMap<String, DeploymentState>();
30
31 public Map<String, DeploymentState> getDeploymentStates()
32 {
33 return Collections.unmodifiableMap(deploymentStates);
34 }
35
36 public void onDeploymentStart(String appName)
37 {
38 deploymentStates.put(appName, DeploymentState.DEPLOYING);
39 }
40
41 public void onDeploymentSuccess(String appName)
42 {
43 deploymentStates.put(appName, DeploymentState.DEPLOYED);
44 }
45
46 public void onDeploymentFailure(String appName, Throwable failureCause)
47 {
48 deploymentStates.put(appName, DeploymentState.FAILED);
49 }
50
51 }