geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/service ServiceDeploymentPlanner.java
Date Sun, 05 Oct 2003 01:37:00 GMT
janb        2003/10/04 18:37:00

  Modified:    modules/kernel/src/java/org/apache/geronimo/kernel/deployment/service
                        ServiceDeploymentPlanner.java
  Log:
  The Service deployer current will undeploy absolutely everything because it
  does not check to see if it is a suitable thing for it to undeploy. This is
  stopping the undeployment of web apps, so I've put in a temporary patch which
  at least checks if the url being deployed is a service xml descriptor. Note
  that this won't work for unpacked service directories, but that is a much harder
  problem to solve and requires more co-operation from the scanner, so I'm leaving
  that as an exercise for the reader to solve :-)
  
  Revision  Changes    Path
  1.2       +17 -1     incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/service/ServiceDeploymentPlanner.java
  
  Index: ServiceDeploymentPlanner.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/service/ServiceDeploymentPlanner.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServiceDeploymentPlanner.java	8 Sep 2003 04:38:34 -0000	1.1
  +++ ServiceDeploymentPlanner.java	5 Oct 2003 01:37:00 -0000	1.2
  @@ -257,7 +257,21 @@
       }
   
       private boolean removeURL(UndeployURL goal, Set goals, Set plans) throws DeploymentException
{
  +       
           URL url = goal.getUrl();
  +       
  +        //TODO: better method of determining whether this deployer should
  +        //handle this undeploy call. This deployer should only handle the undeploy
  +        //if it is something that it would have deployed (ie a service). More context
  +        //information needs to be available to make this decision. For now, just handle
  +        //the case of the unpacked service, just to prevent this deployer from undeploying
everything.
  +        
  +        if (!url.getPath().endsWith("-service.xml")) { 
  +            return false;
  +        }
  +     
  +
  +        
           ObjectName deploymentName = null;
           try {
               deploymentName = new ObjectName("geronimo.deployment:role=DeploymentUnit,type=Service,url="
+ ObjectName.quote(url.toString()));
  @@ -288,12 +302,14 @@
           for (Iterator i = mbeans.iterator(); i.hasNext();) {
               ObjectName name = (ObjectName) i.next();
               destroyPlan.addTask(new DestroyMBeanInstance(server, name));
  +        
           }
   
           destroyPlan.addTask(new DestroyMBeanInstance(server, deploymentName));
           plans.add(destroyPlan);
   
           goals.remove(goal);
  +        
           return true;
       }
   
  
  
  

Mime
View raw message