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


Java EventTemplate类代码示例

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


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

示例1: findTemplateFromProvider

import org.openspaces.events.EventTemplate; //导入依赖的package包/类
public static Object findTemplateFromProvider(Object listener) {
    Object newTemplate = null;
    // check if it implements an interface to provide the template
    if (EventTemplateProvider.class.isAssignableFrom(listener.getClass())) {
        newTemplate = ((EventTemplateProvider) listener).getTemplate();
    }
    else {
        // check if there is an annotation for it
        final AtomicReference<Method> ref = new AtomicReference<Method>();
        ReflectionUtils.doWithMethods(AopUtils.getTargetClass(listener), new ReflectionUtils.MethodCallback() {
            public void doWith(final Method method) throws IllegalArgumentException, IllegalAccessException {
                if (method.isAnnotationPresent(EventTemplate.class)) {
                    ref.set(method);
                }
            }
        });
        if (ref.get() != null) {
            ref.get().setAccessible(true);
            try {
                newTemplate = ref.get().invoke(listener);
            } catch (final Exception e) {
                throw new IllegalArgumentException("Failed to get template from method [" + ref.get().getName() + "]", e);
            }
        }
    }
    return newTemplate;
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:28,代码来源:AnnotationProcessorUtils.java

示例2: unprocessedData

import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
SQLQuery<Payment> unprocessedData() {
	SQLQuery<Payment> template = new SQLQuery<Payment>(Payment.class,
			"status = ?");
	template.setParameter(1, ETransactionStatus.CANCELLED);
	return template;
}
 
开发者ID:Gigaspaces,项目名称:xap-tutorial,代码行数:8,代码来源:PaymentQueryListener.java

示例3: getTemplate

import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
MockPojoFifoGrouping getTemplate() {
    MockPojoFifoGrouping template = new MockPojoFifoGrouping();
    template.setProcessed(false);
    return template;
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:7,代码来源:MockArchiveContainerWrongHandler.java

示例4: getTemplate

import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
MockPojoFifoGrouping getTemplate() {
    MockPojoFifoGrouping template = new MockPojoFifoGrouping();
    template.setProcessed(WRONG_PROCESSED_TEMPLATE_VALUE);
    return template;
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:7,代码来源:MockArchiveContainerWrongTemplate.java

示例5: thisIsMyTemplate

import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
public Message thisIsMyTemplate() {
    return new Message();
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:5,代码来源:TestListener.java

示例6: thisIsMyTemplate

import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
public Object thisIsMyTemplate() {
    return new Object();
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:5,代码来源:TestListener.java

示例7: getMySpecialTemplate

import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
public Object getMySpecialTemplate() {
    return new Object();
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:5,代码来源:TestEventListener.java

示例8: getTemplate

import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
public Object getTemplate() {
    SQLQuery<MockPojo> query = new SQLQuery<MockPojo>(MockPojo.class, "processed = false");
    query.setRouting(routing);
    return query;
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:7,代码来源:PollingContainerListener.java

示例9: template

import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
public Object template() {
    return new Object();
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:5,代码来源:DynamicEventListener.java

示例10: findUnprocessedRule

import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
public static SQLQuery<DroolsRuleAddEvent> findUnprocessedRule() {
    return new SQLQuery<DroolsRuleAddEvent>(DroolsRuleAddEvent.class, "processed = ?", Boolean.FALSE);
}
 
开发者ID:Gigaspaces,项目名称:xap-drools-integration,代码行数:5,代码来源:DroolsRuleAddEventListener.java

示例11: findUnprocessedRule

import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
public static SQLQuery<DroolsRuleRemoveEvent> findUnprocessedRule() {
    return new SQLQuery<DroolsRuleRemoveEvent>(DroolsRuleRemoveEvent.class, "processed = ?", Boolean.FALSE);
}
 
开发者ID:Gigaspaces,项目名称:xap-drools-integration,代码行数:5,代码来源:DroolsRuleRemoveEventListener.java

示例12: unprocessedData

import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
Payment unprocessedData() {
	Payment template = new Payment();
	template.setStatus(ETransactionStatus.PROCESSED);
	return template;
}
 
开发者ID:Gigaspaces,项目名称:xap-tutorial,代码行数:7,代码来源:ClientListener.java

示例13: unprocessedData

import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
Payment unprocessedData() {
	Payment template = new Payment();
	template.setStatus(ETransactionStatus.NEW);
	return template;
}
 
开发者ID:Gigaspaces,项目名称:xap-tutorial,代码行数:7,代码来源:PaymentEventProcessor.java

示例14: unprocessedData

import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
Payment unprocessedData() {
	Payment template = new Payment();
	template.setStatus(ETransactionStatus.AUDITED);
	return template;
}
 
开发者ID:Gigaspaces,项目名称:xap-tutorial,代码行数:7,代码来源:AuditListener.java

示例15: unprocessedData

import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
Payment unprocessedData() {
	Payment template = new Payment();
	template.setStatus(ETransactionStatus.CANCELLED);
	return template;
}
 
开发者ID:Gigaspaces,项目名称:xap-tutorial,代码行数:7,代码来源:PaymentListener.java


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