/* */ public synchronized WebApplication start(VFSDeploymentUnit unit, JBossWebMetaData metaData)
/* */ throws Exception
/* */ {
/* 305 */ Thread thread = Thread.currentThread();
/* 306 */ ClassLoader appClassLoader = thread.getContextClassLoader();
/* 307 */ WebApplication webApp = null;
/* */ try
/* */ {
/* 311 */ URL[] empty = new URL[0];
/* 312 */ URLClassLoader warLoader = URLClassLoader.newInstance(empty, unit.getClassLoader());
/* 313 */ thread.setContextClassLoader(warLoader);
/* 314 */ String webContext = metaData.getContextRoot();
/* */
/* 318 */ URL warURL = (URL)unit.getAttachment("org.jboss.web.expandedWarURL", URL.class);
/* 319 */ if (warURL == null)
/* 320 */ warURL = (URL)unit.getAttachment("jbossws.expanded.war.url", URL.class);
/* 321 */ if (warURL == null) {
/* 322 */ warURL = unit.getRoot().toURL();
/* */ }
/* */
/* 325 */ String warURLString = warURL.toString();
/* 326 */ if (warURLString.startsWith("jar:")) {
/* 327 */ warURLString = warURLString.substring(4, warURLString.length() - 2);
/* */ }
/* 329 */ this.log.debug("webContext: " + webContext);
/* 330 */ this.log.debug("warURL: " + warURLString);
/* */
/* 333 */ String contextID = metaData.getJaccContextID();
/* 334 */ if (contextID == null)
/* 335 */ contextID = unit.getSimpleName();
/* 336 */ metaData.setJaccContextID(contextID);
/* */
/* 338 */ webApp = new WebApplication(metaData);
/* 339 */ webApp.setClassLoader(warLoader);
/* 340 */ webApp.setDeploymentUnit(unit);
/* 341 */ performDeploy(webApp, warURLString);
/* */ }
/* */ finally
/* */ {
/* 345 */ thread.setContextClassLoader(appClassLoader);