JanosVM v0.6.0 Java API Documentation: Class TeamReservation
|
JanosVM v0.6.0 Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.utah.janosvm.sys.TeamReservation
Record a reservation with another team. A TeamReservation is a link between two teams that prevents either from being terminated. A TeamReservation is more flexible than TeamHandle.switchTo, as the termination-delaying time can be expanded to include more than the context switch to the other team. Here's an example:
NOTE: TeamReservation objects are a bit odd since they are
never explicitly created. They are only implicitly created by the JanosVM
due to a call to team.pushReservation()
.
{ TeamReservation act; ... act = otherTeam.pushReservation(); if (act != null) { Object obj; act.visit(); // Do things in the context of 'otherTeam' obj = lookupSimpleFoo(); act.leave(); // Do things in original context, but guarantee that // otherTeam will not go away ... Reservation still active. Object localObj = new Foo(obj); // End the Reservation, as we're done with all pointers into otherTeam Team.popReservation(); } }
TeamHandle.pushReservation()
,
TeamHandle.popReservation()
,
TeamHandle.switchTo()
Method Summary | |
static void |
leave()
Return to the previous team. |
static void |
pop()
Pop the last TeamReservation off the stack. |
java.lang.String |
toString()
|
void |
visit()
Switch the current thread to the team encoded in this Reservation. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Method Detail |
public void visit() throws TeamEjectionException
public static void leave()
public static void pop()
public java.lang.String toString()
|
JanosVM v0.6.0 Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |