private void invokeTypeContributer( DeploymentPlanningContext planContext, Delta delta, Method method) { try { if (method.getParameterTypes().length == 2) { method.invoke(getActiveDeployed(delta), planContext, delta); } else { method.invoke(getActiveDeployed(delta), planContext); } } catch (IllegalAccessException e) { throw new PlannerException(e); } catch (InvocationTargetException e) { handleInvocationTargetException(e); } }
private Plan processPlan(DeltaSpecification spec, List<Method> processors) { InterleavedPlanBuilder builder = newInterleavedPlan(interleaved()); for (Method processor : processors) { try { Object o = processor.getDeclaringClass().newInstance(); addResultingStepToBuilder(processor.invoke(o, spec), builder, processor); } catch (InstantiationException e) { throw new PlannerException(e); } catch (IllegalAccessException e) { throw new PlannerException(e); } catch (InvocationTargetException e) { handleInvocationTargetException(e); } } return builder.build(); }
private void callContributors( Set<Method> methods, InterleavedPlan plan, InterleavedPlanBuilder planBuilder, DeploymentPlanningContext context) { if (methods == null) return; Deltas deltas = new Deltas(plan.getDeltas()); for (Method method : methods) { try { Object contributorInstance = method.getDeclaringClass().newInstance(); method.invoke(contributorInstance, deltas, context); } catch (InstantiationException e) { throw new PlannerException(e); } catch (IllegalAccessException e) { throw new PlannerException(e); } catch (InvocationTargetException e) { handleInvocationTargetException(e); } } }