The preinvoke method is called before all operations on the control.  In addition to
providing a basic hook for logging, context initialization, resource management,
and other common services, it also provides a hook for interceptors.
348858
protected void preInvoke(Method m, Object [] args, String [] interceptorNames)
        throws InterceptorPivotException
    {
        //
        // If the implementation expects single threaded behavior and our container does
        // not guarantee it, then enforce it locally here
        //
        if (_invokeLock != null)
        {
            try { _invokeLock.acquire(); } catch (InterruptedException ie) { }
        }

        //
        // Process interceptors
        //
        if ( interceptorNames != null )
        {
            for ( String n : interceptorNames )
            {
                Interceptor i = ensureInterceptor( n );
                try
                {
                    i.preInvoke( this, m, args );
                }
                catch (InterceptorPivotException ipe)
                {
                    ipe.setInterceptorName(n);
                    throw ipe;
                }
            }
        }

        Vector<InvokeListener> invokeListeners = getInvokeListeners();
        if (invokeListeners.size() > 0)
        {
            for (InvokeListener listener : invokeListeners)
                listener.preInvoke(m, args);
        }
    }
14252
@Override
    public void interceptSetupMethod(IMethodInvocation invocation) throws Throwable {
        log.fine("before " + invocation.getFeature().getFeatureMethod().getReflection().getName());
        getTestRunner().before(invocation.getTarget(), invocation.getFeature().getFeatureMethod().getReflection(),
            new InvocationExecutor(invocation));
    }
706576
def _init_request_hooks(self):
        
        for method_type in ('pre', 'post'):
            for method in _METHODS:
                event = getattr(self.app, 'on_' + method_type + '_' + method)
                event_hook = getattr(hooks, method_type + '_' + method)
                event += event_hook
256090
public void doInvocationCollaboratorsPreInvoke(IInvocationCollaborator[] webAppInvocationCollaborators, WebComponentMetaData cmd,
                                                 ServletRequest request, ServletResponse response)
  {
    if (webAppInvCollabs != null && !webAppInvCollabs.isEmpty())
    {
      for (WebAppInvocationCollaborator inv : webAppInvCollabs)
      {
        inv.preInvoke(cmd,request,response);
      }
    }
  }
713286
@Override
    public final synchronized Object preInvoke(EJSDeployedSupport s,
                                               ContainerTx tx) // d139352-2
                    throws RemoteException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "preInvoke: " + this);

        switch (state) {
            case METHOD_READY:
                // For BMStatefulBeanO - pre Java EE 1.3 only
                setState(IN_METHOD);
                break;

            case TX_METHOD_READY:
                setState(TX_IN_METHOD);
                break;

            default:
                throw new InvalidBeanOStateException(StateStrs[state], "METHOD_READY | TX_METHOD_READY");
        }

        //------------------------------------------------------------
        // Set isolation level to that associated with method
        // being invoked on this instance, and save current isolation
        // level so it may be restored in postInvoke.
        //------------------------------------------------------------

        int tmp = currentIsolationLevel;
        currentIsolationLevel = s.currentIsolationLevel;
        s.currentIsolationLevel = tmp;

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

        return ivEjbInstance;
    }
450327
public function runBefore() {
        if($this->_beforeController !== null) {
            foreach($this->_beforeController as $hookProvider) {
                $hookProvider->doBefore();
            }
        }
    }
624766
@Override
	public final void invoke() {
		if (index < inters.length)
			inters[index++].intercept(this);
		else if (index++ == inters.length)
			invocation.invoke();
	}
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");
    }
3420
void recordPreparedOperation(final TransactionalProtocolClient.PreparedOperation<ServerTaskExecutor.ServerOperation> preparedOperation) {
        recordPreparedTask(new ServerTaskExecutor.ServerPreparedResponse(preparedOperation));
    }
915473
def trace(self, predicate):
        
        self._handler = predicate
        if self.threading_support is None or self.threading_support:
            self._threading_previous = getattr(threading, '_trace_hook', None)
            threading.settrace(self)
        self._previous = sys.gettrace()
        sys.settrace(self)
        return self
126873
protected void preInvoke(Method m, Object [] args)
    {
        try
        {
            preInvoke(m, args, null);
        }
        catch (InterceptorPivotException ipe)
        {
            //this will never happen because no interceptor is passed.
        }
    }
1282568
def _preloop_hook(self) -> None:
        
        # This runs after cmdloop() acquires self.terminal_lock, which will be locked until the prompt appears.
        # Therefore this is the best place to start the alerter thread since there is no risk of it alerting
        # before the prompt is displayed. You can also start it via a command if its not something that should
        # be running during the entire application. See do_start_alerts().
        self._stop_thread = False

        self._alerter_thread = threading.Thread(name='alerter', target=self._alerter_thread_func)
        self._alerter_thread.start()
538970
def process
      # Invoke before hook and stop if false
      res = @hooks.invoke_hook_events(job_name, :before_perform, *args)
      return false unless res
      # Execute the job
      @hooks.around_hook_events(job_name, :around_perform, *args) do
        # We subtract one to ensure we timeout before beanstalkd does, except if:
        #  a) ttr == 0, to support never timing out
        #  b) ttr == 1, so that we don't accidentally set it to never time out
        #  NB: A ttr of 1 will likely result in race conditions between
        #  Backburner and beanstalkd and should probably be avoided
        timeout_job_after(task.ttr > 1 ? task.ttr - 1 : task.ttr) { job_class.perform(*args) }
      end
      task.delete
      # Invoke after perform hook
      @hooks.invoke_hook_events(job_name, :after_perform, *args)
    rescue => e
      @hooks.invoke_hook_events(job_name, :on_failure, e, *args)
      raise e
    end
854067
@Override
	protected synchronized void beforeStart()
	{
		super.beforeStart();

		((SipStandardContext)context).setJ2EEServer("MSS-Arquillian-7-" + UUID.randomUUID().toString());
		Tomcat.initWebappDefaults(context);
	}
278788
public function _beforeInit()
    {
        $this->pm = $this->add($this->pagemanager_class, $this->pagemanager_options);
        /** @type Controller_PageManager $this->pm */
        $this->pm->parseRequestedURL();
        parent::_beforeInit();
    }
1066271
public final void preMethodInvocation(Method method,Object[] arguments)
    {
        this.logEvent(FaxClientSpiProxyEventType.PRE_EVENT_TYPE,method,arguments,null,null);
    }
363063
public void executeBeforeMethods(final Object obj) {
        // Invoke element only if not parameterized
        if (this.element.getDataProvider() == null) {
            // invoking once the beforeFirstRun-method
            if (!beforeFirstRun) {
                beforeFirstRun = true;

                Method[] beforeFirst = null;
                try {
                    beforeFirst = element.findBeforeFirstRun();
                    if (beforeFirst.length != 0) {
                        checkAndExecuteBeforeAfters(obj, BeforeFirstRun.class, beforeFirst);
                    }
                } catch (final PerfidixMethodCheckException e) {
                    BENCHRES.addException(e);
                }
            }

            // invoking the beforeEachRun-method
            Method[] beforeEach = null;
            try {
                beforeEach = element.findBeforeEachRun();
                if (beforeEach.length != 0) {
                    checkAndExecuteBeforeAfters(obj, BeforeEachRun.class, beforeEach);
                }
            } catch (final PerfidixMethodCheckException e) {
                BENCHRES.addException(e);
            }
        }
    }