本文整理汇总了Java中com.espertech.esper.event.EventTypeSPI.getWriter方法的典型用法代码示例。如果您正苦于以下问题:Java EventTypeSPI.getWriter方法的具体用法?Java EventTypeSPI.getWriter怎么用?Java EventTypeSPI.getWriter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.espertech.esper.event.EventTypeSPI
的用法示例。
在下文中一共展示了EventTypeSPI.getWriter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import com.espertech.esper.event.EventTypeSPI; //导入方法依赖的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));
}
示例2: initialize
import com.espertech.esper.event.EventTypeSPI; //导入方法依赖的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));
}