User: starksm 
  Date: 01/05/09 10:00:00

  Modified:    src/main/org/jboss/web AbstractWebContainer.java
  Log:
  Change the throws clause to just Exception and handle the wrapping to
  a DeploymentException at this level rather than making subclasses do it.
  
  Revision  Changes    Path
  1.2       +27 -12    jboss/src/main/org/jboss/web/AbstractWebContainer.java
  
  Index: AbstractWebContainer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/web/AbstractWebContainer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractWebContainer.java 2001/05/09 07:11:16     1.1
  +++ AbstractWebContainer.java 2001/05/09 17:00:00     1.2
  @@ -42,7 +42,7 @@
   @see #performUndeploy(String)
   
   @author  [EMAIL PROTECTED]
  -@version $Revision: 1.1 $
  +@version $Revision: 1.2 $
   */
   public abstract class AbstractWebContainer extends ServiceMBeanSupport implements 
AbstractWebContainerMBean
   {
  @@ -77,19 +77,23 @@
       */
       public synchronized void deploy(String ctxPath, String warUrl) throws 
DeploymentException
       {
  -        WebApplication warInfo = performDeploy(ctxPath, warUrl);
  -        ClassLoader loader = warInfo.getClassLoader();
  -        Element webApp = warInfo.getWebApp();
  -        Element jbossWeb = warInfo.getJbossWeb();
           try
           {
  +            WebApplication warInfo = performDeploy(ctxPath, warUrl);
  +            ClassLoader loader = warInfo.getClassLoader();
  +            Element webApp = warInfo.getWebApp();
  +            Element jbossWeb = warInfo.getJbossWeb();
               parseWebAppDescriptors(loader, webApp, jbossWeb);
  +            deploymentMap.put(warUrl, warInfo);
           }
  +        catch(DeploymentException e)
  +        {
  +            throw (DeploymentException) e.fillInStackTrace();
  +        }
           catch(Exception e)
           {
  -            throw new DeploymentException("Failed during parseWebAppDescriptors", 
e);
  +            throw new DeploymentException("Error during deploy", e);
           }
  -        deploymentMap.put(warUrl, warInfo);
       }
   
       /** The method called by the deploy() method that must be overriden by
  @@ -102,7 +106,7 @@
           AbstractWebContainer class to setup the JNDI ENC and track the war
           deployment status.
       */
  -    protected abstract WebApplication performDeploy(String ctxPath, String warUrl) 
throws DeploymentException;
  +    protected abstract WebApplication performDeploy(String ctxPath, String warUrl) 
throws Exception;
   
       /** A template pattern implementation of the undeploy() method. This method
        calls the {@link #performUndeploy(String) performUndeploy()} method to
  @@ -111,11 +115,22 @@
       */
       public synchronized void undeploy(String warUrl) throws DeploymentException
       {
  -        performUndeploy(warUrl);
  -        // Remove the web application ENC...
  -        deploymentMap.remove(warUrl);
  +        try
  +        {
  +            performUndeploy(warUrl);
  +            // Remove the web application ENC...
  +            deploymentMap.remove(warUrl);
  +        }
  +        catch(DeploymentException e)
  +        {
  +            throw (DeploymentException) e.fillInStackTrace();
  +        }
  +        catch(Exception e)
  +        {
  +            throw new DeploymentException("Error during deploy", e);
  +        }
       }
  -    protected abstract void performUndeploy(String warUrl) throws 
DeploymentException;
  +    protected abstract void performUndeploy(String warUrl) throws Exception;
       /** See if a war is deployed.
       */
       public boolean isDeployed(String warUrl)
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to