Search in sources :

Example 1 with ValueDeclaration

use of org.qi4j.bootstrap.ValueDeclaration in project qi4j-sdk by Qi4j.

the class SchedulerAssembler method assemble.

@Override
public void assemble(ModuleAssembly assembly) throws AssemblyException {
    assembly.services(ScheduleFactory.class);
    assembly.entities(Schedules.class);
    EntityDeclaration scheduleEntities = assembly.entities(CronSchedule.class, OnceSchedule.class);
    ValueDeclaration scheduleValues = assembly.values(CronSchedule.class, OnceSchedule.class);
    ServiceDeclaration schedulerDeclaration = assembly.services(SchedulerService.class).visibleIn(visibility()).instantiateOnStartup();
    if (timeline) {
        scheduleEntities.withTypes(Timeline.class).withMixins(TimelineScheduleMixin.class).withConcerns(TimelineForScheduleConcern.class);
        scheduleValues.withTypes(Timeline.class).withMixins(TimelineScheduleMixin.class).withConcerns(TimelineForScheduleConcern.class);
        // Internal
        assembly.values(TimelineRecord.class);
        schedulerDeclaration.withTypes(Timeline.class).withMixins(TimelineSchedulerServiceMixin.class);
    }
    if (hasConfig()) {
        configModule().entities(SchedulerConfiguration.class).visibleIn(configVisibility());
    }
}
Also used : Timeline(org.qi4j.library.scheduler.timeline.Timeline) SchedulerConfiguration(org.qi4j.library.scheduler.SchedulerConfiguration) EntityDeclaration(org.qi4j.bootstrap.EntityDeclaration) ServiceDeclaration(org.qi4j.bootstrap.ServiceDeclaration) TimelineScheduleMixin(org.qi4j.library.scheduler.timeline.TimelineScheduleMixin) ValueDeclaration(org.qi4j.bootstrap.ValueDeclaration)

Aggregations

EntityDeclaration (org.qi4j.bootstrap.EntityDeclaration)1 ServiceDeclaration (org.qi4j.bootstrap.ServiceDeclaration)1 ValueDeclaration (org.qi4j.bootstrap.ValueDeclaration)1 SchedulerConfiguration (org.qi4j.library.scheduler.SchedulerConfiguration)1 Timeline (org.qi4j.library.scheduler.timeline.Timeline)1 TimelineScheduleMixin (org.qi4j.library.scheduler.timeline.TimelineScheduleMixin)1