public void beforeLifecycleExecute(FacesContext facesContext)
507550
public void decode(FacesContext facesContext)
    {
        if (facesContext.isPostback())
        {
            // In postback, we can safely ignore the query param, because it is not useful
            if (getId() == null)
            {
                 setId(calculateWindowIdFromPost(facesContext));
            }
        }

        if (!isClientSideWindowHandlerRequest(facesContext))
        {
            return;
        }
        
        ExternalContext externalContext = facesContext.getExternalContext();

        if (isNoscriptRequest(externalContext))
        {
            // the client has JavaScript disabled
            clientConfig.setJavaScriptEnabled(false);
            return;
        }

        String windowId = getWindowIdFromCookie(externalContext);
        if (windowId == null)
        {
            // GET request without windowId - send windowhandlerfilter.html to get the windowId
            sendWindowHandlerHtml(facesContext, null);
            facesContext.responseComplete();
        }
        else
        {
            if (AUTOMATED_ENTRY_POINT_PARAMETER_KEY.equals(windowId) ||
                (!windowContextConfig.isUnknownWindowIdsAllowed() /*&&
                 !ConversationUtils.isWindowActive(this.windowContextManager, windowId)*/))
            {
                // no or invalid windowId --> create new one
                // don't use createWindowId() the following call will ensure the max. window context count,...
                //windowId = this.windowContextManager.getCurrentWindowContext().getId();
                windowId = createWindowId(facesContext);

                // GET request with NEW windowId - send windowhandlerfilter.html to set and re-get the windowId
                sendWindowHandlerHtml(facesContext, windowId);
                facesContext.responseComplete();
            }
            else
            {
                // we have a valid windowId - set it and continue with the request
                // TODO only set internally and provide via restoreWindowId()? 
                //externalContext.getRequestMap().put(WINDOW_CONTEXT_ID_PARAMETER_KEY, windowId);
                setId(windowId);
            }
        }
    }
613710
public void beforeCompletion()
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "beforeCompletion");
        becomePreparing(); // Change the state to PREPARRING
        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "beforeCompletion");
    }
1073044
@Override
    public final synchronized void beforeCompletion()
                    throws RemoteException
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "beforeCompletion: " + StateStrs[state]);

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

        switch (state)
        {
        // These are the "normal" commit points
            case TX_METHOD_READY:

                setState(COMMITTING_OUTSIDE_METHOD);

                // Session Synchronization BeforeCompletion needs to be called if either
                // the annotation (or XML) was specified or the bean implemented
                // the interface and a global transaction is active.        F743-25855
                if (ivBeforeCompletion != null || sessionSync != null)
                {
                    ContainerTx tx = container.getActiveContainerTx();

                    // SessionSynchronization beforeCompletion is only called for
                    // global transactions that are NOT being rolledback... and
                    // it is skipped if a remove method (@Remove) was called.    390657
                    if ((tx != null) &&
                        (tx.isTransactionGlobal()) &&
                        (!tx.getRollbackOnly()) &&
                        (tx.ivRemoveBeanO != this)) // 390657
                    {
                        EJBThreadData threadData = EJSContainer.getThreadData();

                        threadData.pushContexts(this);
                        try
                        {
                            if (ivBeforeCompletion != null) {
                                invokeSessionSynchMethod(ivBeforeCompletion, null);
                            } else {
                                sessionSync.beforeCompletion();
                            }
                        } finally
                        {
                            threadData.popContexts();
                        }
                    }
                }

                break;

            // Could happen during async rollback (i.e. a second thread is
            // rolling back the tran, as the current thread is committing it.
            case IN_METHOD:
            case METHOD_READY:
            case AFTER_COMPLETION: // d159152
            case DESTROYED:
                if (isTraceOn && tc.isEntryEnabled())
                    Tr.exit(tc, "beforeCompletion: asynch rollback: " + getStateName(state));
                return;

            default:

                throw new InvalidBeanOStateException(getStateName(state),
                                "TX_METHOD_READY | TX_IN_METHOD | " +
                                                "METHOD_READY | DESTROYED");

        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "beforeCompletion: " + getStateName(state));
    }
1260339
def execute_before_feature_steps(self, context):
        
        self.__execute_steps_by_action(context, ACTIONS_BEFORE_FEATURE)

        if context.dyn_env.feature_error:
            # Mark this Feature as skipped. Steps will not be executed.
            context.feature.mark_skipped()
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);
        }
    }
322653
private static void manageLifecycleAnnotation(final Component<?> component, final MultiMap<String, Method> lifecycleMethod, final Class<? extends Annotation> annotationClass) {
        for (final Method method : ClassUtility.getAnnotatedMethods(component.getClass(), annotationClass)) {

            // Add a method to the multimap entry
            // TODO sort
            lifecycleMethod.add(annotationClass.getName(), method);
        }
    }
1292858
public function onBeforeWrite()
    {
        // Publish Icon Images:
        
        if ($this->owner->AppIconSmall()->exists()) {
            $this->owner->AppIconSmall()->publishRecursive();
        }
        
        if ($this->owner->AppIconLarge()->exists()) {
            $this->owner->AppIconLarge()->publishRecursive();
        }
        
        if ($this->owner->AppIconTouch()->exists()) {
            $this->owner->AppIconTouch()->publishRecursive();
        }
    }
173628
protected void beforeLoading()
    {
        if (_listeners != null)
        {
            CollectionProxyListener listener;

            if (_perThreadDescriptorsEnabled) {
                loadProfileIfNeeded();
            }
            for (int idx = _listeners.size() - 1; idx >= 0; idx--)
            {
                listener = (CollectionProxyListener)_listeners.get(idx);
                listener.beforeLoading(this);
            }
        }
    }
242774
function runBeforeDetach (args, methodMeta) {
    // skip if no beforeDetach methods
    if (!defined(methodMeta.beforeDetach)) {
        return
    }
    // run all functions
    _.each(methodMeta.beforeDetach, method => {
        // call method
        (method)(args, methodMeta.signature, 'beforeDetach')
        // log errors
        .catch(err => {
            // require log client
            if (!defined(methodMeta.logClient)) {
                return
            }
            // log error
            methodMeta.logClient.error(err, args.session)
        })
    })
}
907008
private void prepareForReuse(boolean reuse)
    {
        if(reuse)
        {
            // using clone to avoid ConcurentModificationException
            Iterator iter = ((List) mvOrderOfIds.clone()).iterator();
            while(iter.hasNext())
            {
                ObjectEnvelope mod = (ObjectEnvelope) mhtObjectEnvelopes.get(iter.next());
                if(!needsCommit || (mod.getModificationState() == StateOldClean.getInstance()
                        || mod.getModificationState().isTransient()))
                {
                    // nothing to do
                }
                else
                {
                    mod.setModificationState(mod.getModificationState().markClean());
                }
            }
        }
    }
363018
@Override
    public void beforeEach(final ExtensionContext context) {
        Set<Object> testInstances = new LinkedHashSet<>();
        testInstances.add(context.getRequiredTestInstance());

        this.collectParentTestInstances(context, testInstances);

        Strictness actualStrictness = this.retrieveAnnotationFromTestClasses(context)
            .map(MockitoSettings::strictness)
            .orElse(strictness);

        MockitoSession session = Mockito.mockitoSession()
            .initMocks(testInstances.toArray())
            .strictness(actualStrictness)
            .logger(new MockitoSessionLoggerAdapter(Plugins.getMockitoLogger()))
            .startMocking();

        context.getStore(MOCKITO).put(SESSION, session);
    }
1340790
private void doStart() throws LifecycleException {
        tomcat.getServer().addLifecycleListener(new TomcatLifecycleListener());
        logger.info("Deploying application to [" + getConfig().getDeployUrl() + "]");
        tomcat.start();

        // Let's set the port that was used to actually start the application if necessary
        if (getConfig().getPort() == EmbedVaadinConfig.DEFAULT_PORT) {
            getConfig().setPort(getTomcat().getConnector().getLocalPort());
        }

        logger.info("Application has been deployed to [" + getConfig().getDeployUrl() + "]");
        if (config.shouldOpenBrowser()) {
            BrowserUtils.openBrowser(getConfig().getOpenBrowserUrl());
        }
        if (isWaiting()) {
            tomcat.getServer().await();
        }
    }
642131
public void execute(@Observes ExecuteWarp event, HttpServletRequest request, HttpServletResponse response,
        FilterChain filterChain, RequestPayload requestPayload, ResponsePayload responsePayload) throws Throwable {

        List<Inspection> inspections = requestPayload.getInspections();

        try {
            lifecycleManager.get().bindTo(ServletRequest.class, request);
            inspectionRegistry.get().registerInspections(inspections);

            warpLifecycleStarted.fire(new WarpLifecycleStarted());
            lifecycleManager.get().fireEvent(new BeforeServlet());

            filterChain.doFilter(request, response);

            lifecycleManager.get().fireEvent(new AfterServlet());

            responsePayload.setInspections(inspections);
        } finally {
            warpLifecycleFinished.fire(new WarpLifecycleFinished());

            inspectionRegistry.get().unregisterInspections(inspections);

            lifecycleManager.get().unbindFrom(ServletRequest.class, request);
        }
    }
307368
function() {
    var inst = this._instance;

    if (inst.componentWillUnmount) {
      var previouslyUnmounting = ReactLifeCycle.currentlyUnmountingInstance;
      ReactLifeCycle.currentlyUnmountingInstance = this;
      try {
        inst.componentWillUnmount();
      } finally {
        ReactLifeCycle.currentlyUnmountingInstance = previouslyUnmounting;
      }
    }

    ReactReconciler.unmountComponent(this._renderedComponent);
    this._renderedComponent = null;

    // Reset pending fields
    this._pendingStateQueue = null;
    this._pendingReplaceState = false;
    this._pendingForceUpdate = false;
    this._pendingCallbacks = null;
    this._pendingElement = null;

    // These fields do not really need to be reset since this object is no
    // longer accessible.
    this._context = null;
    this._rootNodeID = null;

    // Delete the reference from the instance to this internal representation
    // which allow the internals to be properly cleaned up even if the user
    // leaks a reference to the public instance.
    ReactInstanceMap.remove(inst);

    // Some existing components rely on inst.props even after they've been
    // destroyed (in event handlers).
    // TODO: inst.props = null;
    // TODO: inst.state = null;
    // TODO: inst.context = null;
  }
1119719
public static void registerLifeCycleObserver(@NonNull Application application, @NonNull LifecycleListener listener) {
        application.registerActivityLifecycleCallbacks(new LifeCycleController(listener).createLifecycleCallback());
    }
105803
public void setOnCreate(java.util.Collection<NotebookInstanceLifecycleHook> onCreate) {
        if (onCreate == null) {
            this.onCreate = null;
            return;
        }

        this.onCreate = new java.util.ArrayList<NotebookInstanceLifecycleHook>(onCreate);
    }
217239
@Before()
    public void beforeScenario(Scenario scenario) {
        getContext().setHar(HarContext.getInstance().getServer().newHar(scenario.getName()));
    }