public MethodPollingViewableMeta(
     Type methodProviderClass,
     bool isStaticMethod,
     IDictionary <string, Object> optionalMapType,
     IDictionary <string, Object> optionalOaType,
     Object invocationTarget,
     MethodPollingExecStrategyEnum strategy,
     bool isCollection,
     bool isIterator,
     VariableReader variableReader,
     string variableName,
     EventType eventTypeEventBeanArray,
     ExprNodeScript scriptExpression)
 {
     MethodProviderClass     = methodProviderClass;
     IsStaticMethod          = isStaticMethod;
     OptionalMapType         = optionalMapType;
     OptionalOaType          = optionalOaType;
     InvocationTarget        = invocationTarget;
     Strategy                = strategy;
     IsCollection            = isCollection;
     IsEnumerator            = isIterator;
     VariableReader          = variableReader;
     VariableName            = variableName;
     EventTypeEventBeanArray = eventTypeEventBeanArray;
     ScriptExpression        = scriptExpression;
 }
Exemple #2
0
 public MethodPollingExecStrategyEventBeans(
     EventAdapterService eventAdapterService,
     FastMethod method,
     EventType eventType,
     Object invocationTarget,
     MethodPollingExecStrategyEnum strategy,
     VariableReader variableReader,
     string variableName,
     VariableService variableService)
     : base(eventAdapterService, method, eventType, invocationTarget, strategy, variableReader, variableName, variableService)
 {
 }
Exemple #3
0
 protected MethodPollingExecStrategyBase(
     EventAdapterService eventAdapterService,
     FastMethod method,
     EventType eventType,
     Object invocationTarget,
     MethodPollingExecStrategyEnum strategy,
     VariableReader variableReader,
     String variableName,
     VariableService variableService)
 {
     EventAdapterService = eventAdapterService;
     Method           = method;
     EventType        = eventType;
     InvocationTarget = invocationTarget;
     Strategy         = strategy;
     VariableReader   = variableReader;
     VariableName     = variableName;
     VariableService  = variableService;
 }
 public MethodPollingViewableMeta(
     Type methodProviderClass,
     bool isStaticMethod,
     IDictionary<string, object> optionalMapType,
     IDictionary<string, object> optionalOaType,
     MethodPollingExecStrategyEnum strategy,
     bool isCollection,
     bool isIterator,
     VariableMetaData variable,
     EventType eventTypeEventBeanArray,
     ExprNodeScript scriptExpression)
 {
     MethodProviderClass = methodProviderClass;
     IsStaticMethod = isStaticMethod;
     OptionalMapType = optionalMapType;
     OptionalOaType = optionalOaType;
     Strategy = strategy;
     IsCollection = isCollection;
     IsIterator = isIterator;
     Variable = variable;
     EventTypeEventBeanArray = eventTypeEventBeanArray;
     ScriptExpression = scriptExpression;
 }
Exemple #5
0
 public MethodPollingExecStrategyOAIterator(EventAdapterService eventAdapterService, MethodInfo method, EventType eventType, object invocationTarget, MethodPollingExecStrategyEnum strategy, VariableReader variableReader, string variableName, VariableService variableService)
     : base(eventAdapterService, method, eventType, invocationTarget, strategy, variableReader, variableName, variableService)
 {
 }
        public static Pair<MethodTargetStrategyForge, MethodConversionStrategyForge> Plan(
            MethodPollingViewableMeta metadata,
            MethodInfo targetMethod,
            EventType eventType)
        {
            MethodTargetStrategyForge target = null;
            MethodConversionStrategyForge conversion = null;

            // class-based evaluation
            if (metadata.MethodProviderClass != null) {
                // Construct polling strategy as a method invocation
                MethodPollingExecStrategyEnum strategy = metadata.Strategy;
                VariableMetaData variable = metadata.Variable;
                if (variable == null) {
                    target = new MethodTargetStrategyStaticMethodForge(metadata.MethodProviderClass, targetMethod);
                }
                else {
                    target = new MethodTargetStrategyVariableForge(variable, targetMethod);
                }

                if (metadata.EventTypeEventBeanArray != null) {
                    conversion = new MethodConversionStrategyForge(
                        eventType,
                        typeof(MethodConversionStrategyEventBeans));
                }
                else if (metadata.OptionalMapType != null) {
                    if (targetMethod.ReturnType.IsArray) {
                        conversion = new MethodConversionStrategyForge(
                            eventType,
                            typeof(MethodConversionStrategyArrayMap));
                    }
                    else if (metadata.IsCollection) {
                        conversion = new MethodConversionStrategyForge(
                            eventType,
                            typeof(MethodConversionStrategyCollectionMap));
                    }
                    else if (metadata.IsIterator) {
                        conversion = new MethodConversionStrategyForge(
                            eventType,
                            typeof(MethodConversionStrategyIteratorMap));
                    }
                    else {
                        conversion = new MethodConversionStrategyForge(
                            eventType,
                            typeof(MethodConversionStrategyPlainMap));
                    }
                }
                else if (metadata.OptionalOaType != null) {
                    if (targetMethod.ReturnType == typeof(object[][])) {
                        conversion = new MethodConversionStrategyForge(
                            eventType,
                            typeof(MethodConversionStrategyArrayOA));
                    }
                    else if (metadata.IsCollection) {
                        conversion = new MethodConversionStrategyForge(
                            eventType,
                            typeof(MethodConversionStrategyCollectionOA));
                    }
                    else if (metadata.IsIterator) {
                        conversion = new MethodConversionStrategyForge(
                            eventType,
                            typeof(MethodConversionStrategyIteratorOA));
                    }
                    else {
                        conversion = new MethodConversionStrategyForge(
                            eventType,
                            typeof(MethodConversionStrategyPlainOA));
                    }
                }
                else {
                    if (targetMethod.ReturnType.IsArray) {
                        conversion = new MethodConversionStrategyForge(
                            eventType,
                            typeof(MethodConversionStrategyArrayPONO));
                    }
                    else if (metadata.IsCollection) {
                        conversion = new MethodConversionStrategyForge(
                            eventType,
                            typeof(MethodConversionStrategyCollectionPONO));
                    }
                    else if (metadata.IsIterator) {
                        conversion = new MethodConversionStrategyForge(
                            eventType,
                            typeof(MethodConversionStrategyIteratorPONO));
                    }
                    else {
                        conversion = new MethodConversionStrategyForge(
                            eventType,
                            typeof(MethodConversionStrategyPlainPONO));
                    }
                }
            }
            else {
                target = new MethodTargetStrategyScriptForge(metadata.ScriptExpression);
                conversion = new MethodConversionStrategyForge(eventType, typeof(MethodConversionStrategyScript));
            }

            return new Pair<MethodTargetStrategyForge, MethodConversionStrategyForge>(target, conversion);
        }