|
JanosVM v1.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.utah.janosvm.sys.ListNode | +--edu.utah.janosvm.sys.Importable | +--edu.utah.janosvm.sys.TeamHandle | +--edu.utah.janosvm.sys.EventTeamHandle | +--edu.utah.janosvm.sys.Team
Peer object for a TeamBackEnd. An instance of a Team
is created inside each team to contain that team's local
data. Specifically, this class keeps track of the cross-team
references
coming from its team. Team objects are never created
directly, they are created implicitly as a side-effect
of the static method create(edu.utah.janosvm.sys.TeamHandle, java.lang.String, edu.utah.janosvm.resources.ResourceSpec[], kaffe.util.Ptr)
.
The association with the TeamBackEnd in the kernel team is implicit (through TeamBackEnd.getCurrentTeam()).
Because this class extends TeamHandle, it is importable.
A new Team is entirely passive. No threads are created in the
team, nor are any threads required to be created. Threads from
some other team must {@linkplain TeamHandle#switchTo visit} the new
team and create threads in it, if an active Team is desired.
Because a passive Team is perfectly legitimate, Teams do not
automatically exit when all non-daemon threads have exited. See
notifyOnFinish()
.
TeamBackEnd
,
TeamHandle
Field Summary | |
private java.lang.String |
description
A description of the contents of the team. |
private TeamHandle |
kernel
The cached kernel team handle. |
private java.util.Hashtable |
locals
Hashtable for TeamLocals. |
private PortAuthority |
pa
The manager of any cross team references. |
Fields inherited from class edu.utah.janosvm.sys.EventTeamHandle |
eventMask, teh |
Fields inherited from class edu.utah.janosvm.sys.TeamHandle |
be |
Fields inherited from class edu.utah.janosvm.sys.Importable |
em |
Fields inherited from class edu.utah.janosvm.sys.ListNode |
pred, succ |
Constructor Summary | |
(package private) |
Team()
|
(package private) |
Team(ExportManager kernelManager)
Construct a Team object. |
Method Summary | |
boolean |
addDependency(TeamHandle th)
Add a dependency to this team. |
static TeamHandle |
create()
Create a new team. |
static TeamHandle |
create(ResourceSpec[] specs)
Create a new team. |
static TeamHandle |
create(java.lang.String name)
Create a new team. |
static TeamHandle |
create(java.lang.String name,
ResourceSpec[] specs)
Create a new team. |
static TeamHandle |
create(TeamHandle th,
ResourceSpec[] specs)
Create a new team. |
static TeamHandle |
create(TeamHandle th,
java.lang.String name,
ResourceSpec[] specs)
Create a new team. |
private static TeamHandle |
create(TeamHandle handle,
java.lang.String name,
ResourceSpec[] specs,
kaffe.util.Ptr nativeSpecs)
|
static Team |
current()
|
ExportManager |
exportAnonymousObject(Exportable ex)
|
ExportManager |
exportObject(java.lang.Object id,
Exportable ex)
|
static TeamHandle |
find(java.lang.String name)
Get a handle on the Team with the given name. |
static TeamHandle |
find(TeamHandle th,
java.lang.String name)
Get a handle on the Team with the given name. |
(package private) static TeamHandle |
find(TeamHandle th,
TeamBackEnd be)
|
java.lang.Object |
getClassLocal(java.lang.Class cl)
Get the team-local object associated with the given class in this team. |
static java.lang.Object |
getCurrentClassLocal(java.lang.Class cl)
Get the team-local object associated with the given class in the current team. |
java.lang.String |
getDescription()
Get the Team's description string. |
TeamHandle |
getKernelTeam()
Get a handle on the kernel team. |
(package private) java.util.Hashtable |
getLocals()
|
PortAuthority |
getPortAuthority()
Get the PortAuthority for the current team. |
void |
notifyOnFinish()
Set the flag on the team object that indicates that the last non-daemon thread in the team should send out a TeamEvent.FINISHED event when it dies. |
ExportManager |
reserveExportID(java.lang.Object id)
|
void |
revokeAnonymousObject(Exportable ex)
|
void |
revokeObject(java.lang.Object id)
XXX rename to revokeExport |
void |
sendEvent(int type)
Send a user-defined event to all EventTeamHandles that are registered to listen for user events. |
void |
setClassLocal(java.lang.Class cl,
java.lang.Object obj)
Associate the given object with the given class in this team. |
static void |
setCurrentClassLocal(java.lang.Class cl,
java.lang.Object obj)
Associate the given object with the given class in the current team. |
void |
setDescription(java.lang.String str)
|
(package private) void |
setKernelHandle(ExportManager kernelManager)
|
java.lang.String |
toString()
|
Methods inherited from class edu.utah.janosvm.sys.EventTeamHandle |
clone, event, getEventHandler, setEventHandler |
Methods inherited from class edu.utah.janosvm.sys.TeamHandle |
bindTo, cancelImport, equals, getDaemonCount, getID, getName, getThreadCount, importObject, isTerminated, owns, popReservation, pushReservation, returnFrom, switchTo, terminate, unbindFrom |
Methods inherited from class edu.utah.janosvm.sys.Importable |
copy, finalize, getExportManager, revoke, setExportManager |
Methods inherited from class edu.utah.janosvm.sys.ListNode |
append, inList, prepend, remove |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait, wait0 |
Field Detail |
private final PortAuthority pa
private final java.util.Hashtable locals
private final TeamHandle kernel
private java.lang.String description
Constructor Detail |
Team()
Team(ExportManager kernelManager)
NOTE: For kernel use only; there is only one of these objects per team.
Method Detail |
private static TeamHandle create(TeamHandle handle, java.lang.String name, ResourceSpec[] specs, kaffe.util.Ptr nativeSpecs) throws DuplicateExportException, ResourceSpecException, DeadTeamException
public static TeamHandle create(TeamHandle th, java.lang.String name, ResourceSpec[] specs) throws DuplicateExportException, ResourceSpecException, DeadTeamException
th
.public static TeamHandle create(java.lang.String name, ResourceSpec[] specs) throws DuplicateExportException, ResourceSpecException, DeadTeamException
Team.create
(null, name, specs)
.public static TeamHandle create(TeamHandle th, ResourceSpec[] specs) throws ResourceSpecException, DeadTeamException
Team.create
(th, null, specs)
.public static TeamHandle create(java.lang.String name) throws DuplicateExportException, ResourceSpecException, DeadTeamException
Team.create
(null, name, null)
.public static TeamHandle create(ResourceSpec[] specs) throws ResourceSpecException, DeadTeamException
Team.create
(null, null, specs)
.public static TeamHandle create() throws ResourceSpecException, DeadTeamException
Team.create
(null, null, null)
.public static Team current()
public static TeamHandle find(TeamHandle th, java.lang.String name) throws DeadTeamException, TeamEjectionException, NoSuchExportException
null
name cannot be found this way.th
- The TeamHandle
to initialize.name
- The name of the TeamHandle to locate.TeamHandle
th
, or null
NoSuchExportException
- if name is null
or emptypublic static TeamHandle find(java.lang.String name) throws DeadTeamException, TeamEjectionException, NoSuchExportException
null
name cannot be found this way.name
- The name of the TeamHandle to locate.TeamHandle
object that imports the TeamBackEnd with
the given name.NoSuchExportException
- if name is null
or emptystatic TeamHandle find(TeamHandle th, TeamBackEnd be)
void setKernelHandle(ExportManager kernelManager)
public void setDescription(java.lang.String str)
str
- A string that describes this team.public java.lang.String getDescription()
TeamHandle
getDescription
in class TeamHandle
public TeamHandle getKernelTeam()
public PortAuthority getPortAuthority()
PortAuthority
for the current team.PortAuthority
for the current team.public ExportManager reserveExportID(java.lang.Object id) throws DuplicateExportException
PortAuthority.reserveExportID(java.lang.Object)
public ExportManager exportObject(java.lang.Object id, Exportable ex) throws DuplicateExportException
PortAuthority.exportObject(java.lang.Object, edu.utah.janosvm.sys.Exportable)
public void revokeObject(java.lang.Object id) throws NoSuchExportException
public ExportManager exportAnonymousObject(Exportable ex)
public void revokeAnonymousObject(Exportable ex) throws NoSuchExportException
java.util.Hashtable getLocals()
public void setClassLocal(java.lang.Class cl, java.lang.Object obj)
cl
- The class the object should be stored with.obj
- The object to store with the class.getClassLocal(java.lang.Class)
,
setCurrentClassLocal(java.lang.Class, java.lang.Object)
public static void setCurrentClassLocal(java.lang.Class cl, java.lang.Object obj)
cl
- The class the object should be stored with.obj
- The object to store with the class.getCurrentClassLocal(java.lang.Class)
,
setClassLocal(java.lang.Class, java.lang.Object)
public java.lang.Object getClassLocal(java.lang.Class cl)
cl
- The class to retrieve the local object for.null
.getCurrentClassLocal(java.lang.Class)
,
setClassLocal(java.lang.Class, java.lang.Object)
public static java.lang.Object getCurrentClassLocal(java.lang.Class cl)
cl
- The class to retrieve the local object for.null
.getClassLocal(java.lang.Class)
,
setCurrentClassLocal(java.lang.Class, java.lang.Object)
public boolean addDependency(TeamHandle th)
th
- The team this one should depend on.public void notifyOnFinish()
TeamEventHandler
with this Team,
termination-on-last-non-daemon-thread-exiting semantics can be
achived by terminating the team when that event is received.TeamEvent
,
EventTeamHandle
public void sendEvent(int type)
type
- must be one of TeamEvent.USER1
, TeamEvent.USER2
, or TeamEvent.USER3
public java.lang.String toString()
toString
in class EventTeamHandle
|
JanosVM v1.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |