int nestingLevel,
int pathId,
int subpathId) {
if (endpoint instanceof ContextDetailConditionCrontab) {
ContextDetailConditionCrontab crontab = (ContextDetailConditionCrontab) endpoint;
ScheduleSlot scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();
return new ContextControllerConditionCrontab(agentInstanceContext.getStatementContext(), scheduleSlot, crontab, callback, filterAddendum);
}
else if (endpoint instanceof ContextDetailConditionFilter) {
ContextDetailConditionFilter filter = (ContextDetailConditionFilter) endpoint;
return new ContextControllerConditionFilter(servicesContext, agentInstanceContext, filter, callback, filterAddendum);
}
else if (endpoint instanceof ContextDetailConditionPattern) {
ContextStatePathKey key = new ContextStatePathKey(nestingLevel, pathId, subpathId);
ContextDetailConditionPattern pattern = (ContextDetailConditionPattern) endpoint;
return new ContextControllerConditionPattern(servicesContext, agentInstanceContext, pattern, callback, filterAddendum, isStartEndpoint, key);
}
else if (endpoint instanceof ContextDetailConditionTimePeriod) {
ContextDetailConditionTimePeriod timePeriod = (ContextDetailConditionTimePeriod) endpoint;
ScheduleSlot scheduleSlot = agentInstanceContext.getStatementContext().getScheduleBucket().allocateSlot();
return new ContextControllerConditionTimePeriod(contextName, agentInstanceContext, scheduleSlot, timePeriod, callback, filterAddendum);
}
else if (endpoint instanceof ContextDetailConditionImmediate) {
return new ContextControllerConditionImmediate();
}