本文整理汇总了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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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")));
}
示例6: setScheduleSlot
import com.espertech.esper.schedule.ScheduleSlot; //导入依赖的package包/类
public void setScheduleSlot(ScheduleSlot scheduleSlot)
{
this.scheduleSlot = scheduleSlot;
}
示例7: SendableBaseObjectEvent
import com.espertech.esper.schedule.ScheduleSlot; //导入依赖的package包/类
public SendableBaseObjectEvent(BaseObject object, long timestamp, ScheduleSlot scheduleSlot) {
super(timestamp, scheduleSlot);
this.eventToSend = object;
}
示例8: allocateSlot
import com.espertech.esper.schedule.ScheduleSlot; //导入依赖的package包/类
public ScheduleSlot allocateSlot() {
return factoryContext.getAgentInstanceContextCreate().getStatementContext().getScheduleBucket().allocateSlot();
}