Author: richard_opalka
Date: 2007-08-14 05:45:44 -0400 (Tue, 14 Aug 2007)
New Revision: 4353
Modified:
container/jboss40/trunk/src/main/java/org/jboss/wsf/container/jboss40/ModifyWebMetaDataDeploymentAspect.java
Log:
[JBWS-1762] fix of the issue for jboss40 integration layer
Modified:
container/jboss40/trunk/src/main/java/org/jboss/wsf/container/jboss40/ModifyWebMetaDataDeploymentAspect.java
===================================================================
---
container/jboss40/trunk/src/main/java/org/jboss/wsf/container/jboss40/ModifyWebMetaDataDeploymentAspect.java 2007-08-14
08:50:50 UTC (rev 4352)
+++
container/jboss40/trunk/src/main/java/org/jboss/wsf/container/jboss40/ModifyWebMetaDataDeploymentAspect.java 2007-08-14
09:45:44 UTC (rev 4353)
@@ -23,6 +23,12 @@
//$Id: ModifyWebMetaDataDeployer.java 3772 2007-07-01 19:29:13Z thomas.diesler(a)jboss.com
$
+import java.io.File;
+import java.io.FileInputStream;
+import java.net.URL;
+
+import javax.xml.ws.WebServiceException;
+
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -61,4 +67,36 @@
}
}
}
+
+ public void destroy(Deployment dep)
+ {
+ URL warURL = (URL)dep.getProperty("org.jboss.ws.webapp.url");
+ File warFile = new File(warURL.getFile());
+ if (warFile.isDirectory() == false)
+ throw new WebServiceException("Expected a war directory: " + warURL);
+
+ File webXML = new File(warURL.getFile() + "/WEB-INF/web.xml");
+ if (webXML.isFile() == false)
+ throw new WebServiceException("Cannot find web.xml: " + webXML);
+
+ try
+ {
+ // On destroy remove the modified web.xml and rollback
web.xml.org to web.xml
+ File orgWebXML = new File(webXML.getCanonicalPath() + ".org");
+ webXML.delete();
+
+ // Rename the
web.xml.org
+ if (orgWebXML.renameTo(webXML) == false)
+ throw new WebServiceException("Cannot rename web.xml: " +
orgWebXML);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WebServiceException(e);
+ }
+ }
+
}
\ No newline at end of file