/* */ }
/* */
/* */ protected void loadProfile(String name)
/* */ throws Exception
/* */ {
/* 193 */ MainDeployer deployer = getMainDeployer();
/* 194 */ if (deployer == null)
/* 195 */ throw new NullPointerException("MainDeployer has not been set");
/* 196 */ ProfileService ps = getProfileService();
/* 197 */ if (ps == null) {
/* 198 */ throw new NullPointerException("ProfileService has not been set");
/* */ }
/* */
/* 201 */ ProfileKey key = new ProfileKey(name);
/* 202 */ Profile profile = ps.getProfile(key);
/* */
/* 205 */ VFSDeployment first = null;
/* */
/* 208 */ Collection boostraps = profile.getDeployments(ManagedDeployment.DeploymentPhase.BOOTSTRAP);
/* 209 */ for (VFSDeployment d : boostraps)
/* */ {
/* 211 */ deployer.addDeployment(d);
/* 212 */ if (first == null)
/* 213 */ first = d;
/* */ }
/* 215 */ deployer.process();
/* 216 */ deployer.checkComplete();
/* */
/* 218 */ Thread thread = Thread.currentThread();
/* 219 */ ClassLoader old = thread.getContextClassLoader();
/* */
/* 221 */ MainDeployerImpl hack = (MainDeployerImpl)deployer;
/* 222 */ ClassLoader cl = null;
/* 223 */ if (first != null)
/* */ {
/* 225 */ DeploymentContext ctx = hack.getDeploymentContext(first.getName());
/* 226 */ if (ctx != null)
/* 227 */ cl = ctx.getClassLoader();
/* */ }
/* 229 */ if (cl != null) {
/* 230 */ thread.setContextClassLoader(cl);
/* */ }
/* */
/* */ try
/* */ {
/* 235 */ Collection profileDeployers = profile.getDeployments(ManagedDeployment.DeploymentPhase.DEPLOYER);
/* 236 */ for (VFSDeployment d : profileDeployers)
/* 237 */ deployer.addDeployment(d);
/* 238 */ deployer.process();
/* 239 */ deployer.checkComplete();
/* */
/* 242 */ Collection profileDeployments = profile.getDeployments(ManagedDeployment.DeploymentPhase.APPLICATION);
/* 243 */ for (VFSDeployment d : profileDeployments)
/* 244 */ deployer.addDeployment(d);
/* 245 */ deployer.process();
/* 246 */ deployer.checkComplete();
/* */ }
/* */ finally
/* */ {
/* 250 */ thread.setContextClassLoader(old);
/* */ }