Exemplo n.º 1
0
        public ContextControllerFactory Make(ContextControllerFactoryContext factoryContext, ContextDetail detail, IList <FilterSpecCompiled> optFiltersNested)
        {
            ContextControllerFactory factory;

            if (detail is ContextDetailInitiatedTerminated)
            {
                factory = new ContextControllerInitTermFactoryImpl(factoryContext, (ContextDetailInitiatedTerminated)detail);
            }
            else if (detail is ContextDetailPartitioned)
            {
                factory = new ContextControllerPartitionedFactoryImpl(factoryContext, (ContextDetailPartitioned)detail, optFiltersNested);
            }
            else if (detail is ContextDetailCategory)
            {
                factory = new ContextControllerCategoryFactoryImpl(factoryContext, (ContextDetailCategory)detail, optFiltersNested);
            }
            else if (detail is ContextDetailHash)
            {
                factory = new ContextControllerHashFactoryImpl(factoryContext, (ContextDetailHash)detail, optFiltersNested);
            }
            else
            {
                throw new UnsupportedOperationException("Context detail " + detail + " is not yet supported in a nested context");
            }

            return(factory);
        }
Exemplo n.º 2
0
        public ContextControllerInitTerm(int pathId, ContextControllerLifecycleCallback lifecycleCallback, ContextControllerInitTermFactoryImpl factory)
        {
            _pathId            = pathId;
            ActivationCallback = lifecycleCallback;
            _factory           = factory;

            var contextDetail = factory.ContextDetail as ContextDetailInitiatedTerminated;

            if (contextDetail != null && contextDetail.DistinctExpressions != null && contextDetail.DistinctExpressions.Length > 0)
            {
                _distinctContexts   = new Dictionary <Object, EventBean>();
                _distinctEvaluators = ExprNodeUtility.GetEvaluators(contextDetail.DistinctExpressions);
            }
        }