JanosVM v1.0 API

java.lang.isolate
Class Isolate

java.lang.Object
  |
  +--java.lang.isolate.Isolate

public final class Isolate
extends java.lang.Object

Author:
Pat Tullmann

Inner Class Summary
(package private)  class Isolate.IsolateEventHandler
           
 
Field Summary
(package private) static AggregateStateManager aggregateStateManager
          Global status (mapping isolate handles to starter/exit status)
private static java.lang.String bootclassPath
           
private static IsolatePermission CONTEXT_PERMISSION
           
private static IsolatePermission CONTROL_PERMISSION
           
private static IsolatePermission CREATE_PERMISSION
           
private static java.lang.String[] defaultClassPath
          Default class path for new Isolates.
private  java.lang.Long guid
           
private static IsolateGUID guidManager
          Global Isolate GUID manager.
(package private)  Isolate.IsolateEventHandler handler
           
private static java.lang.Class isolateBackEndClass
           
private static java.lang.Class isolateClass
           
private  IsolateState remoteState
          State of remote Isolate.
private  AggregateStateManager.IsolateStatusHandle statusHandle
          Handle on the global isolate status.
private  EventTeamHandle teamH
          Handle on the Team associated with this Isolate (local or remote).
 
Constructor Summary
(package private) Isolate(java.lang.Long guid, EventTeamHandle t)
          Constructor for creating an Isolate object that refers to the given Team (and implicitly that Team's IsolateBackEnd).
  Isolate(java.lang.String mainClass, java.lang.String[] mainArgs)
           
  Isolate(java.lang.String mainClass, java.lang.String[] mainArgs, java.util.prefs.TransientPreferences context, IsolateMessage stdin, IsolateMessage stdout, IsolateMessage stderr)
           
 
Method Summary
private  java.lang.Object[] checkArray(java.lang.Object[] arr)
          Copy given array so that mutations to it will not work around safety and security checks on the contents.
private static void childSidePrefsFixup(java.util.prefs.TransientPreferences context)
           
(package private)  Isolate clone(TeamHandle source, TeamHandle current)
           
private  java.util.prefs.TransientPreferences cloneContext(TeamReservation inittr, java.util.prefs.TransientPreferences parentPrefs)
          Deeply clone the context.
private  void cloneContextNode(TeamReservation inittr, java.util.prefs.TransientPreferences parentPrefs, java.util.prefs.TransientPreferences childPrefs)
           
private static java.lang.Long cloneLong(java.lang.Long l)
           
private static IsolateMessage cloneMessage(IsolateMessage m, TeamHandle source, TeamHandle current)
           
(package private) static java.lang.String cloneString(java.lang.String s)
           
private static java.lang.String[] cloneStringArray(java.lang.String[] s)
           
static Isolate currentIsolate()
           
static java.util.prefs.TransientPreferences currentIsolateContext()
           
static IsolateMessage[] currentIsolateIOBindings()
           
static IsolateMessage[] currentIsolateStartMessages()
          Retrieve the available IsolateMessage objects for the currently running isolate.
private  void doShutdown(boolean doHalt, int status)
           
 boolean equals(java.lang.Object other)
           
 void exit(int status)
          Equivalent to this Isolate calling Runtime.exit() or System.exit.
protected  void finalize()
          Drop the ref count in the global status map when the Isolate handle is collected.
private  void fixupImmutablePrefs(java.util.prefs.TransientPreferences childPrefs)
           
private static java.lang.String[] getClassPath(java.util.prefs.TransientPreferences context, java.lang.String[] defcp)
           
(package private)  java.lang.Long getGUID()
           
(package private)  TeamHandle getTeamHandle()
          May return null.
 void halt(int status)
           
 boolean hasExited()
           
 int hashCode()
          Returns the hashcode for this Isolate
 boolean hasStarted()
           
 boolean hasTerminated()
           
private  void installDefaultPrefs(java.util.prefs.TransientPreferences childPrefs)
           
(package private)  boolean isCurrent()
           
(package private) static java.lang.String isolateName(java.lang.Long guid)
           
private static FileSystemSpec makeFileSystemSpec(java.util.prefs.TransientPreferences tp)
           
private  IsolateMessage makeStdioMessage(java.lang.String spec, IsolateMessage rawSourceMessage)
          We must create a clone of the given type of IsolateMessage but as a wrapper for the fd in the given spec.
private static StdioSpec makeStdioSpec(IsolateMessage stdin, IsolateMessage stdout, IsolateMessage stderr)
          XXX race condition between copying an FD out of the isolate message and then that fd being closed and something completely unrelated being re-opened on that FD before we get to the resource subscription.
 Link newEventLink()
           
(package private) static Isolate newHandle(java.lang.Long guid)
           
 void start(IsolateMessage[] messages)
           
private static java.lang.String stringifyStrArray(java.lang.String[] paths)
           
 java.lang.String toString()
           
private  void updateRemoteState()
           
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait, wait0
 

Field Detail

guidManager

private static final IsolateGUID guidManager
Global Isolate GUID manager.

aggregateStateManager

static final AggregateStateManager aggregateStateManager
Global status (mapping isolate handles to starter/exit status)

isolateBackEndClass

private static final java.lang.Class isolateBackEndClass

isolateClass

private static final java.lang.Class isolateClass

bootclassPath

private static final java.lang.String bootclassPath

CREATE_PERMISSION

private static final IsolatePermission CREATE_PERMISSION

CONTROL_PERMISSION

private static final IsolatePermission CONTROL_PERMISSION

CONTEXT_PERMISSION

private static final IsolatePermission CONTEXT_PERMISSION

guid

private final java.lang.Long guid

statusHandle

private final AggregateStateManager.IsolateStatusHandle statusHandle
Handle on the global isolate status. This handle is always valid until the owner (not the target) is dead, or the owner GC's this Isolate object.

defaultClassPath

private static final java.lang.String[] defaultClassPath
Default class path for new Isolates.

handler

final Isolate.IsolateEventHandler handler

remoteState

private IsolateState remoteState
State of remote Isolate. This is not always correct, though the remote Isolate should never be in an "earlier" life state than this state. XXX is this at all useful? I guess if its "DEAD", then you can do everything locally...

teamH

private EventTeamHandle teamH
Handle on the Team associated with this Isolate (local or remote).
Constructor Detail

Isolate

public Isolate(java.lang.String mainClass,
               java.lang.String[] mainArgs)
        throws IsolateStartupException

Isolate

public Isolate(java.lang.String mainClass,
               java.lang.String[] mainArgs,
               java.util.prefs.TransientPreferences context,
               IsolateMessage stdin,
               IsolateMessage stdout,
               IsolateMessage stderr)
        throws IsolateStartupException

Isolate

Isolate(java.lang.Long guid,
        EventTeamHandle t)
Constructor for creating an Isolate object that refers to the given Team (and implicitly that Team's IsolateBackEnd).
Method Detail

stringifyStrArray

private static java.lang.String stringifyStrArray(java.lang.String[] paths)

cloneLong

private static java.lang.Long cloneLong(java.lang.Long l)

cloneString

static java.lang.String cloneString(java.lang.String s)

cloneStringArray

private static java.lang.String[] cloneStringArray(java.lang.String[] s)

installDefaultPrefs

private void installDefaultPrefs(java.util.prefs.TransientPreferences childPrefs)

fixupImmutablePrefs

private void fixupImmutablePrefs(java.util.prefs.TransientPreferences childPrefs)

cloneContextNode

private void cloneContextNode(TeamReservation inittr,
                              java.util.prefs.TransientPreferences parentPrefs,
                              java.util.prefs.TransientPreferences childPrefs)
                       throws TeamEjectionException

cloneContext

private java.util.prefs.TransientPreferences cloneContext(TeamReservation inittr,
                                                          java.util.prefs.TransientPreferences parentPrefs)
                                                   throws TeamEjectionException
Deeply clone the context. Also installs default values (before the clone) and fixes up immutable values (after the clone). Does *not* remove the java.properties node (that is removed inside the new isolate initialization code after it defines the system settings.)

cloneMessage

private static IsolateMessage cloneMessage(IsolateMessage m,
                                           TeamHandle source,
                                           TeamHandle current)

makeStdioSpec

private static StdioSpec makeStdioSpec(IsolateMessage stdin,
                                       IsolateMessage stdout,
                                       IsolateMessage stderr)
                                throws IsolateStartupException
XXX race condition between copying an FD out of the isolate message and then that fd being closed and something completely unrelated being re-opened on that FD before we get to the resource subscription.

makeFileSystemSpec

private static FileSystemSpec makeFileSystemSpec(java.util.prefs.TransientPreferences tp)

getClassPath

private static java.lang.String[] getClassPath(java.util.prefs.TransientPreferences context,
                                               java.lang.String[] defcp)

newHandle

static Isolate newHandle(java.lang.Long guid)

checkArray

private java.lang.Object[] checkArray(java.lang.Object[] arr)
Copy given array so that mutations to it will not work around safety and security checks on the contents.

makeStdioMessage

private IsolateMessage makeStdioMessage(java.lang.String spec,
                                        IsolateMessage rawSourceMessage)
                                 throws java.io.IOException
We must create a clone of the given type of IsolateMessage but as a wrapper for the fd in the given spec.

childSidePrefsFixup

private static void childSidePrefsFixup(java.util.prefs.TransientPreferences context)

start

public void start(IsolateMessage[] messages)
           throws java.lang.IllegalStateException,
                  IsolateStartupException

currentIsolateIOBindings

public static IsolateMessage[] currentIsolateIOBindings()

currentIsolateStartMessages

public static IsolateMessage[] currentIsolateStartMessages()
Retrieve the available IsolateMessage objects for the currently running isolate.

doShutdown

private void doShutdown(boolean doHalt,
                        int status)
                 throws java.lang.SecurityException

exit

public void exit(int status)
          throws java.lang.SecurityException,
                 java.lang.IllegalStateException
Equivalent to this Isolate calling Runtime.exit() or System.exit.
Parameters:
Termination - status. By convention, a nonzero status code indicates abnormal termination.
Throws:
java.lang.SecurityException - if security policy does not permit exiting this Isolate.
java.lang.IllegalStateException - if this isolate is terminated

halt

public void halt(int status)
          throws java.lang.SecurityException,
                 java.lang.IllegalStateException

updateRemoteState

private void updateRemoteState()

newEventLink

public Link newEventLink()
                  throws ClosedLinkException

hasStarted

public boolean hasStarted()

hasExited

public boolean hasExited()

hasTerminated

public boolean hasTerminated()

currentIsolate

public static Isolate currentIsolate()

isCurrent

boolean isCurrent()

currentIsolateContext

public static java.util.prefs.TransientPreferences currentIsolateContext()

hashCode

public int hashCode()
Returns the hashcode for this Isolate
Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode

getGUID

java.lang.Long getGUID()

getTeamHandle

TeamHandle getTeamHandle()
May return null.

clone

Isolate clone(TeamHandle source,
              TeamHandle current)

isolateName

static java.lang.String isolateName(java.lang.Long guid)

toString

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

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

finalize

protected void finalize()
Drop the ref count in the global status map when the Isolate handle is collected. If finalizer is invoked on a never-started isolate, then clean up the team.
Overrides:
finalize in class java.lang.Object

JanosVM v1.0 API

This documentation is Copyright (C) 2000-2003 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 Feb 13, 2003