Add the current node and all parent identifiers to be used for cache entry tagging

@Flow\Before("method(Neos\Flow\Mvc\Routing\RouterCachingService->extractUuids())")
@param JoinPointInterface $joinPoint The current join point
@return void
545319
public function addCurrentNodeIdentifier(JoinPointInterface $joinPoint)
    {
        $values = $joinPoint->getMethodArgument('values');
        if (!isset($values['node']) || strpos($values['node'], '@') === false) {
            return;
        }

        // Build context explicitly without authorization checks because the security context isn't available yet
        // anyway and any Entity Privilege targeted on Workspace would fail at this point:
        $this->securityContext->withoutAuthorizationChecks(function () use ($joinPoint, $values) {
            $contextPathPieces = NodePaths::explodeContextPath($values['node']);
            $context = $this->contextFactory->create([
                'workspaceName' => $contextPathPieces['workspaceName'],
                'dimensions' => $contextPathPieces['dimensions'],
                'invisibleContentShown' => true
            ]);

            /** @var NodeInterface $node */
            $node = $context->getNode($contextPathPieces['nodePath']);
            if (!$node instanceof NodeInterface) {
                return;
            }

            $values['node-identifier'] = $node->getIdentifier();

            $values['node-parent-identifier'] = [];
            while ($node = $node->getParent()) {
                $values['node-parent-identifier'][] = $node->getIdentifier();
            }
            $joinPoint->setMethodArgument('values', $values);
        });
    }
1265617
private function updateNodes($key, StreamInterface $stream)
    {
        $this->nodeUrls = array_map(function (NodeInfo $element) {
            return $element->getServer();
        }, (new Node($stream, $this->log))->hello());

        $this->log->notice('caching connection info from HELLO', [
            'key' => $key,
            'nodes' => $this->nodeUrls,
            'ttl' => $this->getCacheTtl(),
        ]);

        $this->cache->set($key, $this->nodeUrls, $this->getCacheTtl());
    }
450364
public function validateHttp(JoinPoint $joinPoint)
    {
        $controller = $joinPoint->getTarget();
        $className = BeanFactory::getObjectClass($controller);
        $methodName = $joinPoint->getMethod();

        $annotations = AnnotationManager::getMethodAnnotations($className, $methodName);
        if(isset($annotations[0]))
        {
            $data = ClassObject::convertArgsToKV($className, $methodName, $joinPoint->getArgs());

            $data['$get'] = $controller->request->get();
            $data['$post'] = $controller->request->post();
            $data['$body'] = $controller->request->getParsedBody();
            $data['$headers'] = [];
            foreach ($controller->request->getHeaders() as $name => $values)
            {
                $data['$headers'][$name] = implode(', ', $values);
            }
            $data['$cookie'] = $controller->request->getCookieParams();
            $data['$session'] = Session::get();
            $data['$this'] = $controller;

            $validator = new Validator($data, $annotations);
            if(!$validator->validate())
            {
                $rule = $validator->getFailRule();
                $exception = $rule->exception;
                throw new $exception($validator->getMessage(), $rule->exCode);
            }

            unset($data['$get'], $data['$post'], $data['$body'], $data['$headers'], $data['$cookie'], $data['$session'], $data['$this']);

            $data = array_values($data);
        }
        else
        {
            $data = null;
        }

        $joinPoint->setArgs($data);
    }
112010
protected function setCurrentEndpoint(EndpointInterface $Endpoint)
    {
        if (isset($this->currentEndPoint)){
            unset($this->lastEndPoint);
            $this->lastEndPoint = $this->currentEndPoint;
            unset($this->currentEndPoint);
        }
        $this->currentEndPoint = $Endpoint;
        return $this;
    }
156693
@Override
    @SuppressWarnings("unchecked")
    public Q addJoinFlag(String flag, JoinFlag.Position position) {
        queryMixin.addJoinFlag(new JoinFlag(flag, position));
        return (Q) this;
    }
632837
public function interceptMethodCall(ProceedingJoinPointInterface $jointPoint) {

        if ($this->breaker->isAvailable($this->serviceName)) {
            try {
                $result = $jointPoint->proceed();
                $this->breaker->reportSuccess($this->serviceName);
                return $result;
            } catch (Exception $e) {
                if ($this->isServiceFailureException($e)) {
                    $this->breaker->reportFailure($this->serviceName);
                }else{
                    $this->breaker->reportSuccess($this->serviceName);
                }
                throw $e;
            }
        } else {
            throw $this->throwOnFailure;
        }
    }
566991
public static JoinPoint<Exception> fromSynchronizationPoints(Collection<? extends ISynchronizationPoint<?>> synchPoints) {
		JoinPoint<Exception> jp = new JoinPoint<>();
		for (ISynchronizationPoint<?> sp : synchPoints)
			jp.addToJoin(sp);
		jp.start();
		return jp;
	}
1322595
protected function branchFlowCheck(FlowInterface $flow)
    {
        if (
            // this flow has parent already
            $flow->hasParent() ||
            // adding root flow in itself
            $this->getRootFlow($flow)->getId() === $this->getRootFlow($this)->getId()
        ) {
            throw new NodalFlowException('Cannot reuse Flow within Branches', 1, null, [
                'flowId'             => $this->getId(),
                'BranchFlowId'       => $flow->getId(),
                'BranchFlowParentId' => $flow->hasParent() ? $flow->getParent()->getId() : null,
            ]);
        }
    }
855856
public function addJoinObject(Join $join)
    {
        $isAlreadyAdded = false;
        foreach ($this->joins as $alreadyAddedJoin) {
            if ($join->equals($alreadyAddedJoin)) {
                $isAlreadyAdded = true;
                break;
            }
        }

        if (!$isAlreadyAdded) {
            $this->joins[] = $join;
        }

        return $this;
    }
866776
public function joinMeeting($joinMeetingParams)
    {
        $xml = $this->processXmlResponse($this->getJoinMeetingURL($joinMeetingParams));

        return new JoinMeetingResponse($xml);
    }
943936
public function logResume(JoinPointInterface $joinPoint)
    {
        $session = $joinPoint->getProxy();
        if ($session->isStarted()) {
            $inactivityInSeconds = $joinPoint->getResult();
            if ($inactivityInSeconds === 1) {
                $inactivityMessage = '1 second';
            } elseif ($inactivityInSeconds < 120) {
                $inactivityMessage = sprintf('%s seconds', $inactivityInSeconds);
            } elseif ($inactivityInSeconds < 3600) {
                $inactivityMessage = sprintf('%s minutes', intval($inactivityInSeconds / 60));
            } elseif ($inactivityInSeconds < 7200) {
                $inactivityMessage = 'more than an hour';
            } else {
                $inactivityMessage = sprintf('more than %s hours', intval($inactivityInSeconds / 3600));
            }
            $this->logger->debug(sprintf('%s: Resumed session with id %s which was inactive for %s. (%ss)', $this->getClassName($joinPoint), $joinPoint->getProxy()->getId(), $inactivityMessage, $inactivityInSeconds));
        }
    }
829430
protected function visitSirelNodeJoinSource(Node\JoinSource $joinSource)
    {
        $right = $joinSource->getRight();

        return
            "FROM "
            . $this->visit($joinSource->getLeft())
            . ($right ? ' ' . join(' ', $this->visitEach($right)) : null);
    }
1330608
public function invoke(JoinPointInterface $joinPoint)
    {
        if ($this->runtimeEvaluator !== null && $this->runtimeEvaluator->__invoke($joinPoint, $this->objectManager) === false) {
            return $joinPoint->getAdviceChain()->proceed($joinPoint);
        }

        $adviceObject = $this->objectManager->get($this->aspectObjectName);
        $methodName = $this->adviceMethodName;
        return $adviceObject->$methodName($joinPoint);
    }
274289
public function interceptMethodCall(ProceedingJoinPointInterface $jointPoint) {
        $methodName = $jointPoint->getMethodName();

        // binary & operator
        if (self::LOG_ARGUMENTS & $this->flags) {
            $attachment = $jointPoint->getArguments();
        } else {
            $attachment = null;
        }
        $msg = sprintf("Proxy %s::%s ... ", $this->name, $methodName);
        $this->logger->logDebug($msg, $attachment);

        $startTime = microtime(true);
        $result = $jointPoint->proceed();
        $endTime = microtime(true);

        // binary & operator
        if (self::LOG_RESULT & $this->flags) {
            $attachment = $result;
        } else {
            $attachment = null;
        }
        $msg = sprintf("Proxy %s::%s returned in %.4f; ", $this->name, $methodName, ($endTime - $startTime));
        $this->logger->logDebug($msg, $attachment);

        return $result;
    }
994319
public function forwardSignalToDispatcher(JoinPointInterface $joinPoint)
    {
        $signalName = lcfirst(str_replace('emit', '', $joinPoint->getMethodName()));
        $this->dispatcher->dispatch($joinPoint->getClassName(), $signalName, $joinPoint->getMethodArguments());
    }
1229540
public function parseCacheable(AroundJoinPoint $joinPoint)
    {
        $class = get_parent_class($joinPoint->getTarget());

        // Cacheable 注解
        $cacheable = AnnotationManager::getMethodAnnotations($class, $joinPoint->getMethod(), Cacheable::class)[0] ?? null;

        // 方法参数
        $args = ClassObject::convertArgsToKV($class, $joinPoint->getMethod(), $joinPoint->getArgs());

        // 缓存名
        $name = $cacheable->name;
        if(null === $name)
        {
            $name = Config::get('@currentServer.cache.default');
            if(null === $name)
            {
                throw new \RuntimeException('config "cache.default" not found');
            }
        }

        // 键
        $key = $this->getKey($joinPoint, $args, $cacheable);
        $cacheInstance = CacheManager::getInstance($name);

        // 尝试获取缓存值
        $cacheValue = $cacheInstance->get($key);
        if(null === $cacheValue)
        {
            if(null === $cacheable->lockable)
            {
                // 不加锁
                $nextProceedExeced = true;
                $cacheValue = $joinPoint->proceed();
            }
            else
            {
                // 加锁
                $nextProceedExeced = false;
                $this->parseLockable($joinPoint->getTarget(), $joinPoint->getMethod(), $joinPoint->getArgs(), $cacheable->lockable, function() use(&$cacheValue, $joinPoint, &$nextProceedExeced){
                    $nextProceedExeced = true;
                    $cacheValue = $joinPoint->proceed();
                }, function() use($cacheInstance, $key, &$cacheValue){
                    return $cacheValue = $cacheInstance->get($key);
                });
            }
            if($nextProceedExeced)
            {
                $cacheInstance->set($key, $cacheValue, $cacheable->ttl);
            }
        }

        return $cacheValue;
    }
1145074
@AfterThrowing(pointcut = "execution(* org.apache.cassandra.thrift.CassandraServer.doInsert(..))", throwing = "throwable")
    public void logErrorFromThrownException(final JoinPoint joinPoint, final Throwable throwable) {
        final String className = joinPoint.getTarget().getClass().getName();
        final String methodName = joinPoint.getSignature().getName();

        logger.error("Could not write to cassandra! Method: " + className + "."+ methodName + "()", throwable);
    }