Esempio n. 1
0
        public CodegenExpression Make(
            CodegenMethodScope parent,
            CodegenClassScope classScope)
        {
            // resolve variable at init-time via field
            CodegenExpression variableExpression = ConstantNull();
            if (variableMetaData != null) {
                variableExpression = VariableDeployTimeResolver.MakeVariableField(
                    variableMetaData,
                    classScope,
                    this.GetType());
            }

            CodegenMethod method = parent.MakeChild(
                typeof(OutputConditionPolledCountFactory),
                this.GetType(),
                classScope);
            method.Block
                .DeclareVar<OutputConditionPolledCountFactory>(
                    "factory",
                    NewInstance(typeof(OutputConditionPolledCountFactory)))
                .SetProperty(Ref("factory"), "EventRate", Constant(eventRate))
                .SetProperty(Ref("factory"), "Variable", variableExpression)
                .MethodReturn(Ref("factory"));
            return LocalMethod(method);
        }
        public CodegenExpression Make(
            CodegenMethodScope parent,
            CodegenClassScope classScope)
        {
            CodegenExpression numRowsVariable = ConstantNull();
            if (numRowsVariableMetaData != null) {
                numRowsVariable = VariableDeployTimeResolver.MakeVariableField(
                    numRowsVariableMetaData,
                    classScope,
                    this.GetType());
            }

            CodegenExpression offsetVariable = ConstantNull();
            if (offsetVariableMetaData != null) {
                offsetVariable = VariableDeployTimeResolver.MakeVariableField(
                    offsetVariableMetaData,
                    classScope,
                    this.GetType());
            }

            CodegenMethod method = parent.MakeChild(typeof(RowLimitProcessorFactory), this.GetType(), classScope);
            method.Block
                .DeclareVar<RowLimitProcessorFactory>("factory", NewInstance(typeof(RowLimitProcessorFactory)))
                .SetProperty(Ref("factory"), "NumRowsVariable", numRowsVariable)
                .SetProperty(Ref("factory"), "OffsetVariable", offsetVariable)
                .SetProperty(Ref("factory"), "CurrentRowLimit", Constant(currentRowLimit))
                .SetProperty(Ref("factory"), "CurrentOffset", Constant(currentOffset))
                .MethodReturn(Ref("factory"));
            return LocalMethod(method);
        }
 public CodegenExpressionInstanceField Make(CodegenClassScope classScope)
 {
     CodegenExpression resolve = VariableDeployTimeResolver.MakeResolveVariable(
         variableMetaData,
         EPStatementInitServicesConstants.REF);
     return classScope.AddDefaultFieldUnshared(
         true,
         typeof(AggSvcGroupByReclaimAgedEvalFuncFactoryVariable),
         NewInstance<AggSvcGroupByReclaimAgedEvalFuncFactoryVariable>(resolve));
 }
        public CodegenExpression Make(
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            // resolve variable at init-time via field
            var variableExpression = ConstantNull();
            if (variableMetaData != null) {
                variableExpression =
                    VariableDeployTimeResolver.MakeVariableField(variableMetaData, classScope, GetType());
            }

            var method = parent.MakeChild(typeof(OutputConditionFactory), GetType(), classScope);
            method.Block
                .MethodReturn(
                    ExprDotMethodChain(symbols.GetAddInitSvc(method))
                        .Get(EPStatementInitServicesConstants.RESULTSETPROCESSORHELPERFACTORY)
                        .Add("MakeOutputConditionCount", Constant(eventRate), variableExpression));
            return LocalMethod(method);
        }
 public CodegenExpression Make(
     CodegenMethodScope parent,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     CodegenMethod method = parent.MakeChild(
         typeof(MethodTargetStrategyVariableFactory),
         this.GetType(),
         classScope);
     method.Block
         .DeclareVar<MethodTargetStrategyVariableFactory>(
             "target",
             NewInstance(typeof(MethodTargetStrategyVariableFactory)))
         .SetProperty(
             Ref("target"),
             "Variable",
             VariableDeployTimeResolver.MakeResolveVariable(variableMetaData, symbols.GetAddInitSvc(method)))
         .SetProperty(Ref("target"), "MethodName", Constant(reflectionMethod.Name))
         .SetProperty(Ref("target"), "MethodParameters", Constant(reflectionMethod.GetParameterTypes()))
         .Expression(ExprDotMethodChain(symbols.GetAddInitSvc(method)).Add("AddReadyCallback", Ref("target")))
         .MethodReturn(Ref("target"));
     return LocalMethod(method);
 }
Esempio n. 6
0
        public CodegenExpression Make(
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            if (scheduleCallbackId == -1) {
                throw new IllegalStateException("Schedule callback id not provided");
            }

            var method = parent.MakeChild(typeof(OutputConditionFactory), GetType(), classScope);

            method.Block
                .DeclareVar<OutputConditionExpressionFactory>(
                    "factory",
                    ExprDotMethodChain(symbols.GetAddInitSvc(method))
                        .Get(EPStatementInitServicesConstants.RESULTSETPROCESSORHELPERFACTORY)
                        .Add("MakeOutputConditionExpression"))
                .SetProperty(
                    Ref("factory"),
                    "WhenExpressionNodeEval",
                    ExprNodeUtilityCodegen.CodegenEvaluator(
                        whenExpressionNodeEval.Forge,
                        method,
                        GetType(),
                        classScope))
                .SetProperty(
                    Ref("factory"),
                    "WhenTerminatedExpressionNodeEval",
                    andWhenTerminatedExpressionNodeEval == null
                        ? ConstantNull()
                        : ExprNodeUtilityCodegen.CodegenEvaluator(
                            andWhenTerminatedExpressionNodeEval.Forge,
                            method,
                            GetType(),
                            classScope))
                .SetProperty(Ref("factory"), "IsUsingBuiltinProperties", Constant(isUsingBuiltinProperties))
                .SetProperty(
                    Ref("factory"),
                    "VariableReadWritePackage",
                    variableReadWritePackage == null
                        ? ConstantNull()
                        : variableReadWritePackage.Make(method, symbols, classScope))
                .SetProperty(
                    Ref("factory"),
                    "VariableReadWritePackageAfterTerminated",
                    variableReadWritePackageAfterTerminated == null
                        ? ConstantNull()
                        : variableReadWritePackageAfterTerminated.Make(method, symbols, classScope))
                .SetProperty(
                    Ref("factory"),
                    "Variables",
                    variableNames == null
                        ? ConstantNull()
                        : VariableDeployTimeResolver.MakeResolveVariables(
                            variableNames.Values,
                            symbols.GetAddInitSvc(method)))
                .SetProperty(Ref("factory"), "ScheduleCallbackId", Constant(scheduleCallbackId))
                .Expression(ExprDotMethodChain(symbols.GetAddInitSvc(method)).Add("AddReadyCallback", Ref("factory")))
                .MethodReturn(Ref("factory"));
            return LocalMethod(method);
        }