本文整理匯總了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;
}