On 2010-12-08 17.37, Paul Merlin wrote:
It use two entities, Schedule and Task. There is no directly usable TaskEntity
for now but code is provided so that you can write your taks with something
like:

   @Mixins(FooTaskMixin.class)
   interface FooTaskEntity extends Task, EntityComposite {}

   class FooTaskMixin implements TaskBehavior { void run() {...} }

This might be a stupid question, but could the required interface of a Task simply be Runnable? If not, why?

That way you can add state specific to your task and implement the behavior with
the code you want to be run when the task is run.

The SchedulerService use a pulse-thread with a configurable rhythm that enqueue
tasks in a thread pool (size is configurable too).

Something like an Executor? Are you using Configuration for the configs? Would it be possible to mirror the Schedules and Tasks as JMX MBeans? With the latest stuff I did on that it would be really nice if all admin could be done through JMX really.

As the Task is an entity, it's run() method is run in a UoW. When thinking about
tasks that need to run code in several subsequents UoW (ie. for batching
purpose) I thought about chaining tasks but it feels a little bit hackish. Could
a Task pause the current UoW (which is handling Task state), handle "nested"
UoWs and then resume the said UoW ?

Simply do newUnitOfWork() and the current one is automatically paused. That works "out of the box".

WDYT about all this ?

Sounds good so far!

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to