lejos.realtime
Class AsyncEventHandler

java.lang.Object
  extended by lejos.realtime.AsyncEventHandler
All Implemented Interfaces:
Runnable, Schedulable
Direct Known Subclasses:
BoundAsyncEventHandler

public class AsyncEventHandler
extends Object
implements Schedulable

Author:
Team iRboT

Constructor Summary
AsyncEventHandler()
          Create an instance of AsyncEventHandler with default values for all parameters.
AsyncEventHandler(SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memory, MemoryArea area, ProcessingGroupParameters group, boolean nonheap, Runnable logic)
           
 
Method Summary
 boolean addIfFeasible()
           
 boolean addToFeasibility()
          This method first performs a feasibility analysis with this added to the system.
 MemoryParameters getMemoryParameters()
           
 ProcessingGroupParameters getProcessingGroupParameters()
           
 ReleaseParameters getReleaseParameters()
           
 Scheduler getScheduler()
           
 SchedulingParameters getSchedulingParameters()
           
 void handleAsyncEvent()
           
 boolean removeFromFeasibility()
           
 void run()
          When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.
 boolean setIfFeasible(ReleaseParameters release, MemoryParameters memory)
           
 boolean setIfFeasible(ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters group)
           
 boolean setIfFeasible(ReleaseParameters release, ProcessingGroupParameters group)
           
 boolean setIfFeasible(SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memory)
           
 boolean setIfFeasible(SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters group)
           
 void setMemoryParameters(MemoryParameters memory)
           
 boolean setMemoryParametersIfFeasible(MemoryParameters memory)
           
 void setProcessingGroupParameters(ProcessingGroupParameters group)
           
 boolean setProcessingGroupParametersIfFeasible(ProcessingGroupParameters group)
           
 void setReleaseParameters(ReleaseParameters release)
          Sets the release parameters associated with this instance of Schedulable.
 boolean setReleaseParametersIfFeasible(ReleaseParameters release)
           
 void setScheduler(Scheduler scheduler)
           
 void setScheduler(Scheduler scheduler, SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memoryParameters, ProcessingGroupParameters group)
           
 void setSchedulingParameters(SchedulingParameters scheduling)
          Sets the scheduling parameters associated with this instance of Schedulable.
 boolean setSchedulingParametersIfFeasible(SchedulingParameters scheduling)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncEventHandler

public AsyncEventHandler()
Create an instance of AsyncEventHandler with default values for all parameters. This constructor is equivalent to AsyncEventHandler(null, null, null, null, null, false, null).


AsyncEventHandler

public AsyncEventHandler(SchedulingParameters scheduling,
                         ReleaseParameters release,
                         MemoryParameters memory,
                         MemoryArea area,
                         ProcessingGroupParameters group,
                         boolean nonheap,
                         Runnable logic)
Method Detail

setReleaseParameters

public void setReleaseParameters(ReleaseParameters release)
                          throws IllegalArgumentException,
                                 IllegalStateException
Description copied from interface: Schedulable
Sets the release parameters associated with this instance of Schedulable. Since this affects the constraints expressed in the release parameters of the existing schedulable objects, this may change the feasibility of the current system. This change becomes effective under conditions determined by the scheduler controlling the schedulable object. For instance, the change may be immediate or it may be delayed until the next release of the schedulable object. The different properties of the release parameters may take effect at different times. See the documentation for the scheduler for details.

Specified by:
setReleaseParameters in interface Schedulable
Parameters:
release - A ReleaseParameters object which will become the release parameters associated with this after the method call, and take effect as determined by the associated scheduler. If null, the default value is governed by the associated scheduler (a new object is created if the default value is not null). (See PriorityScheduler.)
Throws:
IllegalArgumentException - Never throwed for the moment.
java.lang.IllegalThreadStateException - Never throwed for the moment.
IllegalStateException

setSchedulingParameters

public void setSchedulingParameters(SchedulingParameters scheduling)
                             throws IllegalArgumentException
Description copied from interface: Schedulable
Sets the scheduling parameters associated with this instance of Schedulable. Since this affects the scheduling parameters of the existing schedulable objects, this may change the feasibility of the current system. This change becomes effective under conditions determined by the scheduler controlling the schedulable object. For instance, the change may be immediate or it may be delayed until the next release of the schedulable object. See the documentation for the scheduler for details.

Specified by:
setSchedulingParameters in interface Schedulable
Parameters:
scheduling - A reference to the SchedulingParameters object. If null, the default value is governed by the associated scheduler (a new object is created if the default value is not null). (See PriorityScheduler.)
Throws:
IllegalArgumentException - Never throwed for the moment.

run

public final void run()
Description copied from interface: Runnable
When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.

Specified by:
run in interface Runnable

addIfFeasible

public boolean addIfFeasible()
Specified by:
addIfFeasible in interface Schedulable

addToFeasibility

public boolean addToFeasibility()
Description copied from interface: Schedulable
This method first performs a feasibility analysis with this added to the system.

Specified by:
addToFeasibility in interface Schedulable

getMemoryParameters

public MemoryParameters getMemoryParameters()
Specified by:
getMemoryParameters in interface Schedulable

getProcessingGroupParameters

public ProcessingGroupParameters getProcessingGroupParameters()
Specified by:
getProcessingGroupParameters in interface Schedulable

getReleaseParameters

public ReleaseParameters getReleaseParameters()
Specified by:
getReleaseParameters in interface Schedulable

getScheduler

public Scheduler getScheduler()
Specified by:
getScheduler in interface Schedulable

handleAsyncEvent

public void handleAsyncEvent()

getSchedulingParameters

public SchedulingParameters getSchedulingParameters()
Specified by:
getSchedulingParameters in interface Schedulable

removeFromFeasibility

public boolean removeFromFeasibility()
Specified by:
removeFromFeasibility in interface Schedulable

setIfFeasible

public boolean setIfFeasible(ReleaseParameters release,
                             MemoryParameters memory)
Specified by:
setIfFeasible in interface Schedulable

setIfFeasible

public boolean setIfFeasible(ReleaseParameters release,
                             MemoryParameters memory,
                             ProcessingGroupParameters group)
Specified by:
setIfFeasible in interface Schedulable

setIfFeasible

public boolean setIfFeasible(ReleaseParameters release,
                             ProcessingGroupParameters group)
Specified by:
setIfFeasible in interface Schedulable

setIfFeasible

public boolean setIfFeasible(SchedulingParameters scheduling,
                             ReleaseParameters release,
                             MemoryParameters memory)
Specified by:
setIfFeasible in interface Schedulable

setIfFeasible

public boolean setIfFeasible(SchedulingParameters scheduling,
                             ReleaseParameters release,
                             MemoryParameters memory,
                             ProcessingGroupParameters group)
Specified by:
setIfFeasible in interface Schedulable

setMemoryParameters

public void setMemoryParameters(MemoryParameters memory)
Specified by:
setMemoryParameters in interface Schedulable

setMemoryParametersIfFeasible

public boolean setMemoryParametersIfFeasible(MemoryParameters memory)
Specified by:
setMemoryParametersIfFeasible in interface Schedulable

setProcessingGroupParameters

public void setProcessingGroupParameters(ProcessingGroupParameters group)
Specified by:
setProcessingGroupParameters in interface Schedulable

setProcessingGroupParametersIfFeasible

public boolean setProcessingGroupParametersIfFeasible(ProcessingGroupParameters group)
Specified by:
setProcessingGroupParametersIfFeasible in interface Schedulable

setReleaseParametersIfFeasible

public boolean setReleaseParametersIfFeasible(ReleaseParameters release)
Specified by:
setReleaseParametersIfFeasible in interface Schedulable

setScheduler

public void setScheduler(Scheduler scheduler)
Specified by:
setScheduler in interface Schedulable

setScheduler

public void setScheduler(Scheduler scheduler,
                         SchedulingParameters scheduling,
                         ReleaseParameters release,
                         MemoryParameters memoryParameters,
                         ProcessingGroupParameters group)
Specified by:
setScheduler in interface Schedulable

setSchedulingParametersIfFeasible

public boolean setSchedulingParametersIfFeasible(SchedulingParameters scheduling)
Specified by:
setSchedulingParametersIfFeasible in interface Schedulable