1 22 23 package org.jboss.test.profileservice.simple1; 24 25 import java.io.IOException ; 26 import java.net.URL ; 27 import java.util.Collection ; 28 import java.util.Collections ; 29 import java.util.HashMap ; 30 import java.util.Map ; 31 32 import org.jboss.deployers.spi.structure.DeploymentContext; 33 import org.jboss.profileservice.spi.DeploymentTemplate; 34 import org.jboss.profileservice.spi.NoSuchDeploymentException; 35 import org.jboss.profileservice.spi.Profile; 36 37 44 public class ProfileImpl 45 implements Profile 46 { 47 private HashMap <String , DeploymentContext> deployments; 48 49 public ProfileImpl() throws IOException 50 { 51 deployments = new HashMap <String , DeploymentContext>(); 52 String deployDir = SecurityActions.getSystemProperty("jbosstest.deploy.dir"); 53 URL libURL; 54 if( deployDir == null ) 55 { 56 URL classes = getClass().getProtectionDomain().getCodeSource().getLocation(); 58 libURL = new URL (classes, "../lib/"); 59 } 60 else 61 { 62 libURL = new URL (deployDir); 63 } 64 65 70 101 102 } 103 104 public String getVersion() 105 { 106 return "1.0.0"; 107 } 108 109 public DeploymentTemplate getTemplate(String name) 110 { 111 return null; 112 } 113 114 public void addDeployment(DeploymentContext d) 115 { 116 throw new UnsupportedOperationException ("simple1 is read-only"); 117 } 118 119 public void removeDeployment(String name) 120 { 121 throw new UnsupportedOperationException ("simple1 is read-only"); 122 } 123 124 public Collection <DeploymentContext> getDeployments() 125 { 126 return Collections.unmodifiableCollection(deployments.values()); 127 } 128 129 public Map <String , Object > getConfig() 130 { 131 return null; 132 } 133 134 public DeploymentContext getDeployment(String name) 135 throws NoSuchDeploymentException 136 { 137 DeploymentContext d = deployments.get(name); 138 if( d == null ) 139 throw new NoSuchDeploymentException(name); 140 return d; 141 } 142 143 public void addBootstrap(DeploymentContext d) 144 { 145 throw new org.jboss.util.NotImplementedException("addBootstrap"); 147 } 148 149 public void addDeployer(DeploymentContext d) 150 { 151 throw new org.jboss.util.NotImplementedException("addDeployer"); 153 } 154 155 public DeploymentContext getBootstrap(String name) throws NoSuchDeploymentException 156 { 157 throw new org.jboss.util.NotImplementedException("getBootstrap"); 159 } 160 161 public Collection <DeploymentContext> getBootstraps() 162 { 163 throw new org.jboss.util.NotImplementedException("getBootstraps"); 165 } 166 167 public DeploymentContext getDeployer(String name) throws NoSuchDeploymentException 168 { 169 throw new org.jboss.util.NotImplementedException("getDeployer"); 171 } 172 173 public Collection <DeploymentContext> getDeployers() 174 { 175 throw new org.jboss.util.NotImplementedException("getDeployers"); 177 } 178 179 public void removeBootstrap(String name) 180 { 181 throw new org.jboss.util.NotImplementedException("removeBootstrap"); 183 } 184 185 public void removeDeployer(String name) 186 { 187 throw new org.jboss.util.NotImplementedException("removeDeployer"); 189 } 190 } 191 | Popular Tags |