|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jonathan.resources.lib.JScheduler
Default scheduler
implementation.
This implementation has exactly the same behaviour as the default Java scheduling.
This scheduler manages a pool of re-usable threads. The size of this pool may
be customized in the
bootstrap context
.
Field Summary | |
protected org.objectweb.jonathan.apis.kernel.ContextFactory |
context_factory
|
boolean |
verbose
Indicates whether warning message should be printed to stderr. |
Constructor Summary | |
JScheduler(org.objectweb.jonathan.apis.kernel.ContextFactory context_factory)
Returns a new scheduler. |
|
JScheduler(int max_waiting,
boolean verbose,
org.objectweb.jonathan.apis.kernel.ContextFactory context_factory)
Returns a new scheduler. |
Method Summary | |
void |
enter()
Causes a job "escaped" from the scheduler to be re-admitted
in the set of jobs managed by the target scheduler. |
void |
escape()
Causes the calling job to be removed from the set of jobs managed by the target scheduler. |
Job |
getCurrent()
Returns the currently executing job (the job performing the call). |
Job |
newJob()
Returns a new job created by the scheduler. |
void |
notify(Object lock)
Unblocks a job waiting on the lock. |
void |
notifyAll(Object lock)
Unblocks all jobs waiting on the lock. |
void |
wait(Object lock)
Blocks the calling job until the notify or
notifyAll method is called providing the
same lock identifier. |
void |
wait(Object lock,
long millis)
Blocks the calling job until the notify or
notifyAll method is called providing the
same lock identifier. |
void |
yield()
Calling this method gives the opportunity to the scheduler to re-schedule the currently executing jobs. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public boolean verbose
This value is defined under the name "/jonathan/JScheduler/verbose"
in the bootstrap context
.
This variable is not used in the current implementation.
protected org.objectweb.jonathan.apis.kernel.ContextFactory context_factory
Constructor Detail |
public JScheduler(org.objectweb.jonathan.apis.kernel.ContextFactory context_factory)
context_factory
- a context factory
.public JScheduler(int max_waiting, boolean verbose, org.objectweb.jonathan.apis.kernel.ContextFactory context_factory)
max_waiting
- maximum number of idle threadsverbose
- indicates whether warning messsages should be output on
stderr.context_factory
- a context factory
.Method Detail |
public Job newJob()
newJob
in interface Scheduler
public Job getCurrent()
getCurrent
in interface Scheduler
public void yield()
This implementation calls the static yield()
method
on the Thread
class.
yield
in interface Scheduler
public void wait(Object lock) throws InterruptedException
notify
or
notifyAll
method is called providing the
same lock identifier.
This implementation calls the standard wait()
method
on the provided lock
.
wait
in interface Scheduler
lock
- the lock identifier.
InterruptedException
public void wait(Object lock, long millis) throws InterruptedException
notify
or
notifyAll
method is called providing the
same lock identifier.
This implementation calls the standard wait()
method
on the provided lock
.
wait
in interface Scheduler
lock
- the lock identifier.
InterruptedException
public void notify(Object lock)
waiting
on the lock.
This implementation calls the standard notify()
method
on the provided lock
.
notify
in interface Scheduler
lock
- the lock identifier.public void notifyAll(Object lock)
waiting
on the lock.
This implementation calls the standard notifyAll()
method
on the provided lock
.
notifyAll
in interface Scheduler
lock
- the lock identifier.public void escape()
This implementation has nothing to do.
escape
in interface Scheduler
public void enter()
"escaped"
from the scheduler to be re-admitted
in the set of jobs managed by the target scheduler.
This implementation has nothing to do.
enter
in interface Scheduler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |