1 22 package org.jboss.system.server.profile.basic; 23 24 import java.io.File ; 25 import java.util.Collection ; 26 import java.util.Collections ; 27 import java.util.LinkedHashMap ; 28 import java.util.Map ; 29 30 import org.jboss.deployers.spi.structure.DeploymentContext; 31 import org.jboss.profileservice.spi.DeploymentTemplate; 32 import org.jboss.profileservice.spi.NoSuchDeploymentException; 33 import org.jboss.profileservice.spi.Profile; 34 import org.jboss.util.JBossObject; 35 36 46 public class ProfileImpl extends JBossObject 47 implements Profile 48 { 49 private String name; 50 51 private File profileRoot; 52 private LinkedHashMap <String ,DeploymentContext> bootstraps = new LinkedHashMap <String ,DeploymentContext>(); 53 private LinkedHashMap <String ,DeploymentContext> deployments = new LinkedHashMap <String ,DeploymentContext>(); 54 private LinkedHashMap <String ,DeploymentContext> deployers = new LinkedHashMap <String ,DeploymentContext>(); 55 56 public ProfileImpl(String profileRoot, String name) 57 { 58 this.name = name; 59 this.profileRoot = new File (profileRoot); 60 log.info("Using profile root:"+this.profileRoot.getAbsolutePath()); 61 } 62 63 public String getName() 64 { 65 return name; 66 } 67 68 public String getVersion() 69 { 70 return null; 72 } 73 74 public void addBootstrap(DeploymentContext d) 75 { 76 bootstraps.put(d.getName(), d); 77 } 78 79 public void removeBootstrap(String name) 80 { 81 bootstraps.remove(name); 82 } 83 84 public DeploymentContext getBootstrap(String name) throws NoSuchDeploymentException 85 { 86 DeploymentContext deployment = bootstraps.get(name); 87 return deployment; 88 } 89 90 public Collection <DeploymentContext> getBootstraps() 91 { 92 return Collections.unmodifiableCollection(bootstraps.values()); 93 } 94 95 public void addDeployer(DeploymentContext d) 96 { 97 deployers.put(d.getName(), d); 98 } 99 100 public void removeDeployer(String name) 101 { 102 deployers.remove(name); 103 } 104 105 public DeploymentContext getDeployer(String name) throws NoSuchDeploymentException 106 { 107 DeploymentContext deployment = deployers.get(name); 108 return deployment; 109 } 110 111 public Collection <DeploymentContext> getDeployers() 112 { 113 return Collections.unmodifiableCollection(deployers.values()); 114 } 115 116 public DeploymentTemplate getTemplate(String name) 117 throws NoSuchDeploymentException 118 { 119 return null; 121 } 122 123 public void addDeployment(DeploymentContext d) 124 { 125 deployments.put(d.getName(), d); 126 } 127 128 public void removeDeployment(String name) 129 { 130 deployments.remove(name); 131 } 132 133 public DeploymentContext getDeployment(String name) 134 throws NoSuchDeploymentException 135 { 136 DeploymentContext deployment = deployments.get(name); 137 return deployment; 138 } 139 140 public Collection <DeploymentContext> getDeployments() 141 { 142 return Collections.unmodifiableCollection(deployments.values()); 143 } 144 145 public Map <String , Object > getConfig() 146 { 147 return null; 149 } 150 } 151 | Popular Tags |