Coverage Report - org.mule.module.launcher.DeploymentStatusTracker
 
Classes in this File Line Coverage Branch Coverage Complexity
DeploymentStatusTracker
0%
0/9
N/A
0
DeploymentStatusTracker$DeploymentState
0%
0/4
N/A
0
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 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  
  * Keeps track of the deployment status of all applications in the Mule instance.
 15  
  */
 16  0
 public class DeploymentStatusTracker implements DeploymentListener
 17  
 {
 18  
 
 19  0
     public static enum DeploymentState
 20  
     {
 21  
         // The deployment is in progress
 22  0
         DEPLOYING,
 23  
         // The deployment was finished with a failure
 24  0
         FAILED,
 25  
         // The deployment was successfully finished
 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  
 }