one.world.env
Class EnvironmentEvent

java.lang.Object
  |
  +--one.world.core.Tuple
        |
        +--one.world.core.Event
              |
              +--one.world.util.TypedEvent
                    |
                    +--one.world.env.EnvironmentEvent
All Implemented Interfaces:
Cloneable, Serializable

public final class EnvironmentEvent
extends TypedEvent

Implementation of an environment event. Environment events, together with create, load, move, rename, and restore requests as well as check-point responses, define the interaction between components and environments. All environment events, as well as the requests and responses listed above, identify relevant environments by their ID instead of through a direct reference. As a result, environment events can be transmitted over the network.

The operations on environments are:

Legal operations on environments are limited by the hierarchy of environments. An environment can only see the environments underneath it and it can only perform operations on these environments.

Version:
$Revision: 1.11 $
See Also:
AcceptRequest, CreateRequest, CheckPointResponse, LoadRequest, MoveRequest, RenameRequest, RestoreRequest, Serialized Form

Field Summary
static int ACTIVATE
          The type code for activating an environment.
static int ACTIVATED
          The type code for an activated environment.
static int CHECK_POINT
          The type code for check-pointing an environment.
static int CLONED
          The type code for a cloned environment.
static int CREATED
          The type code for a created environment.
static int DESTROY
          The type code for destroying an environment.
static int DESTROYED
          The type code for a destroyed environment.
 Guid ident
          The ID of the environment for this environment event.
static int LOADED
          The type code for a loaded environment.
static int MOVED
          The type code for a moved environment.
static int RENAMED
          The type code for a renamed environment.
static int RESTORED
          The type code for a restored environment.
static int STOP
          The type code for stopping an environment.
static int STOPPED
          The type code for a stopped environment.
static int TERMINATE
          The type code for terminating an environment.
static int TERMINATED
          The type code for a terminated environment.
static int UNLOAD
          The type code for unloading code from an environment.
static int UNLOADED
          The type code for an unloaded environment.
 
Fields inherited from class one.world.util.TypedEvent
type
 
Fields inherited from class one.world.core.Event
closure, source
 
Fields inherited from class one.world.core.Tuple
CLOSURE, id, ID, META_DATA, metaData, SOURCE
 
Constructor Summary
EnvironmentEvent()
          Create a new, empty environment event.
EnvironmentEvent(EventHandler source, Object closure, int type, Guid ident)
          Create a new environment event.
 
Method Summary
 String toString()
          Get a string representation of this environment event.
 void validate()
          Validate this environment event.
 
Methods inherited from class one.world.core.Tuple
clone, containsNonSymbolicHandler, equals, fields, get, getMetaData, getType, hasField, hashCode, hasMetaData, remove, set, setMetaData, wrap
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CREATED

public static final int CREATED
The type code for a created environment. Created events confirm a created environment and are sent to the source of the corresponding create request.
See Also:
CreateRequest

LOADED

public static final int LOADED
The type code for a loaded environment. Loaded events confirm that an initializer has been loaded into an environment and are sent to the source of the corresponding load request.
See Also:
LoadRequest

ACTIVATE

public static final int ACTIVATE
The type code for activating an environment. Activate events request to activate an environment and are sent to an environment's request handler.
See Also:
ACTIVATED, Environment.activate(Guid,Guid)

ACTIVATED

public static final int ACTIVATED
The type code for an activated environment. Activated events confirm the activation of an environment and are sent to the main event handler of the environment that has been activated as well as to the source of the corresponding activate event. Note that environments can be implicitly activated as a result of a create request.
See Also:
ACTIVATE

CHECK_POINT

public static final int CHECK_POINT
The type code for check-pointing an environment. Check-point events request to check-point an environment and all its descendants and are sent to an environment's request handler.
See Also:
CheckPointResponse, Environment.checkPoint(Guid,Guid)

RESTORED

public static final int RESTORED
The type code for a restored environment. Restored events confirm the restoration of an environment from a previously stored check-point and are sent to the source of the corresponding restore request as well as to all active environments that have been restored from the check-point.
See Also:
RestoreRequest

MOVED

public static final int MOVED
The type code for a moved environment. Moved events confirm that an environment and all its descendants have been moved and are sent to the source of the corresponding move request. They are also sent to all active environments that have been moved, if they have been moved to a new node.
See Also:
MoveRequest

CLONED

public static final int CLONED
The type code for a cloned environment. Cloned events notify an environment that it has been cloned from another and are sent to all active environments that were newly generated as part of a cloning move operation.
See Also:
MoveRequest

RENAMED

public static final int RENAMED
The type code for a renamed environment. Renamed events confirm the renaming of an environment and are sent to the source of the corresponding rename request.
See Also:
RenameRequest

TERMINATE

public static final int TERMINATE
The type code for terminating an environment. Terminate events request that an environment be terminated and are sent an environment's request handler.
See Also:
TERMINATED, Environment.terminate(Guid,Guid)

TERMINATED

public static final int TERMINATED
The type code for a terminated environment. Terminated events confirm that an environment has been terminated and are sent to the source of the corresponding terminate event. If an environment requested to terminate itself, no terminated event is posted.
See Also:
TERMINATE

UNLOAD

public static final int UNLOAD
The type code for unloading code from an environment. Unload events request that an environment unlink its imported main and monitor handlers and are sent to an environment's request handler.
See Also:
UNLOADED, Environment.unload(Guid,Guid)

UNLOADED

public static final int UNLOADED
The type code for an unloaded environment. Unloaded events confirm that an environment has unloaded its code and are sent to the source of the corresponding unload event.

DESTROY

public static final int DESTROY
The type code for destroying an environment. Destroy events request that an environment and all its descendants be destroyed and are sent to an environment's request handler.
See Also:
DESTROYED, Environment.destroy(Guid,Guid)

DESTROYED

public static final int DESTROYED
The type code for a destroyed environment. Destroyed events confirm that an environment and all its descendants have been destroyed and are sent to the source of the corresponding destroy event. If the source is part of the destroyed environment hierarchy, no destroyed event is posted.

STOP

public static final int STOP
The type code for stopping an environment. Stop events notify an application running in an environment that is about to be terminated or destroyed of the pending doom and are sent to that environment's main event handler and therefore to the component linked to the environment's main event handler. In response to a stop event, an application needs to stop all computations and release all resources.
See Also:
STOPPED

STOPPED

public static final int STOPPED
The type code for a stopped environment. Stopped events confirm that an environment is ready to be terminated or destroyed and are sent to the source of the corresponding stop event. If an application posts a stopped event to the environment's request handler without first receiving a stop event, it is terminated right away.
See Also:
STOP

ident

public Guid ident
The ID of the environment for this environment event.
Constructor Detail

EnvironmentEvent

public EnvironmentEvent()
Create a new, empty environment event.

EnvironmentEvent

public EnvironmentEvent(EventHandler source,
                        Object closure,
                        int type,
                        Guid ident)
Create a new environment event.
Parameters:
source - The source for the new environment event.
closure - The closure for the new environment event.
type - The type for the new environment event.
ident - The ID for the new environment event.
Method Detail

validate

public void validate()
              throws TupleException
Validate this environment event.
Overrides:
validate in class Event
Following copied from class: one.world.core.Tuple
Throws:
TupleException - Signals that the tuple is either malformed (i.e., does not conform to the tuple specification) or invalid (i.e., does not conform to the semantic constraints of its type).
See Also:
MalformedTupleException, InvalidTupleException, Type.validate(Class)

toString

public String toString()
Get a string representation of this environment event.
Overrides:
toString in class Tuple
Following copied from class: one.world.core.Tuple
Returns:
A string representation for this tuple.


(C) Copyright 2001 UW CSE