java.lang.isolate
Class IsolateEvent

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

public class IsolateEvent
extends Object

Isolate events represent state changes in an isolate life cycle. Isolate events are issued when the source isolate changes its execution state (to IsolateEvent.Type.STARTING, IsolateEvent.Type.EXITING, and finally IsolateEvent.Type.TERMINATED). Isolate events are initially delivered on a Link associated with the source isolate and obtained via newEventLink() but may be forwarded over other links subsequently.

All events have a Type (see getType()) and provide an Isolate reference to the isolate associated with the event (see getIsolate()). In addition, for the IsolateEvent.Type.STARTING event a reference to the starting isolate is available via getStarter(). The IsolateEvent.Type.TERMINATED events have an integer exit status available via getExitStatus() associated with them and exit reason codes available via getExitReason(). The IsolateEvent.Type.EXITING event has no additional information.

See Also:
Isolate.newEventLink()

Nested Class Summary
static class IsolateEvent.ExitReason
          Provides information about how an isolate became terminated.
static class IsolateEvent.Type
          Define the types of an IsolateEvent that can be generated.
 
Method Summary
 boolean equals(Object obj)
          Tests this IsolateEvent for equality with the given object.
 IsolateEvent.ExitReason getExitReason()
          Gets information about how the source isolate died.
 int getExitStatus()
          Gets the exit status of the source Isolate.
 java.lang.isolate.Isolate getIsolate()
          Gets the source Isolate instance associated with this IsolateEvent.
 java.lang.isolate.Isolate getStarter()
          Get the isolate which invoked Isolate.start on the source isolate (i.e., the "parent" or "creator" isolate of the source isolate).
 IsolateEvent.Type getType()
          Gets the type of this event.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getIsolate

public java.lang.isolate.Isolate getIsolate()
Gets the source Isolate instance associated with this IsolateEvent. The source isolate is the one that is starting, exiting, or terminating.

This method cannot return null.

Returns:
source Isolate associated with this event

getType

public IsolateEvent.Type getType()
Gets the type of this event. Type values are one of IsolateEvent.Type.STARTING, IsolateEvent.Type.EXITING, or IsolateEvent.Type.TERMINATED.

Returns:
the type of this event

getExitStatus

public int getExitStatus()
Gets the exit status of the source Isolate. Only applicable for an IsolateEvent.Type.TERMINATED event.

Returns:
the exit status of the source isolate
Throws:
IllegalStateException - if not a TERMINATED event

getStarter

public java.lang.isolate.Isolate getStarter()
Get the isolate which invoked Isolate.start on the source isolate (i.e., the "parent" or "creator" isolate of the source isolate). Only applicable for an IsolateEvent.Type.STARTING event.

Returns:
the isolate which started the source isolate
Throws:
IllegalStateException - if not a STARTING event

getExitReason

public IsolateEvent.ExitReason getExitReason()
Gets information about how the source isolate died. Only applicable for a IsolateEvent.Type.TERMINATED event.

Returns:
the exit status of the source isolate
Throws:
IllegalStateException - if not a TERMINATED event

equals

public boolean equals(Object obj)
Tests this IsolateEvent for equality with the given object. Returns true if and only if obj is not null and is an IsolateEvent containing the same event type and refers to the same source isolate.

Overrides:
equals in class Object
Parameters:
obj - The object to be compared
Returns:
true if the objects are the same; false otherwise