1 22 package org.jboss.deployers.spi; 23 24 import java.util.Collection ; 25 import java.util.Collections ; 26 import java.util.Map ; 27 import java.util.Set ; 28 import java.util.TreeMap ; 29 import java.util.TreeSet ; 30 import java.io.Serializable ; 31 32 38 public class IncompleteDeployments implements Serializable 39 { 40 41 private static final long serialVersionUID = 1433292979582684692L; 42 43 44 private Map <String , Throwable > deploymentsInError; 45 46 47 private Collection <String > deploymentsMissingDeployer; 48 49 50 private Map <String , Throwable > contextsInError; 51 52 53 private Map <String , Set <MissingDependency>> contextsMissingDependencies; 54 55 63 public IncompleteDeployments(Map <String , Throwable > deploymentsInError, Collection <String > deploymentsMissingDeployer, Map <String , Throwable > contextsInError, Map <String , Set <MissingDependency>> contextsMissingDependencies) 64 { 65 if (deploymentsInError != null && deploymentsInError.isEmpty() == false) 66 { 67 this.deploymentsInError = new TreeMap <String , Throwable >(); 68 this.deploymentsInError.putAll(deploymentsInError); 69 } 70 if (deploymentsMissingDeployer != null && deploymentsMissingDeployer.isEmpty() == false) 71 { 72 this.deploymentsMissingDeployer = new TreeSet <String >(); 73 this.deploymentsMissingDeployer.addAll(deploymentsMissingDeployer); 74 } 75 if (contextsInError != null && contextsInError.isEmpty() == false) 76 { 77 this.contextsInError = new TreeMap <String , Throwable >(); 78 this.contextsInError.putAll(contextsInError); 79 } 80 if (contextsMissingDependencies != null && contextsMissingDependencies.isEmpty() == false) 81 { 82 this.contextsMissingDependencies = new TreeMap <String , Set <MissingDependency>>(); 83 this.contextsMissingDependencies.putAll(contextsMissingDependencies); 84 } 85 } 86 87 92 public boolean isIncomplete() 93 { 94 if (deploymentsInError != null) 95 return true; 96 if (deploymentsMissingDeployer != null ) 97 return true; 98 if (contextsInError != null) 99 return true; 100 if (contextsMissingDependencies != null) 101 return true; 102 return false; 103 } 104 105 110 public Map <String , Throwable > getContextsInError() 111 { 112 if (contextsInError == null) 113 return Collections.emptyMap(); 114 else 115 return Collections.unmodifiableMap(contextsInError); 116 } 117 118 123 public Map <String , Set <MissingDependency>> getContextsMissingDependencies() 124 { 125 if (contextsMissingDependencies == null) 126 return Collections.emptyMap(); 127 else 128 return Collections.unmodifiableMap(contextsMissingDependencies); 129 } 130 131 136 public Map <String , Throwable > getDeploymentsInError() 137 { 138 if (deploymentsInError == null) 139 return Collections.emptyMap(); 140 else 141 return Collections.unmodifiableMap(deploymentsInError); 142 } 143 144 149 public Collection <String > getDeploymentsMissingDeployer() 150 { 151 if (deploymentsMissingDeployer == null) 152 return Collections.emptySet(); 153 else 154 return Collections.unmodifiableCollection(deploymentsMissingDeployer); 155 } 156 } 157 | Popular Tags |