當前位置: 首頁>>代碼示例>>Java>>正文


Java ScheduleSlot類代碼示例

本文整理匯總了Java中com.espertech.esper.schedule.ScheduleSlot的典型用法代碼示例。如果您正苦於以下問題:Java ScheduleSlot類的具體用法?Java ScheduleSlot怎麽用?Java ScheduleSlot使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ScheduleSlot類屬於com.espertech.esper.schedule包,在下文中一共展示了ScheduleSlot類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: SendableBeanEvent

import com.espertech.esper.schedule.ScheduleSlot; //導入依賴的package包/類
/**
 * Converts mapToSend to an instance of beanClass
 * @param mapToSend - the map containing data to send into the runtime
 * @param beanClass  - type of the bean to create from mapToSend
 * @param eventTypeName - the event type name for the map event
 * @param timestamp - the timestamp for this event
 * @param scheduleSlot - the schedule slot for the entity that created this event
 */
public SendableBeanEvent(Map<String, Object> mapToSend, Class beanClass, String eventTypeName, long timestamp, ScheduleSlot scheduleSlot)
{
	super(timestamp, scheduleSlot);

	try {
		this.beanToSend = beanClass.newInstance();
		// pre-create nested properties if any, as BeanUtils does not otherwise populate 'null' objects from their respective properties

		/*
		 * PropertyDescriptor[] pds =
		 * ReflectUtils.getBeanSetters(beanClass); for (PropertyDescriptor
		 * pd : pds) { if (!pd.getPropertyType().isPrimitive() &&
		 * !pd.getPropertyType().getName().startsWith("java")) {
		 * BeanUtils.setProperty(beanToSend, pd.getName(),
		 * pd.getPropertyType().newInstance()); } }
		 */
		
		// this method silently ignores read only properties on the dest bean but we should
		// have caught them in CSVInputAdapter.constructPropertyTypes.
		BeanUtils.copyProperties(this.beanToSend, mapToSend);
	} catch (Exception e) {
		throw new EPException("Cannot populate bean instance", e);
	}
}
 
開發者ID:curtiszimmerman,項目名稱:AlgoTrader,代碼行數:33,代碼來源:SendableBeanEvent.java

示例2: DataCacheExpiringImpl

import com.espertech.esper.schedule.ScheduleSlot; //導入依賴的package包/類
/**
 * Ctor.
 * @param maxAgeSec is the maximum age in seconds
 * @param purgeIntervalSec is the purge interval in seconds
 * @param cacheReferenceType indicates whether hard, soft or weak references are used in the cache
 * @param schedulingService is a service for call backs at a scheduled time, for purging
 * @param scheduleSlot slot for scheduling callbacks for this cache
 * @param epStatementAgentInstanceHandle is the statements-own handle for use in registering callbacks with services
 */
public DataCacheExpiringImpl(double maxAgeSec,
                             double purgeIntervalSec,
                             ConfigurationCacheReferenceType cacheReferenceType,
                             SchedulingService schedulingService,
                             ScheduleSlot scheduleSlot,
                             EPStatementAgentInstanceHandle epStatementAgentInstanceHandle)
{
    this.maxAgeMSec = (long) maxAgeSec * 1000;
    this.purgeIntervalMSec = (long) purgeIntervalSec * 1000;
    this.schedulingService = schedulingService;
    this.scheduleSlot = scheduleSlot;

    if (cacheReferenceType == ConfigurationCacheReferenceType.HARD)
    {
        this.cache = new HashMap<Object, Item>();
    }
    else if (cacheReferenceType == ConfigurationCacheReferenceType.SOFT)
    {
        this.cache = new ReferenceMap(ReferenceMap.SOFT, ReferenceMap.SOFT);
    }
    else
    {
        this.cache = new WeakHashMap<Object, Item>();
    }

    this.epStatementAgentInstanceHandle = epStatementAgentInstanceHandle;
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:37,代碼來源:DataCacheExpiringImpl.java

示例3: ContextControllerConditionTimePeriod

import com.espertech.esper.schedule.ScheduleSlot; //導入依賴的package包/類
public ContextControllerConditionTimePeriod(String contextName, AgentInstanceContext agentInstanceContext, ScheduleSlot scheduleSlot, ContextDetailConditionTimePeriod spec, ContextControllerConditionCallback callback, ContextInternalFilterAddendum filterAddendum) {
    this.contextName = contextName;
    this.agentInstanceContext = agentInstanceContext;
    this.scheduleSlot = scheduleSlot;
    this.spec = spec;
    this.callback = callback;
    this.filterAddendum = filterAddendum;
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:9,代碼來源:ContextControllerConditionTimePeriod.java

示例4: ContextControllerConditionCrontab

import com.espertech.esper.schedule.ScheduleSlot; //導入依賴的package包/類
public ContextControllerConditionCrontab(StatementContext statementContext, ScheduleSlot scheduleSlot, ContextDetailConditionCrontab spec, ContextControllerConditionCallback callback, ContextInternalFilterAddendum filterAddendum) {
    this.statementContext = statementContext;
    this.scheduleSlot = scheduleSlot;
    this.spec = spec;
    this.callback = callback;
    this.filterAddendum = filterAddendum;
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:8,代碼來源:ContextControllerConditionCrontab.java

示例5: testPurgeInterval

import com.espertech.esper.schedule.ScheduleSlot; //導入依賴的package包/類
public void testPurgeInterval()
{
    SchedulingServiceImpl scheduler = new SchedulingServiceImpl(new TimeSourceServiceImpl());
    cache = new DataCacheExpiringImpl(10, 20, ConfigurationCacheReferenceType.HARD, scheduler, new ScheduleSlot(1, 2), null);   // age 10 sec, purge 1000 seconds

    // test single entry in cache
    scheduler.setTime(5000);
    cache.put(make("a"), lists[0]); // a at 5 sec
    assertSame(lists[0], cache.getCached(make("a")));

    scheduler.setTime(26000);
    SupportSchedulingServiceImpl.evaluateSchedule(scheduler);
    assertEquals(0, cache.getSize());

    // test 4 entries in cache
    scheduler.setTime(30000);
    cache.put(make("b"), lists[1]);  // b at 30 sec

    scheduler.setTime(35000);
    cache.put(make("c"), lists[2]);  // c at 35 sec

    scheduler.setTime(40000);
    cache.put(make("d"), lists[3]);  // d at 40 sec

    scheduler.setTime(45000);
    cache.put(make("e"), lists[4]);  // d at 40 sec

    scheduler.setTime(50000);
    SupportSchedulingServiceImpl.evaluateSchedule(scheduler);
    assertEquals(2, cache.getSize());   // only d and e

    assertSame(lists[3], cache.getCached(make("d")));
    assertSame(lists[4], cache.getCached(make("e")));
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:35,代碼來源:TestDataCacheExpiringImpl.java

示例6: setScheduleSlot

import com.espertech.esper.schedule.ScheduleSlot; //導入依賴的package包/類
public void setScheduleSlot(ScheduleSlot scheduleSlot)
{
	this.scheduleSlot = scheduleSlot;
}
 
開發者ID:curtiszimmerman,項目名稱:AlgoTrader,代碼行數:5,代碼來源:AbstractCoordinatedAdapter.java

示例7: SendableBaseObjectEvent

import com.espertech.esper.schedule.ScheduleSlot; //導入依賴的package包/類
public SendableBaseObjectEvent(BaseObject object, long timestamp, ScheduleSlot scheduleSlot) {
	super(timestamp, scheduleSlot);

	this.eventToSend = object;
}
 
開發者ID:curtiszimmerman,項目名稱:AlgoTrader,代碼行數:6,代碼來源:SendableBaseObjectEvent.java

示例8: allocateSlot

import com.espertech.esper.schedule.ScheduleSlot; //導入依賴的package包/類
public ScheduleSlot allocateSlot() {
    return factoryContext.getAgentInstanceContextCreate().getStatementContext().getScheduleBucket().allocateSlot();
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:4,代碼來源:ContextControllerInitTermFactory.java


注:本文中的com.espertech.esper.schedule.ScheduleSlot類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。