fr.umlv.corosol.component
Interface JScheduler

All Superinterfaces:
JObject, JVMComponent
All Known Implementing Classes:
DefaultJScheduler

public interface JScheduler
extends JVMComponent

This interface represents the scheduler component of the Java virtual machine.

Author:
Christophe Deleray
See Also:
JThread

Method Summary
 void breakScheduling()
          Stops the thread managing loop of this scheduler.
 void enqueueThread(JThread thread)
          Puts the specified thread in the thread queue of this scheduler.
 JThread getCurrentThread()
          Returns the current executing thread.
 JThread[] getThreads()
          Returns all the active threads managed by this scheduler.
 boolean hasNext()
          Determines if there is a thread to be managed by this scheduler.
 void schedule()
          Starts the thread managing loops of this scheduler.
 
Methods inherited from interface fr.umlv.corosol.component.JVMComponent
configure, getComponentClass, replace
 

Method Detail

getCurrentThread

JThread getCurrentThread()
Returns the current executing thread.

Returns:
the current executing thread

enqueueThread

void enqueueThread(JThread thread)
Puts the specified thread in the thread queue of this scheduler.

Parameters:
thread - a new thread to be scheduled

schedule

void schedule()
              throws java.lang.Throwable
Starts the thread managing loops of this scheduler. An extern component can break this loop by using the breakScheduling method.

Throws:
java.lang.Throwable - if an exception occurs during execution
See Also:
breakScheduling()

breakScheduling

void breakScheduling()
Stops the thread managing loop of this scheduler. The threads still active are returned by the getThreads methods

See Also:
getThreads()

getThreads

JThread[] getThreads()
Returns all the active threads managed by this scheduler.


hasNext

boolean hasNext()
Determines if there is a thread to be managed by this scheduler. Returns true if any and false otherwise.

Returns:
true if there is a thread to be managed by this scheduler. false otherwise.