Openwings API Documentation (v1.1)

net.openwings.container
Class ContainerProcessStatus

java.lang.Object
  extended bynet.openwings.container.ContainerProcessStatus
All Implemented Interfaces:
java.io.Serializable

public final class ContainerProcessStatus
extends java.lang.Object
implements java.io.Serializable

This class describes the status of a running ContainerProcess. This includes the current run state of the ContainerProcess, start and stop times, and optional information about failover and performance.

See Also:
Serialized Form

Field Summary
static int CREATED
          This constant represents the initial state of a process before it is started.
static int FAILED
          This constant represents a transitory state for a process that has terminated abnormally.
static int MOVED_CONTAINER
          This constant represents a transitory state for a process that is being moved to another container on the same platform.
static int MOVED_CONTAINER_MANAGER
          This constant represents the state of a process that has been moved to another container on a different platform.
static int STARTED
          This constant represents the state of a process that is executing in a Container or ContainerManager.
static int STOPPED
          This constant represents the state of a process that has been explicitly stopped or that has exceeded the maximum number of restarts supported by its container.
 
Constructor Summary
ContainerProcessStatus(UniqueID processID, int status, java.util.Date processStatusTime, java.util.Date processStartTime, java.util.Date processStopTime, UniqueID containerID, int timesRestarted, int lastExitCode, java.lang.Throwable lastFailureCause, PerformanceReport[] performanceReports, boolean sharedContainer, boolean restart, boolean mobile, java.lang.String commandLineParameters)
          This is the single public constructor for the ContainerProcessStatus class.
 
Method Summary
 boolean equals(java.lang.Object obj)
          overrides default equals() method
 java.lang.String getCommandLineParameters()
          This method returns the command line parameters used to start the process.
 UniqueID getContainerID()
          This method returns a unique identifier representing the Container in which this ContainerProcess is running
 int getLastExitCode()
          This method returns the result of the last execution of the ContainerProcess
 java.lang.Throwable getLastFailureCause()
          This method returns the exception or error that caused the ContainerProcess to fail
 boolean getMobile()
          This method indicates whether this process may be moved between containers or platforms.
 PerformanceReport[] getPerformanceReports()
          This method returns
 UniqueID getProcessID()
          This method returns the unique identifier for the ContainerProcess
 java.util.Date getProcessStartTime()
          This method returns the time that the ContainerProcess was started or restarted
 java.util.Date getProcessStatusTime()
          This method returns the time that this report was generated
 java.util.Date getProcessStopTime()
          This method returns the time that the ContainerProcess failed or was stopped
 boolean getRestart()
          This method indicates whether this process will be restarted if it fails.
 boolean getSharedContainer()
          This method indicates whether this process is running inside a container.
 int getStatus()
          This method returns the execution status of the process
 int getTimesRestarted()
          This method returns the count of how many times the ContainerProcess has been restarted
 int hashCode()
          overrides default hashCode() method
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATED

public static final int CREATED
This constant represents the initial state of a process before it is started. A process in this state can be stopped without ever starting it, but then it can never be started. The process can only be started once. The process goes to the STARTED state.

See Also:
Constant Field Values

STARTED

public static final int STARTED
This constant represents the state of a process that is executing in a Container or ContainerManager. From this state, a process can go to the following states: STOPPED, FAILED, MOVED_CONTAINER. Additionally, a process in a ContainerManager can go to the MOVED_CONTAINER_MANAGER state.

See Also:
Constant Field Values

FAILED

public static final int FAILED
This constant represents a transitory state for a process that has terminated abnormally. From this state, a process goes to the STARTED state if it is restarted by the Container or ContainerManager, and to the STOPPED state otherwise.

See Also:
Constant Field Values

MOVED_CONTAINER

public static final int MOVED_CONTAINER
This constant represents a transitory state for a process that is being moved to another container on the same platform. From this a process remains in for a very short time before going back to the STARTED state. Depending on the implementation, it may be possible to explicitly stop the process directly from the MOVED_CONTAINER state.

See Also:
Constant Field Values

MOVED_CONTAINER_MANAGER

public static final int MOVED_CONTAINER_MANAGER
This constant represents the state of a process that has been moved to another container on a different platform. This state is only reported by process objects that come from a ContainerManager, not by process objects that come from a Container. This state implies that a process with the same uniqueID can be found on another platform. This is a final state, meaning that the state of the process cannot change. The process object is now obsolete and can be discarded (garbage collected) when all references are released.

See Also:
Constant Field Values

STOPPED

public static final int STOPPED
This constant represents the state of a process that has been explicitly stopped or that has exceeded the maximum number of restarts supported by its container. This is a final state, meaning that the state of the process cannot change. The process object is now obsolete and can be discarded (garbage collected) when all references are released.

See Also:
Constant Field Values
Constructor Detail

ContainerProcessStatus

public ContainerProcessStatus(UniqueID processID,
                              int status,
                              java.util.Date processStatusTime,
                              java.util.Date processStartTime,
                              java.util.Date processStopTime,
                              UniqueID containerID,
                              int timesRestarted,
                              int lastExitCode,
                              java.lang.Throwable lastFailureCause,
                              PerformanceReport[] performanceReports,
                              boolean sharedContainer,
                              boolean restart,
                              boolean mobile,
                              java.lang.String commandLineParameters)
This is the single public constructor for the ContainerProcessStatus class.

Parameters:
processID - unique identifier representing the ContainerProcess that this status report applies to.
status - integer corresponding to one of the state constants defined in this class.
processStatusTime - a Date object indicating the time that this report was generated. This time should be considered approximate: not accurate enough for sophisticated timing, but usable for general information and for ordering status reports from the same process.
processStartTime - a Date object indicating the time that the ContainerProcess was started or restarted or null if the ContainerProcess has not yet been started.
processStopTime - a Date object indicating the time that the ContainerProcess failed or was stopped. This time should be considered approximate.
containerID - unique identifier representing the Container in which this ContainerProcess is running, or null if the process is running standalone. This property is provided as a hint only.
timesRestarted - the count of how many times the ContainerProcess has been restarted (if its ComponentDescriptor indicated that the ContainerProcess should be restarted).
lastExitCode - the result of the last execution of the ContainerProcess, or 0 if the ContainerProcess has not stopped or failed.
lastFailureCause - an optional field for Java ContainerProcesses that can be used to capture the exception or error that caused the ContainerProcess to fail.
performanceReports - an optional array of PerformanceReport objects that can be used to report information about the performance of the ContainerProcess.
sharedContainer - boolean indicating whether this process is running in a shared container.
restart - boolean indicating whether this process will be restarted should it fail.
mobile - boolean indicating whether this process may be moved between containers or platforms.
commandLineParameters - parameters used to start this process.
Method Detail

getProcessID

public UniqueID getProcessID()
This method returns the unique identifier for the ContainerProcess

Returns:
unique identifier representing the ContainerProcess that this status report applies to.

getStatus

public int getStatus()
This method returns the execution status of the process


getProcessStatusTime

public java.util.Date getProcessStatusTime()
This method returns the time that this report was generated

Returns:
a Date object indicating the time that this report was generated. This time should be considered approximate: not accurate enough for sophisticated timing, but usable for general information and for ordering status reports from the same process.

getProcessStartTime

public java.util.Date getProcessStartTime()
This method returns the time that the ContainerProcess was started or restarted

Returns:
a Date object indicating the time that the ContainerProcess was started or restarted, or null if the ContainerProcess has not yet been started.

getProcessStopTime

public java.util.Date getProcessStopTime()
This method returns the time that the ContainerProcess failed or was stopped

Returns:
a Date object indicating the time that the ContainerProcess failed or was stopped. This time should be considered approximate.

getContainerID

public UniqueID getContainerID()
This method returns a unique identifier representing the Container in which this ContainerProcess is running

Returns:
a unique identifier representing the Container in which this ContainerProcess is running, or null if the process is running standalone. This property is provided as a hint only.

getTimesRestarted

public int getTimesRestarted()
This method returns the count of how many times the ContainerProcess has been restarted

Returns:
the count of how many times the ContainerProcess has been restarted (if its ComponentDescriptor indicated that the ContainerProcess should be restarted).

getLastExitCode

public int getLastExitCode()
This method returns the result of the last execution of the ContainerProcess

Returns:
the result of the last execution of the ContainerProcess, or 0 if the ContainerProcess has not stopped or failed.

getLastFailureCause

public java.lang.Throwable getLastFailureCause()
This method returns the exception or error that caused the ContainerProcess to fail

Returns:
an optional field for Java ContainerProcesses that can be used to capture the exception or error that caused the ContainerProcess to fail.

getPerformanceReports

public PerformanceReport[] getPerformanceReports()
This method returns

Returns:
an optional array of PerformanceReport objects that can be used to report information about the performance of the ContainerProcess.

getSharedContainer

public boolean getSharedContainer()
This method indicates whether this process is running inside a container.

Returns:
true if the process is running inside a container

getRestart

public boolean getRestart()
This method indicates whether this process will be restarted if it fails.

Returns:
true if the process will be restarted

getMobile

public boolean getMobile()
This method indicates whether this process may be moved between containers or platforms.

Returns:
true if the process may be moved

getCommandLineParameters

public java.lang.String getCommandLineParameters()
This method returns the command line parameters used to start the process.

Returns:
command line parameters used to start the process

equals

public boolean equals(java.lang.Object obj)
overrides default equals() method


hashCode

public int hashCode()
overrides default hashCode() method


Openwings API Documentation (v1.1)