You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by da...@apache.org on 2003/08/14 02:02:34 UTC

cvs commit: incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment DeploymentController.java

dain        2003/08/13 17:02:34

  Modified:    modules/core/src/java/org/apache/geronimo/deployment
                        DeploymentController.java
  Log:
  Deployment system now will wait for relationship type to be registered and for related MBeans to be created before attempting to enroll a MBean in a relationship.  This also delays the create callback until all related MBeans have been registered with the MBeanServer and have been enrolled in the relationship.
  
  Revision  Changes    Path
  1.5       +29 -2     incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/DeploymentController.java
  
  Index: DeploymentController.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/DeploymentController.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DeploymentController.java	12 Aug 2003 07:10:15 -0000	1.4
  +++ DeploymentController.java	14 Aug 2003 00:02:34 -0000	1.5
  @@ -256,8 +256,35 @@
   
       private void executePlans() throws DeploymentException {
           while (!plans.isEmpty()) {
  -            ArrayList planList = new ArrayList(plans);
  +            List planList = new ArrayList(plans);
  +
  +            // get all of the runnable plans
  +            List runnablePlans = new ArrayList();
               for (Iterator i = planList.iterator(); i.hasNext();) {
  +                DeploymentPlan plan = (DeploymentPlan) i.next();
  +                try {
  +                    if (plan.canRun()) {
  +                        runnablePlans.add(plan);
  +                    }
  +                } catch (DeploymentException e) {
  +                    // plan threw an exception, which means it is completely not runnable and should be discarded
  +                    log.debug("Plan canRun() threw an exception.  The plan has been discarded: plan=" + plan, e);
  +                    plans.remove(plan);
  +                }
  +            }
  +
  +            if (plans.isEmpty()) {
  +                log.debug("All plans were discarded");
  +                return;
  +            }
  +
  +            if (runnablePlans.isEmpty()) {
  +                log.debug("No plans are runnable");
  +                return;
  +            }
  +
  +            // execute all of the runnable plans
  +            for (Iterator i = runnablePlans.iterator(); i.hasNext();) {
                   DeploymentPlan plan = (DeploymentPlan) i.next();
                   plan.execute();
                   plans.remove(plan);