/*
(non-Javadoc)

@see org.springframework.batch.core.StepExecutionListener#beforeStep(org.
springframework.batch.core.StepExecution)
765853
@Override
    public void beforeStep(StepExecution stepExecution) {
        super.beforeStep(stepExecution);
        try {
            RestoreStatus newStatus = RestoreStatus.TRANSFERRING_TO_DURACLOUD;
            restoreManager.transitionRestoreStatus(restorationId, newStatus, "");
            Space space = this.contentStore.getSpace(destinationSpaceId, null, 1, null);
            if (!CollectionUtils.isEmpty(space.getContentIds())) {
                stepExecution.addFailureException(new RuntimeException("destination space "
                                                                       + destinationSpaceId +
                                                                       " must be empty to receive restored content"));
            }
        } catch (NotFoundException ex) {
            try {
                this.contentStore.createSpace(destinationSpaceId);
            } catch (ContentStoreException e) {
                addError(ex.getMessage());
                stepExecution.addFailureException(e);
            }
        } catch (Exception ex) {
            addError(ex.getMessage());
            stepExecution.addFailureException(ex);
        }
    }
962174
@Override
    public void onBeforeExecutionEvent(BeforeExecutionEvent event) {
        LepManager manager = event.getSource();
        ScopedContext threadContext = manager.getContext(ContextScopes.THREAD);
        if (threadContext == null) {
            throw new IllegalStateException("LEP manager thread context doesn't initialized");
        }

        TenantContext tenantContext = getRequiredValue(threadContext, THREAD_CONTEXT_KEY_TENANT_CONTEXT,
                                                       TenantContext.class);
        XmAuthenticationContext authContext = getRequiredValue(threadContext, THREAD_CONTEXT_KEY_AUTH_CONTEXT,
                                                               XmAuthenticationContext.class);

        ScopedContext executionContext = manager.getContext(ContextScopes.EXECUTION);
        // add contexts
        executionContext.setValue(BINDING_KEY_TENANT_CONTEXT, tenantContext);
        executionContext.setValue(BINDING_KEY_AUTH_CONTEXT, authContext);

        bindExecutionContext(executionContext);
    }
1202435
public void startup(@Observes(precedence = -100) final BeforeSuite event) {
        if (extensionEnabled()) {
            debug("Catching BeforeSuite event {0}", event.toString());
            executeInClassScope(new Callable<Void>() {
                @Override
                public Void call() {
                    generateDeploymentEvent.fire(new GenerateDeployment(new TestClass(deploymentClass)));
                    suiteDeploymentScenario = classDeploymentScenario.get();
                    return null;
                }
            });
            deployDeployments = true;
            extendedSuiteContext.get().activate();
            suiteDeploymentScenarioInstanceProducer.set(suiteDeploymentScenario);
        }
    }
111374
public static void insertBefore(Element newElement, Element before) {
        before.parentNode.insertBefore(newElement, before);
    }
159161
public void nextStep() {
        if (currentStepIndex >= getWidgetCount() - 1) {
            CompleteEvent.fire(MaterialStepper.this, currentStepIndex + 1);
        } else {
            Widget w = getWidget(currentStepIndex);
            if (w instanceof MaterialStep) {
                MaterialStep step = (MaterialStep) w;
                step.setActive(false);

                step.setSuccessText(step.getDescription());

                // next step
                int nextStepIndex = getWidgetIndex(step) + 1;
                if (nextStepIndex >= 0) {
                    for (int i = nextStepIndex; i < getWidgetCount(); i++) {
                        w = getWidget(i);
                        if (!(w instanceof MaterialStep)) {
                            continue;
                        }
                        MaterialStep nextStep = (MaterialStep) w;
                        if (nextStep.isEnabled() && nextStep.isVisible()) {
                            nextStep.setActive(true);
                            setCurrentStepIndex(i);
                            NextEvent.fire(MaterialStepper.this);
                            break;
                        }
                    }
                }
            }
        }
    }
1192501
protected Statement withBeforeClasses(Statement statement) {
        List<FrameworkMethod> befores = testClass
                .getAnnotatedMethods(BeforeClass.class);
        return befores.isEmpty() ? statement :
                new RunBefores(statement, befores, null);
    }
425725
public void beginStep(int step, String stepTitle, Logging logger) {
    setProcessed(step - 1);
    this.stepTitle = stepTitle;
    logger.progress(this);
  }
472931
public void beforeSuite(@Observes BeforeSuite event) {
        try {
            log.debug("Starting Citrus before suite lifecycle");
            citrusInstance.get().beforeSuite(configurationInstance.get().getSuiteName());
        } catch (Exception e) {
            log.error(CitrusExtensionConstants.CITRUS_EXTENSION_ERROR, e);
            throw e;
        }
    }
252946
public void setStepDetails(java.util.Collection<RemediationExecutionStep> stepDetails) {
        if (stepDetails == null) {
            this.stepDetails = null;
            return;
        }

        this.stepDetails = new com.amazonaws.internal.SdkInternalList<RemediationExecutionStep>(stepDetails);
    }
845698
@Override
    public final synchronized void beforeCompletion()
                    throws RemoteException
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "beforeCompletion: " + getStateName(state), currentTx); //123293

        if (removed) {
            if (isTraceOn && tc.isEntryEnabled())
                Tr.exit(tc, "beforeCompletion: removed");
            return;
        }

        switch (state)
        {
            case TX_METHOD_READY:
                setState(COMMITTING_OUTSIDE_METHOD);
                break;

            case TX_IN_METHOD:
                setState(COMMITTING_IN_METHOD);
                break;

            // Could happen during async rollback
            case IN_METHOD:
            case METHOD_READY:
            case DESTROYED:
                if (isTraceOn && tc.isEntryEnabled())
                    Tr.exit(tc, "beforeCompletion: asynch rollback: " + getStateName(state));
                return;

            default:
                if (isTraceOn && tc.isDebugEnabled()) // d144064
                    Tr.debug(tc, "invalid state: " + state); //123293
                throw new InvalidBeanOStateException(StateStrs[state],
                                "TX_IN_METHOD | " +
                                                "TX_METHOD_READY");

        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "beforeCompletion: " + getStateName(state));

    }
1258867
public void setSteps(java.util.Collection<Step> steps) {
        if (steps == null) {
            this.steps = null;
            return;
        }

        this.steps = new java.util.ArrayList<Step>(steps);
    }
1186620
private int getPreviousStep(int currentStep) {
        int prevStep = -1;

        // we find the next available step.
        for (int i = currentStep - 1; i >= STEP_LOGIN; i--) {
            if(isStepEnabled(i)) {
                prevStep = i;
                break;
            }
        }

        return prevStep;
    }
589181
public void previous(final boolean skipSlideStep) {
        synchronized (this) {
            // Try to display the previous slide step first
            // If no slide step is remaining, display the previous slide
            if (skipSlideStep || this.selectedSlideModel.previousStep() && this.slidePosition > 0) {
                this.slidePosition = Math.max(this.slidePosition - 1, 0);
                displaySlide(getPresentationService().getPresentation().getSlides().getSlide().get(this.slidePosition), !skipSlideStep);
            }
        }
    }
1374866
private void onPushLevelProgress(int steps, Object source, boolean singlesteplevel)
    {
        if (this.currentStep.isLevelFinished()) {
            // If current step is done move to next one
            this.currentStep = this.currentStep.getParent().nextStep(null, source);
        }

        // Add level
        this.currentStep = this.currentStep.addLevel(steps, source, singlesteplevel);
    }
99114
@Override
    public ExitStatus afterStep(StepExecution stepExecution) {
        ExitStatus status = stepExecution.getExitStatus();
        return status;
    }
15405
public Before<PartialResponseInsertType<T>> getOrCreateBefore()
   {
      Node node = childNode.getOrCreate("before");
      Before<PartialResponseInsertType<T>> before = new BeforeImpl<PartialResponseInsertType<T>>(this, "before", childNode, node);
      return before;
   }
995979
protected function beforeCreate()
    {
        $this->dispatcher->getEventsManager()->fire(Events::BEFORE_CREATE, $this);
        $this->beforeSave();
    }