org.sca4j.host.work
Class DefaultPausableWork

java.lang.Object
  extended by org.sca4j.host.work.DefaultPausableWork
All Implemented Interfaces:
java.lang.Runnable, PausableWork

public abstract class DefaultPausableWork
extends java.lang.Object
implements PausableWork

Default implementation of the pausable work.


Constructor Summary
DefaultPausableWork()
          Non-daemon constructor.
DefaultPausableWork(boolean daemon)
          Allows to set whether the work is daemon or not.
 
Method Summary
protected abstract  void execute()
          Executes the job.
 boolean isDaemon()
          Checks whether the work is daemon.
 void run()
          Runs the job.
 void start(boolean flag)
          Terminates the job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPausableWork

public DefaultPausableWork()
Non-daemon constructor.


DefaultPausableWork

public DefaultPausableWork(boolean daemon)
Allows to set whether the work is daemon or not.

Parameters:
daemon - Whether this worker is a daemon or not.
Method Detail

start

public final void start(boolean flag)
                 throws java.lang.InterruptedException
Terminates the job.

Throws:
java.lang.InterruptedException

run

public final void run()
Runs the job.

Specified by:
run in interface java.lang.Runnable

isDaemon

public boolean isDaemon()
Checks whether the work is daemon.

Returns:
True if the work is daemon.

execute

protected abstract void execute()
Executes the job.



Copyright © 2008-2011 Service Symphony. All Rights Reserved.