JanosVM v0.6.0 Java API Documentation: Class TeamReservation
JanosVM v0.6.0 Java API

Class TeamReservation


public class TeamReservation
extends java.lang.Object

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;

		// Do things in the context of 'otherTeam'
		obj = lookupSimpleFoo();

		// 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

Tim Stack, Utah Janos Team
See Also:
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
Switch the current thread to the team encoded in this Reservation.


public static void leave()
Return to the previous team.


public static void pop()
Pop the last TeamReservation off the stack.


public java.lang.String toString()
toString in class java.lang.Object

JanosVM v0.6.0 Java API

This documentation is Copyright (C) 2000-2002 The University of Utah. All Rights Reserved. See the documentation license for distribution terms and restrictions.
Documentation, software, and mailing lists for the JanosVM can be found at the Janos Project web page:
Generated on Mar 17, 2002