JanosVM v0.6.0 Java API

## edu.utah.janosvm.sys
Class TeamReservation

    java.lang.Object
      |
      +--edu.utah.janosvm.sys.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;

    		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();
          }
     }

Author:
  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

### visit

    public void visit()
               throws TeamEjectionException

  Switch the current thread to the team encoded in this Reservation.

### leave

    public static void leave()

  Return to the previous team.

### pop

    public static void pop()

  Pop the last TeamReservation off the stack.

### toString

    public java.lang.String toString()

  Overrides:
    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: http://www.cs.utah.edu/flux/janos/
Generated on Mar 17, 2002