|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbp.BProgram
public class BProgram
Field Summary | |
---|---|
(package private) static java.util.TreeMap<java.lang.Double,BThread> |
allBThreads
A set containing all the b-threads in the system. |
(package private) static int |
busyBThreads
A counter that counts how many of the b-thread is allBThreads are busy. |
static int |
eventCounter
A variable counting the number of events fired since the beginning of the execution |
static Event |
lastEvent
A variable containing the last fired event, for reference. |
Constructor Summary | |
---|---|
BProgram()
|
Method Summary | |
---|---|
static BThread |
add(BThread bt,
java.lang.Double priority)
Add a scenario. |
private static boolean |
awakeWaitingBThreads(BThread thisBT)
Awake or interrupt all scenarios that are affected by lastEvent. |
protected static void |
bpSync(BThread bt)
Wait for the next event. |
private static void |
chooseNextEvent()
Choose the next event to be fired. |
private static boolean |
isBlocked(Event e)
A function that checks if an event is blocked by some scenario. |
(package private) static void |
printAllScenarios()
Utility function (for debugging purposes) that prints the ordered list of active scenarios. |
static void |
startAll()
Start all added scenarios. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static java.util.TreeMap<java.lang.Double,BThread> allBThreads
static int busyBThreads
public static int eventCounter
public static Event lastEvent
Constructor Detail |
---|
public BProgram()
Method Detail |
---|
public static BThread add(BThread bt, java.lang.Double priority) throws DuplicatedPrioritiesException
DuplicatedPrioritiesException
private static boolean awakeWaitingBThreads(BThread thisBT)
protected static void bpSync(BThread bt) throws java.lang.InterruptedException
bt
- The b-thread that called this function.
java.lang.InterruptedException
NotAScenarioException
- Raised if the current context is not a scenario.
java.lang.InterruptedException
- Raised when an outside thread interrupts this scenario.private static void chooseNextEvent()
private static boolean isBlocked(Event e)
e
- An event.
static void printAllScenarios()
public static void startAll()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |