jpl.eda.console
Interface Process

All Superinterfaces:
jpl.eda.util.Documentable
All Known Subinterfaces:
ExecServerProcess, JavaProcess, NameServer, NativeProcess, RuntimeProcess, WebServer
All Known Implementing Classes:
ExecServerProcessImpl, jpl.eda.console.JavaProcessImpl, NameServerImpl, jpl.eda.console.ProcessImpl, jpl.eda.console.RuntimeProcessImpl, WebServerImpl

public interface Process
extends jpl.eda.util.Documentable

A process managed by the server manager. All processes may be automatically restarted after crashes or otherwise.

Author:
Kelly

Field Summary
static java.lang.String ARGV
           
static java.lang.String CLASS_NAME
           
static java.lang.String ENABLED
           
static java.lang.String ENVP
           
static java.lang.String ERR_BUF_SIZE
           
static java.lang.String ERROR
           
static java.lang.String EVENT_ADDRESSES
           
static java.lang.String EXECUTIVE_SERVER
           
static java.lang.String IOR
           
static java.lang.String IS_RUNNING
           
static java.lang.String JAVA
           
static java.lang.String LAUNCH
           
static java.lang.String LIMIT
           
static java.lang.String MIN_TIME
           
static java.lang.String NAME
           
static java.lang.String NAME_SERVER
           
static java.lang.String NATIVE
           
static java.lang.String OUT_BUF_SIZE
           
static java.lang.String OUTPUT
           
static java.lang.String PROPERTIES
           
static java.lang.String RESET_TIME
           
static java.lang.String RESTARTS
           
static java.lang.String SHUTDOWN
           
static java.lang.String START_TIME
           
static java.lang.String TYPE
           
static java.lang.String URL
           
static java.lang.String WAIT_TIME
           
static java.lang.String WEB_SERVER
           
 
Method Summary
 java.util.Vector getEventAddresses()
          Get the list of addresses to receive events.
 int getLimit()
          Get the auto-restart limit.
 int getMinTime()
          Get the minimum run time.
 java.lang.String getName()
          My name, which uniquely identifies me on the server.
 int getResetTime()
          Get the reset time.
 java.util.Map getStatus()
          Get the status document.
 java.lang.String getType()
          What type of process am I?
 int getWaitTime()
          Get the wait time.
 boolean isEnabled()
          Check if enabled.
 boolean isRunning()
          Determine if I'm running right now.
 int setEnabled(boolean enabled)
          Set whether I'm enabled.
 int setEventAddresses(java.util.Vector addresses)
          Set the list of addresses to receive events.
 int setLimit(int limit)
          Set the auto-restart limit.
 int setMinTime(int minTime)
          Set the minimum run time.
 int setName(java.lang.String name)
          Set my name.
 int setParams(java.util.Hashtable params)
          Set new parameters.
 int setResetTime(int resetTime)
          Set the reset time.
 int setWaitTime(int waitTime)
          Set the wait time.
 int start()
          Start me.
 int stop()
          Stop me.
 
Methods inherited from interface jpl.eda.util.Documentable
toXML
 

Field Detail

EVENT_ADDRESSES

public static final java.lang.String EVENT_ADDRESSES
See Also:
Constant Field Values

ARGV

public static final java.lang.String ARGV
See Also:
Constant Field Values

CLASS_NAME

public static final java.lang.String CLASS_NAME
See Also:
Constant Field Values

ENABLED

public static final java.lang.String ENABLED
See Also:
Constant Field Values

ENVP

public static final java.lang.String ENVP
See Also:
Constant Field Values

ERROR

public static final java.lang.String ERROR
See Also:
Constant Field Values

ERR_BUF_SIZE

public static final java.lang.String ERR_BUF_SIZE
See Also:
Constant Field Values

EXECUTIVE_SERVER

public static final java.lang.String EXECUTIVE_SERVER
See Also:
Constant Field Values

IOR

public static final java.lang.String IOR
See Also:
Constant Field Values

IS_RUNNING

public static final java.lang.String IS_RUNNING
See Also:
Constant Field Values

JAVA

public static final java.lang.String JAVA
See Also:
Constant Field Values

LAUNCH

public static final java.lang.String LAUNCH
See Also:
Constant Field Values

LIMIT

public static final java.lang.String LIMIT
See Also:
Constant Field Values

MIN_TIME

public static final java.lang.String MIN_TIME
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

NAME_SERVER

public static final java.lang.String NAME_SERVER
See Also:
Constant Field Values

NATIVE

public static final java.lang.String NATIVE
See Also:
Constant Field Values

OUTPUT

public static final java.lang.String OUTPUT
See Also:
Constant Field Values

OUT_BUF_SIZE

public static final java.lang.String OUT_BUF_SIZE
See Also:
Constant Field Values

PROPERTIES

public static final java.lang.String PROPERTIES
See Also:
Constant Field Values

RESET_TIME

public static final java.lang.String RESET_TIME
See Also:
Constant Field Values

RESTARTS

public static final java.lang.String RESTARTS
See Also:
Constant Field Values

SHUTDOWN

public static final java.lang.String SHUTDOWN
See Also:
Constant Field Values

START_TIME

public static final java.lang.String START_TIME
See Also:
Constant Field Values

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values

URL

public static final java.lang.String URL
See Also:
Constant Field Values

WAIT_TIME

public static final java.lang.String WAIT_TIME
See Also:
Constant Field Values

WEB_SERVER

public static final java.lang.String WEB_SERVER
See Also:
Constant Field Values
Method Detail

setName

public int setName(java.lang.String name)
            throws ServerException
Set my name.

Parameters:
name - New name.
Returns:
Zero.
Throws:
ServerException - if an error occurs.

getName

public java.lang.String getName()
                         throws ServerException
My name, which uniquely identifies me on the server.

Returns:
My name.
Throws:
ServerException - If an error occurs.

isEnabled

public boolean isEnabled()
                  throws ServerException
Check if enabled. If I'm enabled, I'm capable of being started.

Returns:
True if I am, false otherwise.
Throws:
ServerException - If an error occurs.

setEnabled

public int setEnabled(boolean enabled)
               throws ServerException
Set whether I'm enabled. If I'm not enabled, I can't be started.

Parameters:
enabled - True to enable, false otherwise.
Returns:
Zero
Throws:
ServerException - If an error occurs.

setLimit

public int setLimit(int limit)
             throws ServerException
Set the auto-restart limit. The auto-restart limit specifies how many times I can be automatically restarted after a failure before I'm marked as disabled. If it's zero, I don't restart at all. Failures are indicated by terminations that occur before a minimum run time; these incur a penalty towards the auto-restart limit. Terminating after the minimum run time does not incur a penalty.

Parameters:
limit - How many times I can be restarted before giving up after a failure, or zero if I never auto-restart for any condition.
Returns:
Zero
Throws:
ServerException - If an error occurs.

setMinTime

public int setMinTime(int minTime)
               throws ServerException
Set the minimum run time. The minimum run time specifies how long I should stay up if I'm doing my job. If I can't stay running this long, I'll only be restarted up to the setLimit(int) number of times. If I stay running this long or longer and I crash, then I can be autorestarted without penalty. Note that if the auto-restart limit is zero, I never auto-restart regardless of how long I was able to stay running.

Parameters:
minTime - How long, in milliseconds, I should be running to be considered successful, or zero if any crash should incur a restart penalty.
Returns:
Zero
Throws:
ServerException - If an error occurs.

setWaitTime

public int setWaitTime(int waitTime)
                throws ServerException
Set the wait time. The wait time tells how long I should wait after a termination before restarting. For some processes, certain resources like sockets won't be released until after a certain amount of time has passed, so setting the wait time appropriately helps those processes restart better. If the wait time is zero, I don't wait at all for an automatic restart: it happens immediately.

Parameters:
waitTime - How long, in milliseconds, to wait before trying an auto-restart.
Returns:
Zero
Throws:
ServerException - If an error occurs.

setResetTime

public int setResetTime(int resetTime)
                 throws ServerException
Set the reset time. If I can't stay running for the minimum run time and I've been auto-restarted up to the limit number of times, I'm marked as disabled. I'll stay disabled until a system administrator figures out what's wrong and manually starts me again, or until the reset time period has passed. If the reset time is zero, then I stay disabled and must be manually restarted.

Parameters:
resetTime - How much time must pass before I'm re-enabled.
Returns:
Zero
Throws:
ServerException - If an error occurs.

getLimit

public int getLimit()
             throws ServerException
Get the auto-restart limit.

Returns:
How many times I can be restarted before giving up after a failure, or zero if I never auto-restart for any condition.
Throws:
ServerException - If an error occurs.

getMinTime

public int getMinTime()
               throws ServerException
Get the minimum run time.

Returns:
How long, in milliseconds, I should be running to be considered successful, or zero if any crash should incur a restart penalty.
Throws:
ServerException - If an error occurs.

getWaitTime

public int getWaitTime()
                throws ServerException
Get the wait time.

Returns:
How long, in milliseconds, to wait before trying an auto-restart.
Throws:
ServerException - If an error occurs.

getResetTime

public int getResetTime()
                 throws ServerException
Get the reset time.

Returns:
How much time must pass before I'm re-enabled.
Throws:
ServerException - If an error occurs.

start

public int start()
          throws ServerException
Start me. Starting a disabled process enables it.

Returns:
Zero
Throws:
ServerException - If I can't be started.

stop

public int stop()
         throws ServerException
Stop me. Stopping a process doesn't disable it, nor does it make it a candidate for automatic restart.

Returns:
Zero
Throws:
ServerException - If I can't be stopped.

isRunning

public boolean isRunning()
                  throws ServerException
Determine if I'm running right now.

Returns:
True if I am, false otherwise.
Throws:
ServerException - If I can't tell if I'm running.

getType

public java.lang.String getType()
                         throws ServerException
What type of process am I?

Returns:
My type.
Throws:
ServerException - If an error occurs.

getStatus

public java.util.Map getStatus()
                        throws ServerException
Get the status document.

Returns:
An map describing my status.
Throws:
ServerException - If I can't tell my status.

setParams

public int setParams(java.util.Hashtable params)
              throws ServerException
Set new parameters.

Parameters:
params - New parameters for this process.
Returns:
Zero
Throws:
ServerException - If an error occurs.

getEventAddresses

public java.util.Vector getEventAddresses()
                                   throws ServerException
Get the list of addresses to receive events.

Returns:
a Vector value of Strings.
Throws:
ServerException - if an error occurs.

setEventAddresses

public int setEventAddresses(java.util.Vector addresses)
                      throws ServerException
Set the list of addresses to receive events.

Parameters:
addresses - a Vector of Strings.
Returns:
Zero.
Throws:
ServerException - if an error occurs.


Copyright © 1999-2006 NASA Jet Propulsion Laboratory, California Institute of Technology. All Rights Reserved.