Package com.espertech.esper.epl.variable

Examples of com.espertech.esper.epl.variable.VariableMetaData


            {
                // expected
            }
        }

        VariableMetaData variableMetadata = validationContext.getVariableService().getVariableMetaData(variableName);
        if (variableMetadata == null) {
            throw new ExprValidationException("Failed to find variable by name '" + variableName + "'");
        }
        isPrimitive = variableMetadata.getEventType() == null;
        variableType = variableMetadata.getType();
        if (optSubPropName != null) {
            if (variableMetadata.getEventType() == null) {
                throw new ExprValidationException("Property '" + optSubPropName + "' is not valid for variable '" + variableName + "'");
            }
            eventTypeGetter = variableMetadata.getEventType().getGetter(optSubPropName);
            if (eventTypeGetter == null) {
                throw new ExprValidationException("Property '" + optSubPropName + "' is not valid for variable '" + variableName + "'");
            }
            variableType = variableMetadata.getEventType().getPropertyType(optSubPropName);
        }

        readersPerCp = validationContext.getVariableService().getReadersPerCP(variableName);
        if (variableMetadata.getContextPartitionName() == null) {
            readerNonCP = readersPerCp.get(VariableService.NOCONTEXT_AGENTINSTANCEID);
        }
    }
View Full Code Here


            if (indexDot != -1)
            {
                String stream = prop.getPropertyName().substring(0, indexDot);
                String property = prop.getPropertyName().substring(indexDot + 1, prop.getPropertyName().length());

                VariableMetaData variableMetaData = mapContext.getVariableService().getVariableMetaData(stream);
                if (variableMetaData != null)
                {
                    mapContext.setHasVariables(true);
                    ExprVariableNodeImpl node = new ExprVariableNodeImpl(variableMetaData, property);
                    mapContext.getVariableNames().add(variableMetaData.getVariableName());
                    String message = VariableServiceUtil.checkVariableContextName(mapContext.getContextName(), variableMetaData);
                    if (message != null) {
                        throw new EPException(message);
                    }
                    return node;
                }

                if (mapContext.getContextName() != null) {
                    com.espertech.esper.core.context.util.ContextDescriptor contextDescriptor = mapContext.getContextManagementService().getContextDescriptor(mapContext.getContextName());
                    if (contextDescriptor != null && contextDescriptor.getContextPropertyRegistry().isContextPropertyPrefix(stream)) {
                        return new ExprContextPropertyNode(property);
                    }
                }

                return new ExprIdentNodeImpl(property, stream);
            }

            VariableMetaData variableMetaData = mapContext.getVariableService().getVariableMetaData(prop.getPropertyName());
            if (variableMetaData != null)
            {
                mapContext.setHasVariables(true);
                ExprVariableNodeImpl node = new ExprVariableNodeImpl(variableMetaData, null);
                mapContext.getVariableNames().add(variableMetaData.getVariableName());
                String message = VariableServiceUtil.checkVariableContextName(mapContext.getContextName(), variableMetaData);
                if (message != null) {
                    throw new EPException(message);
                }
                return node;
View Full Code Here

TOP

Related Classes of com.espertech.esper.epl.variable.VariableMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.