本文整理汇总了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;
}
示例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;
}
示例3: getTemplate
import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
MockPojoFifoGrouping getTemplate() {
MockPojoFifoGrouping template = new MockPojoFifoGrouping();
template.setProcessed(false);
return template;
}
示例4: getTemplate
import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
MockPojoFifoGrouping getTemplate() {
MockPojoFifoGrouping template = new MockPojoFifoGrouping();
template.setProcessed(WRONG_PROCESSED_TEMPLATE_VALUE);
return template;
}
示例5: thisIsMyTemplate
import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
public Message thisIsMyTemplate() {
return new Message();
}
示例6: thisIsMyTemplate
import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
public Object thisIsMyTemplate() {
return new Object();
}
示例7: getMySpecialTemplate
import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
public Object getMySpecialTemplate() {
return new Object();
}
示例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;
}
示例9: template
import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
public Object template() {
return new Object();
}
示例10: findUnprocessedRule
import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
public static SQLQuery<DroolsRuleAddEvent> findUnprocessedRule() {
return new SQLQuery<DroolsRuleAddEvent>(DroolsRuleAddEvent.class, "processed = ?", Boolean.FALSE);
}
示例11: findUnprocessedRule
import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
public static SQLQuery<DroolsRuleRemoveEvent> findUnprocessedRule() {
return new SQLQuery<DroolsRuleRemoveEvent>(DroolsRuleRemoveEvent.class, "processed = ?", Boolean.FALSE);
}
示例12: unprocessedData
import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
Payment unprocessedData() {
Payment template = new Payment();
template.setStatus(ETransactionStatus.PROCESSED);
return template;
}
示例13: unprocessedData
import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
Payment unprocessedData() {
Payment template = new Payment();
template.setStatus(ETransactionStatus.NEW);
return template;
}
示例14: unprocessedData
import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
Payment unprocessedData() {
Payment template = new Payment();
template.setStatus(ETransactionStatus.AUDITED);
return template;
}
示例15: unprocessedData
import org.openspaces.events.EventTemplate; //导入依赖的package包/类
@EventTemplate
Payment unprocessedData() {
Payment template = new Payment();
template.setStatus(ETransactionStatus.CANCELLED);
return template;
}