public void applyCompletedPhases(Object object) throws LifecycleException { String lastPhase = NotInLifecyclePhase.PHASE_NAME; for (String phase : completedPhases) { if (isDirectTransition(lastPhase, phase)) { LifecyclePhase lp = phases.get(phase); lp.applyLifecycle(object); lastPhase = phase; } } } }
private boolean isPhaseToPrevent(LifecyclePhase phase) { return phaseToPreventOnTrackingPhaseError.equals(phase.getName()); } }
@Override public void onTransition(String phaseName, T object) throws MuleException { LifecyclePhase phase = registryLifecycleManager.phases.get(phaseName); if (LOGGER.isDebugEnabled()) { LOGGER.debug(String.format("Applying lifecycle phase: %s for registry: %s", phase, object.getClass().getSimpleName())); } if (phase instanceof ContainerManagedLifecyclePhase) { phase.applyLifecycle(object); return; } // overlapping interfaces can cause duplicates // TODO: each LifecycleManager should keep this set per executing phase // and clear it when the phase is fully applied Set<Object> duplicates = new HashSet<>(); for (LifecycleObject lifecycleObject : phase.getOrderedLifecycleObjects()) { lifecycleObject.firePreNotification(registryLifecycleManager.muleContext); // TODO Collection -> List API refactoring Collection<?> targetsObj = lookupObjectsForLifecycle(lifecycleObject); doApplyLifecycle(phase, duplicates, lifecycleObject, targetsObj); lifecycleObject.firePostNotification(registryLifecycleManager.muleContext); } interceptor.onPhaseCompleted(phase); }
LOGGER.debug("lifecycle phase: " + phase.getName() + " for object: " + target); phase.applyLifecycle(target); duplicates.add(target); Optional<Exception> optException = absent(); phase.getName(), LifecycleInterceptor.class.getSimpleName(), interceptor.getClass().getName(), target));
private boolean isTrackingPhase(LifecyclePhase phase) { return trackingPhase.equals(phase.getName()); }
phases.get(phaseName).applyLifecycle(object);