|
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.Exportable | +--edu.utah.janosvm.sys.TeamBackEnd
Kernel class used to represent a team, this is then extended internally with a nativeClass. The class is an Exportable since all instances of TeamBackEnd are allocated in the kernel team. The team they represent has a Team instance associated with the TeamBackEnd.
Team
,
TeamHandle
Field Summary | |
private static int |
_versionMajor
|
private static int |
_versionMinor
|
private static java.lang.String |
_versionName
Version info. |
private TeamEvent |
cpuOverdrawEvent
|
private boolean |
dying
Indicates whether or not the team is being terminated. |
private ExportManager |
em
The ExportManager for our object. |
(package private) static EventQueue |
eq
Queue for events handled by the kernel. |
(package private) static java.util.Stack |
eventPool
Fixed-size pool of pre-allocated TeamEvent objects. |
private ExportManager.ImportEnumerator |
ie
The ImportEnumerator for our ExportManager. |
private static ExportManager |
kernelManager
|
static java.lang.String |
kernelName
|
private static TeamBackEnd |
kernelTeam
Reference to the kernel team. |
(package private) static Team |
kernelTeamPeer
|
private java.lang.String |
name
|
private Team |
peer
The object local to the team's heap that contains per-team state specific to that team. |
Fields inherited from class edu.utah.janosvm.sys.Exportable |
anonManager, owner |
Constructor Summary | |
private |
TeamBackEnd()
Constructor used for the kernel team. |
(package private) |
TeamBackEnd(java.lang.String name,
ResourceSpec[] specs,
kaffe.util.Ptr nativeSpecs)
Create a user team with the given name and resources. |
Method Summary | |
(package private) boolean |
addDependency(TeamBackEnd dep)
Add a dependency to this team. |
(package private) static TeamEvent |
allocEvent()
|
private void |
anchorObject(java.lang.Object obj)
Anchor an object so the collector doesn't free it. |
private void |
broadcastTeamEvent(TeamEvent te)
Broadcast a TeamEvent to the list of objects importing this object. |
(package private) void |
deadTeamEvent()
Send a TeamEvent.DEAD event. |
private void |
doTheReap()
Native function that collects and returns the team's resources to the VM. |
(package private) void |
event(int event)
Trigger an event notification for this team. |
(package private) void |
finishTeamEvent()
Send a TeamEvent.FINISHED event. |
private void |
floatObject(java.lang.Object obj)
Float a previously anchored object. |
(package private) static void |
freeEvent(TeamEvent te)
|
(package private) java.lang.Object |
getClassLocal(java.lang.Class cl)
|
(package private) static java.lang.Object |
getCurrentClassLocal(java.lang.Class cl)
|
(package private) static TeamBackEnd |
getCurrentTeam()
Get the TeamBackEnd associated with the current thread. |
(package private) int |
getDaemonCount()
|
(package private) ExportManager |
getExportManager()
|
(package private) int |
getID()
Get the unique integer identifier for this team. |
(package private) static TeamBackEnd |
getKernelTeam()
|
(package private) java.lang.String |
getName()
|
(package private) static TeamBackEnd |
getObjectOwner(java.lang.Object obj)
|
(package private) Team |
getPeer()
Gets the Team peer associated with this TeamBackEnd. |
(package private) int |
getThreadCount()
|
void |
handleEvent(Event ev)
Handle the Event targeted to this object. |
private void |
nativeCage()
Native level cage code. |
private int |
nativeConstructor(java.lang.String name,
ResourceSpec[] specs,
kaffe.util.Ptr nativeSpecs)
Constructs the native part of the class. |
private void |
nativeTerminating()
Native level code to mark the start of termination. |
(package private) 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. |
(package private) boolean |
owns(java.lang.Object obj)
Tests to see if an object is owned by this team. |
(package private) static void |
popReservation(TeamReservation tr)
Pop the last TeamReservation off the stack. |
(package private) TeamReservation |
pushReservation()
|
(package private) TeamReservation |
pushReservation(int wrapCount)
|
(package private) static void |
returnFrom()
End a visit and return to the previous team. |
(package private) void |
setClassLocal(java.lang.Class cl,
java.lang.Object obj)
Store a per-team class local object. |
(package private) static void |
setCurrentClassLocal(java.lang.Class cl,
java.lang.Object obj)
|
(package private) void |
setDescription(java.lang.String desc)
|
(package private) void |
setExportManager(ExportManager em)
|
(package private) static void |
staticNativeInit(EventQueue eq,
java.lang.Thread th)
|
(package private) boolean |
switchTo()
Basic visit wrapper provided for code that operates directly on TeamBackEnds. |
(package private) boolean |
switchTo(int wrapCount)
Start a visit. |
(package private) void |
terminate()
Terminate this team, revoke all its exports, kill its threads and return its resources to the system. |
java.lang.String |
toString()
|
Methods inherited from class edu.utah.janosvm.sys.Exportable |
getAnonymousManager, pushOwnerReservation, returnFromOwner, setAnonymousManager, switchToOwner |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait, wait0 |
Field Detail |
private static final java.lang.String _versionName
private static final int _versionMajor
private static final int _versionMinor
private static TeamBackEnd kernelTeam
static final Team kernelTeamPeer
private static ExportManager kernelManager
public static final java.lang.String kernelName
static final EventQueue eq
static final java.util.Stack eventPool
private boolean dying
private ExportManager.ImportEnumerator ie
private ExportManager em
private Team peer
private TeamEvent cpuOverdrawEvent
private java.lang.String name
Constructor Detail |
private TeamBackEnd()
TeamBackEnd(java.lang.String name, ResourceSpec[] specs, kaffe.util.Ptr nativeSpecs) throws DuplicateResourceSpecException, IndexedResourceSpecException, DeadTeamException
name
- The name of the team.specs
- The specifications required by the team.nativeSpecs
- Native array of resource specifications.DuplicateResourceSpecException
- if the specs array
contains more than one ResourceSpec for the same resource.IndexedResourceSpecException
- if the one of the
ResourceSpec's couldn't be satisfied.Method Detail |
static void staticNativeInit(EventQueue eq, java.lang.Thread th)
static TeamEvent allocEvent()
static void freeEvent(TeamEvent te)
te
- A TeamEvent allocated with allocEvent.static TeamBackEnd getKernelTeam()
Team getPeer()
java.lang.String getName()
private int nativeConstructor(java.lang.String name, ResourceSpec[] specs, kaffe.util.Ptr nativeSpecs) throws DuplicateResourceSpecException
name
- The name of this team.specs
- The resources specifications for the team.boolean owns(java.lang.Object obj)
obj
- The object to test for ownership.static TeamBackEnd getObjectOwner(java.lang.Object obj)
boolean switchTo(int wrapCount) throws TeamEjectionException
returnFrom()
.wrapCount
- Indicates the number of wrapper functions around this
one. This is required so that we can record where visit take place and
can properly back out of them if an exception is thrown.returnFrom()
boolean switchTo() throws TeamEjectionException
static void returnFrom()
XXX this shouldn't be static. Just to make the symmetry a bit more apparent, if nothing else. Also would be a bit easier to add sanity checking code with a this pointer.
static TeamBackEnd getCurrentTeam()
int getID()
int getThreadCount()
int getDaemonCount()
void setDescription(java.lang.String desc)
desc
- A description of the contents of this team.private void anchorObject(java.lang.Object obj)
floatObject(Object)
private void floatObject(java.lang.Object obj)
anchorObject(Object)
private void doTheReap()
void event(int event)
event
- The TeamEvent number that indicates what event this is.void deadTeamEvent()
void finishTeamEvent()
private void nativeTerminating()
private void nativeCage()
void terminate()
If the calling thread is part of the team being terminated then this function will not return.
Note that termination is delayed by any active visits from other teams, so to provide quick termination all visits must be "short".
TeamReservation pushReservation(int wrapCount) throws DeadTeamException
wrapCount
- Indicates the number of wrapper functions around this
one. This is required so that we can record where pushes take place and
can properly back out of them if an exception is thrown.TeamReservation pushReservation() throws DeadTeamException
static void popReservation(TeamReservation tr)
tr
is just used as a sanity
check to make sure an intervening reservation hasn't been
skipped.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.static void setCurrentClassLocal(java.lang.Class cl, java.lang.Object obj)
java.lang.Object getClassLocal(java.lang.Class cl)
cl
- The class to retrieve the local object for.static java.lang.Object getCurrentClassLocal(java.lang.Class cl)
boolean addDependency(TeamBackEnd dep)
th
- The team this one should depend on.void notifyOnFinish()
void setExportManager(ExportManager em)
em
- The object thats managing this export.ExportManager getExportManager()
private void broadcastTeamEvent(TeamEvent te)
te
- The event to broadcast.public void handleEvent(Event ev)
EventHandler
handleEvent
in interface EventHandler
edu.utah.janosvm.sys.EventHandler
ev
- The Event to process.Event.setTarget(edu.utah.janosvm.sys.EventHandler)
public java.lang.String toString()
toString
in class Exportable
|
JanosVM v1.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |