edu.utah.janosvm.sys
Class TeamHandle
java.lang.Object
|
+--edu.utah.janosvm.sys.ListNode
|
+--edu.utah.janosvm.sys.Importable
|
+--edu.utah.janosvm.sys.TeamHandle
- Direct Known Subclasses:
- Team
- public class TeamHandle
- extends Importable
- implements java.lang.Cloneable
Provides a safe handle to a Team. Technically, this points to the
kernel team's TeamBackEnd object that represents the team in
question.
- Author:
- Tim Stack, Utah Janos Team
- See Also:
TeamBackEnd
,
Team
Field Summary |
protected edu.utah.janosvm.sys.TeamBackEnd |
be
|
Fields inherited from interface java.lang.Cloneable |
KAFFE_VERSION |
Method Summary |
protected void |
bindTo(Exportable ex)
Bind this Importable to the given Exportable. |
void |
cancelImport(Importable im)
|
java.lang.Object |
clone()
Clone a ListNode. |
boolean |
equals(java.lang.Object obj)
|
int |
getID()
|
java.lang.String |
getName()
Get the name of the TeamBackEnd associated with this
TeamHandle handle. |
void |
importObject(Importable to,
java.lang.Object id)
|
boolean |
isTerminated()
|
boolean |
owns(java.lang.Object obj)
Test if the given object is owned by this TeamHandle. |
static void |
popReservation()
Pop the last TeamReservation off the stack. |
TeamReservation |
pushReservation()
Create a new reservation that reserves the TeamHandle this object
points to. |
static void |
returnFrom()
End a visit to this TeamHandle. |
void |
switchTo()
Start a visit to the TeamHandle this object points to. |
void |
terminate()
Terminate the team referenced by this handle. |
java.lang.String |
toString()
|
protected void |
unbindFrom()
Unbind this Importable from any objects its referencing. |
Methods inherited from class java.lang.Object |
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
be
protected edu.utah.janosvm.sys.TeamBackEnd be
TeamHandle
protected TeamHandle()
bindTo
protected void bindTo(Exportable ex)
- Description copied from class: Importable
- Bind this Importable to the given Exportable. The most common
implementation of this method would be to cast the Exportable to the
type that the Importable subclass handles and store it in the object as
well as any other handy pointers/values.
- Overrides:
- bindTo in class Importable
- Tags copied from class: Importable
- Parameters:
ex
- The Exportable that is being imported.
unbindFrom
protected void unbindFrom()
- Description copied from class: Importable
- Unbind this Importable from any objects its referencing. The most
common implementation of this method would be null out any object
references in this object.
- Overrides:
- unbindFrom in class Importable
equals
public boolean equals(java.lang.Object obj)
- Overrides:
- equals in class java.lang.Object
getName
public java.lang.String getName()
- Get the name of the TeamBackEnd associated with this
TeamHandle handle.
- Returns:
- A copy of the TeamHandle's name.
getID
public int getID()
- Returns:
- The unique integer identifier for this TeamHandle.
owns
public boolean owns(java.lang.Object obj)
- Test if the given object is owned by this TeamHandle.
- Parameters:
obj
- The object to test for ownership.- Returns:
- True if this TeamHandle owns the object.
terminate
public void terminate()
- Terminate the team referenced by this handle.
This will clean up all
the importables and exportables owned by the
team and schedule all of its threads for
destruction.
If the calling thread is owned by the team being
terminated, this function will not return.
Active visits to the team being terminated will
delay termination until all the visits have been completed.
- See Also:
TeamBackEnd#terminate()
isTerminated
public boolean isTerminated()
importObject
public void importObject(Importable to,
java.lang.Object id)
throws NoSuchExportException
cancelImport
public void cancelImport(Importable im)
pushReservation
public TeamReservation pushReservation()
throws DeadTeamException
- Create a new reservation that reserves the TeamHandle this object
points to. The reservation remains "active" until
popReservation()
is invoked by the current thread.
Unlike a switchTo(), this call does not implicitly switch context
to the other TeamHandle. That is done by invoking use on the
TeamReservation instance returned by this call.
- Returns:
- A TeamReservation object that reserves this TeamHandle.
- See Also:
switchTo()
,
TeamBackEnd#pushReservation(int)
,
TeamReservation.visit()
,
TeamReservation.leave()
switchTo
public void switchTo()
throws DeadTeamException,
TeamEjectionException
- Start a visit to the TeamHandle this object points to. While the
visit is active, neither TeamHandle can be terminated, so object
references in either TeamHandle can be manipulated. Write-barriers
are also disabled during this sequence. The visit ends
when
returnFromTeam()
is invoked.
- See Also:
returnFrom()
,
TeamBackEnd#switchTo(int)
returnFrom
public static void returnFrom()
- End a visit to this TeamHandle.
- See Also:
switchTo()
,
TeamBackEnd#returnFrom()
popReservation
public static void popReservation()
- Pop the last TeamReservation off the stack.
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Description copied from class: ListNode
- Clone a ListNode. The node is cloned in isolation;
the clone is never on a list, regardless of the state
of the original.
- Overrides:
- clone in class ListNode
This documentation is Copyright (C) 2000-2001 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 Jun 1, 2001