org.qi4j.library.scheduler
Interface Task

All Superinterfaces:
java.lang.Runnable

public interface Task
extends java.lang.Runnable

Compose an Entity using this type to be able to Schedule it. A Task is wrapped in a SchedulerMixin.ScheduleRunner before being run by an executor. SchedulerMixin.ScheduleRunner wrap a UnitOfWork around the Runnable.run() invocation. Here is a simple example:

  interface MyTaskEntity
      extends Task, EntityComposite
  {
      Property<String customState();
      Association<AnotherEntity> anotherEntity();
  }

  abstract class MyTaskMixin
      implements Runnable
  {
      @This MyTaskEntity me;
      public void run()
      {
          me.customState().set( me.anotherEntity().get().doSomeStuff( me.customState().get() ) );
      }
  }
 


Method Summary
 Property<java.lang.String> name()
           
 Property<java.util.List<java.lang.String>> tags()
           
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

name

Property<java.lang.String> name()

tags

@UseDefaults
Property<java.util.List<java.lang.String>> tags()