当前位置: 首页>>代码示例>>Java>>正文


Java EventBeanCopyMethod类代码示例

本文整理汇总了Java中com.espertech.esper.event.EventBeanCopyMethod的典型用法代码示例。如果您正苦于以下问题:Java EventBeanCopyMethod类的具体用法?Java EventBeanCopyMethod怎么用?Java EventBeanCopyMethod使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EventBeanCopyMethod类属于com.espertech.esper.event包,在下文中一共展示了EventBeanCopyMethod类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: InternalEventRouterDesc

import com.espertech.esper.event.EventBeanCopyMethod; //导入依赖的package包/类
public InternalEventRouterDesc(UpdateDesc updateDesc, EventBeanCopyMethod copyMethod, TypeWidener[] wideners, EventType eventType, Annotation[] annotations, EngineImportService engineImportService, String statementName) {
    this.updateDesc = updateDesc;
    this.copyMethod = copyMethod;
    this.wideners = wideners;
    this.eventType = eventType;
    this.annotations = annotations;
    optionalWhereClauseEval = updateDesc.getOptionalWhereClause() == null ? null : ExprNodeCompiler.allocateEvaluator(updateDesc.getOptionalWhereClause().getForge(), engineImportService, this.getClass(), false, statementName);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:InternalEventRouterDesc.java

示例2: InternalEventRouterPreprocessor

import com.espertech.esper.event.EventBeanCopyMethod; //导入依赖的package包/类
/**
 * Ctor.
 *
 * @param copyMethod for copying the events to preprocess
 * @param entries    descriptors for pre-processing to apply
 */
public InternalEventRouterPreprocessor(EventBeanCopyMethod copyMethod, List<InternalEventRouterEntry> entries) {
    this.copyMethod = copyMethod;
    Collections.sort(entries, COMPARATOR);
    this.entries = entries.toArray(new InternalEventRouterEntry[entries.size()]);
    empty = this.entries.length == 0;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:13,代码来源:InternalEventRouterPreprocessor.java

示例3: NamedWindowUpdateHelper

import com.espertech.esper.event.EventBeanCopyMethod; //导入依赖的package包/类
public NamedWindowUpdateHelper(ExprEvaluator[] expressions, String[] propertyNames, EventPropertyWriter[] writers, EventBeanCopyMethod copyMethod, boolean[] notNullableField, TypeWidener[] wideners) {
    this.expressions = expressions;
    this.propertyNames = propertyNames;
    this.writers = writers;
    this.copyMethod = copyMethod;
    this.notNullableField = notNullableField;
    this.wideners = wideners;
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:9,代码来源:NamedWindowUpdateHelper.java

示例4: getValidatePreprocessing

import com.espertech.esper.event.EventBeanCopyMethod; //导入依赖的package包/类
public InternalEventRouterDesc getValidatePreprocessing(EventType eventType, UpdateDesc desc, Annotation[] annotations)
        throws ExprValidationException
{
    if (log.isDebugEnabled())
    {
        log.debug("Validating route preprocessing for type '" + eventType.getName() + "'");
    }

    if (!(eventType instanceof EventTypeSPI))
    {
        throw new ExprValidationException("Update statements require the event type to implement the " + EventTypeSPI.class + " interface");
    }
    EventTypeSPI eventTypeSPI = (EventTypeSPI) eventType;

    TypeWidener[] wideners = new TypeWidener[desc.getAssignments().size()];
    List<String> properties = new ArrayList<String>();
    for (int i = 0; i < desc.getAssignments().size(); i++)
    {
        OnTriggerSetAssignment assignment = desc.getAssignments().get(i);
        EventPropertyDescriptor writableProperty = eventTypeSPI.getWritableProperty(assignment.getVariableName());

        if (writableProperty == null)
        {
            throw new ExprValidationException("Property '" + assignment.getVariableName() + "' is not available for write access");
        }

        wideners[i] = TypeWidenerFactory.getCheckPropertyAssignType(assignment.getExpression().toExpressionString(), assignment.getExpression().getExprEvaluator().getType(),
                writableProperty.getPropertyType(), assignment.getVariableName());
        properties.add(assignment.getVariableName());
    }

    // check copy-able
    EventBeanCopyMethod copyMethod = eventTypeSPI.getCopyMethod(properties.toArray(new String[properties.size()]));
    if (copyMethod == null)
    {
        throw new ExprValidationException("The update-clause requires the underlying event representation to support copy (via Serializable by default)");
    }

    return new InternalEventRouterDesc(desc, copyMethod, wideners, eventType, annotations);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:41,代码来源:InternalEventRouterImpl.java

示例5: InternalEventRouterDesc

import com.espertech.esper.event.EventBeanCopyMethod; //导入依赖的package包/类
public InternalEventRouterDesc(UpdateDesc updateDesc, EventBeanCopyMethod copyMethod, TypeWidener[] wideners, EventType eventType, Annotation[] annotations) {
    this.updateDesc = updateDesc;
    this.copyMethod = copyMethod;
    this.wideners = wideners;
    this.eventType = eventType;
    this.annotations = annotations;
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:8,代码来源:InternalEventRouterDesc.java

示例6: InternalEventRouterPreprocessor

import com.espertech.esper.event.EventBeanCopyMethod; //导入依赖的package包/类
/**
 * Ctor.
 * @param copyMethod for copying the events to preprocess
 * @param entries descriptors for pre-processing to apply
 */
public InternalEventRouterPreprocessor(EventBeanCopyMethod copyMethod, List<InternalEventRouterEntry> entries)
{
    this.copyMethod = copyMethod;
    Collections.sort(entries, comparator);
    this.entries = entries.toArray(new InternalEventRouterEntry[entries.size()]);
    empty = this.entries.length == 0;
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:13,代码来源:InternalEventRouterPreprocessor.java

示例7: EventBeanUpdateHelper

import com.espertech.esper.event.EventBeanCopyMethod; //导入依赖的package包/类
public EventBeanUpdateHelper(EventBeanCopyMethod copyMethod, EventBeanUpdateItem[] updateItems) {
    this.copyMethod = copyMethod;
    this.updateItems = updateItems;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:5,代码来源:EventBeanUpdateHelper.java

示例8: getValidatePreprocessing

import com.espertech.esper.event.EventBeanCopyMethod; //导入依赖的package包/类
public InternalEventRouterDesc getValidatePreprocessing(EventType eventType, UpdateDesc desc, Annotation[] annotations, String statementName)
        throws ExprValidationException {
    if (log.isDebugEnabled()) {
        log.debug("Validating route preprocessing for type '" + eventType.getName() + "'");
    }

    if (!(eventType instanceof EventTypeSPI)) {
        throw new ExprValidationException("Update statements require the event type to implement the " + EventTypeSPI.class + " interface");
    }
    EventTypeSPI eventTypeSPI = (EventTypeSPI) eventType;

    TypeWidener[] wideners = new TypeWidener[desc.getAssignments().size()];
    List<String> properties = new ArrayList<String>();
    for (int i = 0; i < desc.getAssignments().size(); i++) {
        OnTriggerSetAssignment xxx = desc.getAssignments().get(i);
        Pair<String, ExprNode> assignmentPair = ExprNodeUtilityRich.checkGetAssignmentToProp(xxx.getExpression());
        if (assignmentPair == null) {
            throw new ExprValidationException("Missing property assignment expression in assignment number " + i);
        }
        EventPropertyDescriptor writableProperty = eventTypeSPI.getWritableProperty(assignmentPair.getFirst());

        if (writableProperty == null) {
            throw new ExprValidationException("Property '" + assignmentPair.getFirst() + "' is not available for write access");
        }

        try {
            wideners[i] = TypeWidenerFactory.getCheckPropertyAssignType(ExprNodeUtilityCore.toExpressionStringMinPrecedenceSafe(assignmentPair.getSecond()), assignmentPair.getSecond().getForge().getEvaluationType(),
                    writableProperty.getPropertyType(), assignmentPair.getFirst(), false, null, null, engineURI);
        } catch (TypeWidenerException ex) {
            throw new ExprValidationException(ex.getMessage(), ex);
        }
        properties.add(assignmentPair.getFirst());
    }

    // check copy-able
    EventBeanCopyMethod copyMethod = eventTypeSPI.getCopyMethod(properties.toArray(new String[properties.size()]));
    if (copyMethod == null) {
        throw new ExprValidationException("The update-clause requires the underlying event representation to support copy (via Serializable by default)");
    }

    return new InternalEventRouterDesc(desc, copyMethod, wideners, eventType, annotations, engineImportService, statementName);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:43,代码来源:InternalEventRouterImpl.java

示例9: initialize

import com.espertech.esper.event.EventBeanCopyMethod; //导入依赖的package包/类
private NullableObject<InternalEventRouterPreprocessor> initialize(EventType eventType) {
    EventTypeSPI eventTypeSPI = (EventTypeSPI) eventType;
    List<InternalEventRouterEntry> desc = new ArrayList<InternalEventRouterEntry>();

    // determine which ones to process for this types, and what priority and drop
    Set<String> eventPropertiesWritten = new HashSet<String>();
    for (Map.Entry<UpdateDesc, IRDescEntry> entry : descriptors.entrySet()) {
        boolean applicable = entry.getValue().getEventType() == eventType;
        if (!applicable) {
            if (eventType.getDeepSuperTypes() != null) {
                for (Iterator<EventType> it = eventType.getDeepSuperTypes(); it.hasNext(); ) {
                    if (it.next() == entry.getValue().getEventType()) {
                        applicable = true;
                        break;
                    }
                }
            }
        }

        if (!applicable) {
            continue;
        }

        int priority = 0;
        boolean isDrop = false;
        Annotation[] annotations = entry.getValue().getAnnotations();
        for (int i = 0; i < annotations.length; i++) {
            if (annotations[i] instanceof Priority) {
                priority = ((Priority) annotations[i]).value();
            }
            if (annotations[i] instanceof Drop) {
                isDrop = true;
            }
        }

        List<String> properties = new ArrayList<String>();
        ExprNode[] expressions = new ExprNode[entry.getKey().getAssignments().size()];
        for (int i = 0; i < entry.getKey().getAssignments().size(); i++) {
            OnTriggerSetAssignment assignment = entry.getKey().getAssignments().get(i);
            Pair<String, ExprNode> assignmentPair = ExprNodeUtilityRich.checkGetAssignmentToProp(assignment.getExpression());
            expressions[i] = assignmentPair.getSecond();
            properties.add(assignmentPair.getFirst());
            eventPropertiesWritten.add(assignmentPair.getFirst());
        }
        EventBeanWriter writer = eventTypeSPI.getWriter(properties.toArray(new String[properties.size()]));
        desc.add(new InternalEventRouterEntry(priority, isDrop, entry.getValue().getOptionalWhereClauseEvaluator(), expressions, writer, entry.getValue().getWideners(), entry.getValue().getOutputView(), entry.getValue().getAgentInstanceLock(), entry.getValue().hasSubselect));
    }

    EventBeanCopyMethod copyMethod = eventTypeSPI.getCopyMethod(eventPropertiesWritten.toArray(new String[eventPropertiesWritten.size()]));
    if (copyMethod == null) {
        return new NullableObject<>(null);
    }
    return new NullableObject<>(new InternalEventRouterPreprocessor(copyMethod, desc));
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:55,代码来源:InternalEventRouterImpl.java

示例10: getCopyMethod

import com.espertech.esper.event.EventBeanCopyMethod; //导入依赖的package包/类
public EventBeanCopyMethod getCopyMethod() {
    return copyMethod;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:InternalEventRouterDesc.java

示例11: initialize

import com.espertech.esper.event.EventBeanCopyMethod; //导入依赖的package包/类
private NullableObject<InternalEventRouterPreprocessor> initialize(EventType eventType)
{
    EventTypeSPI eventTypeSPI = (EventTypeSPI) eventType;
    List<InternalEventRouterEntry> desc = new ArrayList<InternalEventRouterEntry>();

    // determine which ones to process for this types, and what priority and drop
    Set<String> eventPropertiesWritten = new HashSet<String>();
    for (Map.Entry<UpdateDesc, IRDescEntry> entry : descriptors.entrySet())
    {
        boolean applicable = entry.getValue().getEventType() == eventType;
        if (!applicable)
        {
            if (eventType.getDeepSuperTypes() != null)
            {
                for (Iterator<EventType> it = eventType.getDeepSuperTypes(); it.hasNext();)
                {
                    if (it.next() == entry.getValue().getEventType())
                    {
                        applicable = true;
                        break;
                    }
                }
            }
        }

        if (!applicable)
        {
            continue;
        }

        int priority = 0;
        boolean isDrop = false;
        Annotation[] annotations = entry.getValue().getAnnotations();
        for (int i = 0; i < annotations.length; i++)
        {
            if (annotations[i] instanceof Priority)
            {
                priority = ((Priority) annotations[i]).value();
            }
            if (annotations[i] instanceof Drop)
            {
                isDrop = true;
            }
        }

        List<String> properties = new ArrayList<String>();
        ExprNode[] expressions = new ExprNode[entry.getKey().getAssignments().size()];
        for (int i = 0; i < entry.getKey().getAssignments().size(); i++)
        {
            OnTriggerSetAssignment assignment = entry.getKey().getAssignments().get(i);
            expressions[i] = assignment.getExpression();
            properties.add(assignment.getVariableName());
            eventPropertiesWritten.add(assignment.getVariableName());
        }
        EventBeanWriter writer = eventTypeSPI.getWriter(properties.toArray(new String[properties.size()]));
        desc.add(new InternalEventRouterEntry(priority, isDrop, entry.getKey().getOptionalWhereClause(), expressions, writer, entry.getValue().getWideners(), entry.getValue().getOutputView(), entry.getValue().getAgentInstanceLock(), entry.getValue().hasSubselect));
    }

    EventBeanCopyMethod copyMethod = eventTypeSPI.getCopyMethod(eventPropertiesWritten.toArray(new String[eventPropertiesWritten.size()]));
    if (copyMethod == null)
    {
        return new NullableObject<InternalEventRouterPreprocessor>(null);
    }
    return new NullableObject<InternalEventRouterPreprocessor>(new InternalEventRouterPreprocessor(copyMethod, desc));
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:66,代码来源:InternalEventRouterImpl.java


注:本文中的com.espertech.esper.event.EventBeanCopyMethod类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。