當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。