org.dfdaemon.il2.core.task
Interface CoreTaskExecutor

All Known Implementing Classes:
CoreTaskExecutorImpl

public interface CoreTaskExecutor

Author:
aka50

Method Summary
 void awaitCompletition(CoreTask task)
          Wait for task with specified time (if interrupted, simple return with no really completition guarantee).
 void awaitCompletition(CoreTask task, long amount, TimeUnit units)
          Wait for task with infinite time (if interrupted, simple return with no really completition guarantee).
 boolean awaitTermination(long timeout, TimeUnit unit)
          Awaits for shutdown specified amount of time.
 void cancel(CoreTask task)
          Cancel task with infinite wait (if interrupted, simple return with no really cancel guarantee).
 void cancel(CoreTask task, long amount, TimeUnit units)
          Cancel with specified waittime.
 boolean submit(CoreTask task)
          Method submits task for execution with default crash handler
 boolean submit(CoreTask task, CoreTaskExecutionCallback handler)
          Method submit task for execution with userdefinded crash handler.
 

Method Detail

submit

boolean submit(CoreTask task)
Method submits task for execution with default crash handler

Parameters:
task - of type CoreTask
Returns:
boolean

submit

boolean submit(CoreTask task,
               CoreTaskExecutionCallback handler)
Method submit task for execution with userdefinded crash handler.

Parameters:
task - of type CoreTask
handler - of type CoreTaskExecutionCallback (if null, default will be used).
Returns:
boolean

cancel

void cancel(CoreTask task,
            long amount,
            TimeUnit units)
            throws InterruptedException
Cancel with specified waittime.

Parameters:
task - of type CoreTask
amount - of type long
units - of type TimeUnit
Throws:
InterruptedException - when

cancel

void cancel(CoreTask task)
Cancel task with infinite wait (if interrupted, simple return with no really cancel guarantee).

Parameters:
task - of type CoreTask

awaitCompletition

void awaitCompletition(CoreTask task)
                       throws InterruptedException
Wait for task with specified time (if interrupted, simple return with no really completition guarantee).

Parameters:
task - of type CoreTask
Throws:
InterruptedException - on interrupt

awaitCompletition

void awaitCompletition(CoreTask task,
                       long amount,
                       TimeUnit units)
                       throws InterruptedException
Wait for task with infinite time (if interrupted, simple return with no really completition guarantee).

Parameters:
task - of type CoreTask
amount - amount of TimeUnits
units - TimeUnits
Throws:
InterruptedException - on interrupt

awaitTermination

boolean awaitTermination(long timeout,
                         TimeUnit unit)
                         throws InterruptedException
Awaits for shutdown specified amount of time.

Parameters:
timeout - of type long
unit - of type TimeUnit
Returns:
boolean
Throws:
InterruptedException - when


Copyright © 2007-2008. All Rights Reserved.