Event that will start before running the action

@param MbRequest  $mbRequest
@param MbResponse $mbResponse
@param MbAction   $mbAction

@throws MbException
428420
public function beforeActionDispatcher(MbRequest $mbRequest, MbResponse $mbResponse, MbAction $mbAction)
    {
        $className = static::class;
        $methodName = __METHOD__;
        throw new MbException("{$methodName} not allowed in! {$className}.");
    }
1326898
private function triggerActionEvent($instance, $action, $type = 'before')
    {
        if (method_exists($instance, $type . ucfirst($action))) {
            call_user_func([$instance, $type . ucfirst($action)]);
        }
    }
1110742
protected function handle(EchoRequest $request, Pbjx $pbjx): EchoResponse
    {
        return EchoResponseV1::create()->set('msg', $request->get('msg'));
    }
322578
public function execute(Framework $framework, RequestAbstract $request, Response $response)
    {
        $response->setOutputPart('404', 'The requested route is not available. We can\'t execute the request. Route: "' . $request->getRoute() . '"');
    }
786188
public void processEvent(QueryBatch batch) {
    if ( ! (batch.getClient() instanceof DatabaseClientImpl) ) {
      throw new IllegalStateException("DatabaseClient must be instanceof DatabaseClientImpl");
    }
    StringHandle uris = new StringHandle(String.join("\n", batch.getItems()))
      .withMimetype("text/uri-list");
    RESTServices services = ((DatabaseClientImpl) batch.getClient()).getServices();
    try {
      RequestParameters params = new RequestParameters();
      if ( transform != null ) transform.merge(params);
      params.add("result", applyResult.toString().toLowerCase());
      List<String> responseUris = new BufferedReader(
        services.postResource(null, "internal/apply-transform", null, params, uris, new ReaderHandle()).get()
      ).lines().collect(Collectors.toList());
      QueryBatchImpl processedBatch = new QueryBatchImpl()
        .withClient( batch.getClient() )
        .withItems( responseUris.toArray(new String[responseUris.size()]) )
        .withTimestamp( batch.getTimestamp() )
        .withJobBatchNumber( batch.getJobBatchNumber() )
        .withJobResultsSoFar( batch.getJobResultsSoFar() )
        .withForestBatchNumber( batch.getForestBatchNumber() )
        .withForestResultsSoFar( batch.getForestResultsSoFar() )
        .withForest( batch.getForest() )
        .withServerTimestamp( batch.getServerTimestamp() )
        .withJobTicket( batch.getJobTicket() );
      for ( QueryBatchListener listener : successListeners ) {
        try {
          listener.processEvent(processedBatch);
        } catch (Throwable t) {
          logger.error("Exception thrown by an onSuccess listener", t);
        }
      }

      List<String> skippedRequestUris = new ArrayList<>(Arrays.asList(batch.getItems()));
      skippedRequestUris.removeAll( responseUris );
      if ( skippedRequestUris.size() > 0 ) {
        QueryBatchImpl skippedBatch = processedBatch
          .withItems( skippedRequestUris.toArray(new String[0]) );
        for ( QueryBatchListener listener : skippedListeners ) {
          try {
            listener.processEvent(skippedBatch);
          } catch (Throwable t) {
            logger.error("Exception thrown by an onSkipped listener", t);
          }
        }
      }
    } catch (Throwable t) {
      for ( BatchFailureListener<Batch<String>> listener : failureListeners ) {
        try {
          listener.processFailure(batch, t);
        } catch (Throwable t2) {
          logger.error("Exception thrown by an onBatchFailure listener", t2);
        }
      }
      for ( BatchFailureListener<QueryBatch> queryBatchFailureListener : queryBatchFailureListeners ) {
        try {
          queryBatchFailureListener.processFailure(batch, t);
        } catch (Throwable t2) {
          logger.error("Exception thrown by an onFailure listener", t2);
        }
      }
      logger.warn("Error: {} in batch with urs ({})", t.toString(),
        Arrays.asList(batch.getItems()));
    }
  }
584504
public void executeBatchAsync(BatchOperation batchOperation, CallbackHandler callbackHandler) throws FMSException {

        IntuitMessage intuitMessage = prepareBatch(batchOperation);

        //set callback handler
        intuitMessage.getRequestElements().setCallbackHandler(callbackHandler);

        //execute async interceptors
        executeAsyncInterceptors(intuitMessage);
    }
1116008
function createEvent(params, cb) {
  params.resourcePath = config.addURIParams(constants.EVENTS_BASE_PATH, params);
  params.method = 'POST';
  params.data = params.data || {};
  mbaasRequest.admin(params, cb);
}
239204
public function onKernelResponse(FilterResponseEvent $event)
    {
        if ($this->mustLog) {

            /**
             * Only logs before controller execution if EXEC_POST or EXEC_BOTH.
             */
            if (in_array($this->execute, [AnnotationLog::EXEC_POST, AnnotationLog::EXEC_BOTH])) {
                $this->logMessage(
                    $this->logger,
                    $this->level,
                    $this->value
                );
            }
        }
    }
1174644
@SuppressWarnings("unchecked")
    private void prepareKarafRbacInvocations(String fullName, Map<String, Object> mBeanInfo,
                                             Map<String, List<String>> queryForMBeans,
                                             Map<String, List<String>> queryForMBeanOperations) {
        queryForMBeans.put(fullName, new ArrayList<>());
        List<String> operations = operations((Map<String, Object>) mBeanInfo.get("op"));
        // prepare opByString for MBeainInfo
        Map<String, Map<String, Object>> opByString = new HashMap<>();
        mBeanInfo.put("opByString", opByString);
        if (operations.isEmpty()) {
            return;
        }

        queryForMBeanOperations.put(fullName, operations);
        for (String op : operations) {
            // ! no need to copy relevant map for "op['opname']" - hawtio uses only 'canInvoke' property
            opByString.put(op, new HashMap<>());
        }
    }
1166925
public function execute(Framework $framework, WebRequest $request, Response $response)
    {
        // Prepare the page
        $this->setTitle($this->translate('Profile', '\\Zepi\\Web\\AccessControl'));
        $menuEntry = $this->activateMenuEntry();
        
        $overviewPage = $this->getOverviewPageRenderer()->render($framework, $menuEntry);
        
        // Display logout message
        $response->setOutput($this->render('\\Zepi\\Web\\AccessControl\\Templates\\Profile', array(
            'overviewPage' => $overviewPage
        )));
    }
434208
public function onKernelResponse(FilterResponseEvent $event): void
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $blockView = $event->getRequest()->attributes->get('ngbmView');
        if (!$blockView instanceof BlockViewInterface) {
            return;
        }

        $this->tagger->tagBlock($event->getResponse(), $blockView->getBlock());
    }
980549
public function onKernelRequest(GetResponseEvent $event): void
    {
        if ('sonata_admin_dashboard' === $event->getRequest()->get('_route')) {
            $modelManager = $this->admin->getModelManager();

            $defaultDashboard = $modelManager->findOneBy($this->admin->getClass(), [
                'default' => true,
                'enabled' => true,
            ]);

            if ($defaultDashboard) {
                $url = $this->admin->generateObjectUrl('render', $defaultDashboard, ['default' => true]);
                $event->setResponse(new RedirectResponse($url));
            }
        }
    }
1307104
public function onKernelResponse(FilterResponseEvent $event): void
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $layoutView = $event->getRequest()->attributes->get(
            $this->isExceptionResponse ?
                'ngbmExceptionLayoutView' :
                'ngbmLayoutView'
        );

        if (!$layoutView instanceof LayoutViewInterface) {
            return;
        }

        $this->tagger->tagLayout($event->getResponse(), $layoutView->getLayout());
    }
265177
function onMvcErrorInjectResponse($e)
    {
        // Do nothing if no error in the event
        $error = $e->getError();
        if(empty($error) || !$error instanceof \Exception)
            // We do nothing without Exception
            return;

        if ($e->getResult() instanceof Response)
            $e->setResponse($e->getResult());

        // Set Response Status Code >>>> {
        /** @var \Zend\Http\PhpEnvironment\Response $response */
        $response = $e->getResponse();
        if (!$response) {
            $response = new Response();
            $e->setResponse($response);
        }

        if ($response->getStatusCode() === 200)
            // Change Response Code only if is Success
            $response->setStatusCode(
                $this->__getResponseCodeFromException($error)
            );
        // <<<< }

        $this->error = $error;
    }
850881
public function onKernelRequest(GetResponseEvent $event): void
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $request = $event->getRequest();
        $currentRoute = $request->attributes->get('_route', '');
        if (mb_stripos($currentRoute, self::ADMIN_ROUTE_PREFIX) !== 0) {
            return;
        }

        $request->attributes->set(self::ADMIN_FLAG_NAME, true);

        $adminEvent = new AdminMatchEvent($event->getRequest(), $event->getRequestType());
        $this->eventDispatcher->dispatch($adminEvent, BlockManagerAdminEvents::ADMIN_MATCH);
    }
53938
public function onKernelRequest(GetResponseEvent $event): void
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $request = $event->getRequest();
        if ($request->attributes->has('ngbmContext')) {
            $context = $request->attributes->get('ngbmContext');
            $context = is_array($context) ? $context : [];

            $this->context->add($context);

            return;
        }

        if ($request->query->has('ngbmContext')) {
            $this->context->add($this->getUriContext($request));

            return;
        }

        $this->contextBuilder->buildContext($this->context);
    }
848164
static void sendResponse(final ManagementRequestContext<ExecuteRequestContext> context, final byte responseType, final ModelNode response) throws IOException {

        // WFLY-3090 Protect the communication channel from getting closed due to administrative
        // cancellation of the management op by using a separate thread to send
        final CountDownLatch latch = new CountDownLatch(1);
        final IOExceptionHolder exceptionHolder = new IOExceptionHolder();
        boolean accepted = context.executeAsync(new AsyncTask<TransactionalProtocolOperationHandler.ExecuteRequestContext>() {

            @Override
            public void execute(final ManagementRequestContext<ExecuteRequestContext> context) throws Exception {
                FlushableDataOutput output = null;
                try {
                    MGMT_OP_LOGGER.tracef("Transmitting response for %d", context.getOperationId());
                    final ManagementResponseHeader header = ManagementResponseHeader.create(context.getRequestHeader());
                    output = context.writeMessage(header);
                    // response type
                    output.writeByte(responseType);
                    // operation result
                    response.writeExternal(output);
                    // response end
                    output.writeByte(ManagementProtocol.RESPONSE_END);
                    output.close();
                } catch (IOException toCache) {
                    exceptionHolder.exception = toCache;
                } finally {
                    StreamUtils.safeClose(output);
                    latch.countDown();
                }
            }
        }, false);
        if (accepted) {
            try {
                latch.await();
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
            if (exceptionHolder.exception != null) {
                throw exceptionHolder.exception;
            }
        }
    }