RSE
Release 1.0

org.eclipse.rse.services.dstore.processes
Class DStoreHostProcess

java.lang.Object
  extended byorg.eclipse.rse.services.dstore.processes.DStoreHostProcess
All Implemented Interfaces:
IAdaptable, IHostProcess, IServiceConstants, ISystemProcessRemoteConstants, IUniversalDataStoreConstants

public class DStoreHostProcess
extends Object
implements IHostProcess, IUniversalDataStoreConstants, IAdaptable, ISystemProcessRemoteConstants

This class implements the IRemoteClientProcess interface by wrappering a DataElement and returning process attribute information from the underlying DataElement. It also contains client-specific methods for getting contextual information about the process such as the associated subsystem and connection.


Field Summary
protected  HashMap _contents
           
protected  String _fullyQualifiedProcess
           
protected  long _gid
           
protected  boolean _isRoot
           
protected  boolean _isStale
           
protected  String _label
           
protected  String _name
           
protected  long _pid
           
protected  long _ppid
           
protected  HashMap _properties
           
protected  HashMap _propertyStates
           
protected  Object _remoteObj
           
protected  long _tgid
           
protected  long _tracerPid
           
protected  long _uid
           
protected  String _username
           
static boolean ROOT_FALSE
           
static boolean ROOT_TRUE
           
 
Fields inherited from interface org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants
BINARY_MODE, BUFFER_SIZE, C_COPY, C_COPY_BATCH, C_CREATE_FILE, C_CREATE_FOLDER, C_DELETE, C_DELETE_BATCH, C_DOWNLOAD_FILE, C_QUERY_GET_REMOTE_OBJECT, C_QUERY_QUALIFIED_CLASSNAME, C_QUERY_ROOTS, C_QUERY_UNUSED_PORT, C_QUERY_VIEW_ALL, C_QUERY_VIEW_FILES, C_QUERY_VIEW_FOLDERS, C_RENAME, C_SYSTEM_ENCODING, DOWNLOAD_RESULT_EXCEPTION, DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION, DOWNLOAD_RESULT_IO_EXCEPTION, DOWNLOAD_RESULT_SUCCESS_MESSAGE, DOWNLOAD_RESULT_SUCCESS_TYPE, DOWNLOAD_RESULT_UNEXPECTED_ERROR, DOWNLOAD_RESULT_UNSUPPORTED_ENCODING_EXCEPTION, KB_IN_BYTES, MESSAGE_DESCRIPTOR, NUM_OF_KB, TEXT_MODE, TYPE_QUALIFIED_CLASSNAME, UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR, UNIVERSAL_FILE_DESCRIPTOR, UNIVERSAL_FILESYSTEM_MINER, UNIVERSAL_FILTER_DESCRIPTOR, UNIVERSAL_FOLDER_DESCRIPTOR, UNIVERSAL_NODE_DESCRIPTOR, UNIVERSAL_TEMP_DESCRIPTOR, UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR, UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR
 
Fields inherited from interface org.eclipse.rse.services.clientserver.IServiceConstants
FAILED, FAILED_TO_DELETE_DIR, FAILED_WITH_DOES_NOT_EXIST, FAILED_WITH_EXCEPTION, FAILED_WITH_EXIST, FAILED_WITH_SECURITY, SUCCESS, TOKEN_SEPARATOR, UNEXPECTED_ERROR, VERSION_1
 
Fields inherited from interface org.eclipse.rse.services.clientserver.processes.ISystemProcessRemoteConstants
ALL_STATES, ALL_STATES_STR, PROCESS_ATTRIBUTES_COUNT, PROCESS_ATTRIBUTES_INDEX_EXENAME, PROCESS_ATTRIBUTES_INDEX_GID, PROCESS_ATTRIBUTES_INDEX_PID, PROCESS_ATTRIBUTES_INDEX_PPID, PROCESS_ATTRIBUTES_INDEX_STATUS, PROCESS_ATTRIBUTES_INDEX_TGID, PROCESS_ATTRIBUTES_INDEX_TRACERPID, PROCESS_ATTRIBUTES_INDEX_UID, PROCESS_ATTRIBUTES_INDEX_USERNAME, PROCESS_ATTRIBUTES_INDEX_VMRSS, PROCESS_ATTRIBUTES_INDEX_VMSIZE, PROCESS_MINER_ERROR_NO_HANDLER, PROCESS_MINER_SUCCESS, PROCESS_SIGNAL_TYPE_DEFAULT, STATE_ACTIVE, STATE_ACTIVE_INDEX, STATE_ENDING_INDEX, STATE_IDLE, STATE_IDLE_INDEX, STATE_NONEXISTENT, STATE_NONEXISTENT_INDEX, STATE_PAGING, STATE_PAGING_INDEX, STATE_RUNNING, STATE_RUNNING_INDEX, STATE_SLEEPING, STATE_SLEEPING_INDEX, STATE_STARTING_INDEX, STATE_TRACED, STATE_TRACED_INDEX, STATE_WAITING, STATE_WAITING_INDEX, STATE_ZOMBIE, STATE_ZOMBIE_INDEX, STATE_ZOS_ASYNCHRONOUSTHREAD, STATE_ZOS_ASYNCHRONOUSTHREAD_INDEX, STATE_ZOS_CANCELLED, STATE_ZOS_CANCELLED_INDEX, STATE_ZOS_COMSYSKERNELWAIT, STATE_ZOS_COMSYSKERNELWAIT_INDEX, STATE_ZOS_DETACHED, STATE_ZOS_DETACHED_INDEX, STATE_ZOS_ENDING_INDEX, STATE_ZOS_FILESYSKERNELWAIT, STATE_ZOS_FILESYSKERNELWAIT_INDEX, STATE_ZOS_FORKING, STATE_ZOS_FORKING_INDEX, STATE_ZOS_INITIALPROCESSTHREAD, STATE_ZOS_INITIALPROCESSTHREAD_INDEX, STATE_ZOS_MEDIUMWEIGHTTHREAD, STATE_ZOS_MEDIUMWEIGHTTHREAD_INDEX, STATE_ZOS_MSGQRECEIVEWAIT, STATE_ZOS_MSGQRECEIVEWAIT_INDEX, STATE_ZOS_MSGQSENDWAIT, STATE_ZOS_MSGQSENDWAIT_INDEX, STATE_ZOS_MULTITHREAD, STATE_ZOS_MULTITHREAD_INDEX, STATE_ZOS_MVSPAUSEWAIT, STATE_ZOS_MVSPAUSEWAIT_INDEX, STATE_ZOS_MVSWAIT, STATE_ZOS_MVSWAIT_INDEX, STATE_ZOS_OTHERKERNELWAIT, STATE_ZOS_OTHERKERNELWAIT_INDEX, STATE_ZOS_PTHREADCREATED, STATE_ZOS_PTHREADCREATED_INDEX, STATE_ZOS_PTHREADCREATEDTASKS, STATE_ZOS_PTHREADCREATEDTASKS_INDEX, STATE_ZOS_PTRACEKERNELWAIT, STATE_ZOS_PTRACEKERNELWAIT_INDEX, STATE_ZOS_QUIESCEFROZEN, STATE_ZOS_QUIESCEFROZEN_INDEX, STATE_ZOS_RUNNING, STATE_ZOS_RUNNING_INDEX, STATE_ZOS_SEMAPHOREWAIT, STATE_ZOS_SEMAPHOREWAIT_INDEX, STATE_ZOS_SINGLE, STATE_ZOS_SINGLE_INDEX, STATE_ZOS_SLEEPING, STATE_ZOS_SLEEPING_INDEX, STATE_ZOS_STARTING_INDEX, STATE_ZOS_STOPPED, STATE_ZOS_STOPPED_INDEX, STATE_ZOS_SWAPPEDOUT, STATE_ZOS_SWAPPEDOUT_INDEX, STATE_ZOS_WAITINGFORCHILD, STATE_ZOS_WAITINGFORCHILD_INDEX, STATE_ZOS_ZOMBIE, STATE_ZOS_ZOMBIE_INDEX
 
Constructor Summary
DStoreHostProcess(org.eclipse.dstore.core.model.DataElement dataElementObj)
          Constructor that takes a dataElement object containing the process information, and a parent process.
 
Method Summary
 String getAbsolutePath()
           
 Object getAdapter(Class adapterType)
           
 String getAllProperties()
          Returns all properties of this process in the same format as given in the dataelement
protected  String getAttributes(String newAttributes)
          The Properties of the process are returned from the miner in a string that can be parsed using the String.split method, with delimiter "|".
 long getGid()
          Get the process owner's group id (gid)
 String getLabel()
          Get the display name for this process.
 String getName()
          Get the name of the executable owning this process
 Object getObject()
          Returns the DataElement for this object
 long getPid()
          Get the process id (pid) associated with this process.
 long getPPid()
          Get the parent process id (ppid) associated with this process.
 String getState()
          Get the state of the process
protected  String getSubAttribute(int attIndex)
          Returns a subattribute of the A_VALUE of this process's associated data element.
 long getTgid()
          Get the Tgid
 long getTracerPid()
          Get the TracerPid
 long getUid()
          Get the process owner's user id (uid)
 String getUsername()
          Get the process owner's username
 long getVmRSSInKB()
          Returns the virtual memory resident set size of this process (in kB).
 long getVmSizeInKB()
          Returns the virtual memory size of this process (in kB)
protected  void init(org.eclipse.dstore.core.model.DataElement dataElementObj)
           
 boolean isRoot()
          Returns whether this is the root process or not
protected  void setAbsolutePath(String path)
           
protected  void setAllProperties(String allProperties)
           
protected  void setGid(long gid)
           
protected  void setGid(String newGid)
           
 void setLabel(String newLabel)
           
protected  void setName(String exeName)
           
protected  void setPid(long newPid)
           
protected  void setPid(String newPid)
           
protected  void setPPid(long newPPid)
           
protected  void setPPid(String newPPid)
           
 void setProcess(Object dataElementObj)
          Set the DataElement for this object
protected  void setState(String newState)
           
protected  void setSubAttribute(int attIndex, String newSubAttribute)
          Helper method for setting any attributes of the underlying DataElement.
protected  void setTgid(long tgid)
           
protected  void setTgid(String newTgid)
           
protected  void setTracerPid(long tracerPid)
           
protected  void setTracerPid(String newTracerPid)
           
protected  void setUid(long uid)
           
protected  void setUid(String newUid)
           
protected  void setUsername(String username)
           
protected  void setVmRSSInKB(long size)
           
protected  void setVmSizeInKB(long size)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT_TRUE

public static final boolean ROOT_TRUE
See Also:
Constant Field Values

ROOT_FALSE

public static final boolean ROOT_FALSE
See Also:
Constant Field Values

_name

protected String _name

_username

protected String _username

_pid

protected long _pid

_ppid

protected long _ppid

_tgid

protected long _tgid

_tracerPid

protected long _tracerPid

_uid

protected long _uid

_gid

protected long _gid

_label

protected String _label

_fullyQualifiedProcess

protected String _fullyQualifiedProcess

_isRoot

protected boolean _isRoot

_remoteObj

protected Object _remoteObj

_contents

protected HashMap _contents

_isStale

protected boolean _isStale

_properties

protected HashMap _properties

_propertyStates

protected HashMap _propertyStates
Constructor Detail

DStoreHostProcess

public DStoreHostProcess(org.eclipse.dstore.core.model.DataElement dataElementObj)
Constructor that takes a dataElement object containing the process information, and a parent process.

Method Detail

init

protected void init(org.eclipse.dstore.core.model.DataElement dataElementObj)

getAttributes

protected String getAttributes(String newAttributes)
The Properties of the process are returned from the miner in a string that can be parsed using the String.split method, with delimiter "|". You can also set all attributes at once with your own string passed as a parameter, as long as the string is in the same format as outlined below (pass in null to use the DataElement's string):

The string contains properties of the object in the following order


setProcess

public void setProcess(Object dataElementObj)
Set the DataElement for this object


getObject

public Object getObject()
Returns the DataElement for this object


getAbsolutePath

public String getAbsolutePath()

getLabel

public String getLabel()
Description copied from interface: IHostProcess
Get the display name for this process.

Specified by:
getLabel in interface IHostProcess

getPid

public long getPid()
Description copied from interface: IHostProcess
Get the process id (pid) associated with this process.

Specified by:
getPid in interface IHostProcess

getName

public String getName()
Description copied from interface: IHostProcess
Get the name of the executable owning this process

Specified by:
getName in interface IHostProcess

getState

public String getState()
Description copied from interface: IHostProcess
Get the state of the process

Specified by:
getState in interface IHostProcess

getTgid

public long getTgid()
Description copied from interface: IHostProcess
Get the Tgid

Specified by:
getTgid in interface IHostProcess

getTracerPid

public long getTracerPid()
Description copied from interface: IHostProcess
Get the TracerPid

Specified by:
getTracerPid in interface IHostProcess

getUid

public long getUid()
Description copied from interface: IHostProcess
Get the process owner's user id (uid)

Specified by:
getUid in interface IHostProcess

getUsername

public String getUsername()
Description copied from interface: IHostProcess
Get the process owner's username

Specified by:
getUsername in interface IHostProcess

getGid

public long getGid()
Description copied from interface: IHostProcess
Get the process owner's group id (gid)

Specified by:
getGid in interface IHostProcess

setAbsolutePath

protected void setAbsolutePath(String path)

setGid

protected void setGid(long gid)

setGid

protected void setGid(String newGid)

setLabel

public void setLabel(String newLabel)

setName

protected void setName(String exeName)

setPid

protected void setPid(long newPid)

setPid

protected void setPid(String newPid)

setState

protected void setState(String newState)

setTgid

protected void setTgid(long tgid)

setTgid

protected void setTgid(String newTgid)

setTracerPid

protected void setTracerPid(long tracerPid)

setTracerPid

protected void setTracerPid(String newTracerPid)

setUid

protected void setUid(long uid)

setUid

protected void setUid(String newUid)

setUsername

protected void setUsername(String username)

getAdapter

public Object getAdapter(Class adapterType)
Specified by:
getAdapter in interface IAdaptable

getPPid

public long getPPid()
Description copied from interface: IHostProcess
Get the parent process id (ppid) associated with this process.

Specified by:
getPPid in interface IHostProcess

setPPid

protected void setPPid(long newPPid)

setPPid

protected void setPPid(String newPPid)

isRoot

public boolean isRoot()
Description copied from interface: IHostProcess
Returns whether this is the root process or not

Specified by:
isRoot in interface IHostProcess

getAllProperties

public String getAllProperties()
Description copied from interface: IHostProcess
Returns all properties of this process in the same format as given in the dataelement

Specified by:
getAllProperties in interface IHostProcess

setAllProperties

protected void setAllProperties(String allProperties)
Parameters:
allProperties -

getVmSizeInKB

public long getVmSizeInKB()
Description copied from interface: IHostProcess
Returns the virtual memory size of this process (in kB)

Specified by:
getVmSizeInKB in interface IHostProcess

getVmRSSInKB

public long getVmRSSInKB()
Description copied from interface: IHostProcess
Returns the virtual memory resident set size of this process (in kB). This is the actual amount of RAM used by the process.

Specified by:
getVmRSSInKB in interface IHostProcess

setVmSizeInKB

protected void setVmSizeInKB(long size)
Parameters:
size - the size to set

setVmRSSInKB

protected void setVmRSSInKB(long size)
Parameters:
size - the size to set

getSubAttribute

protected String getSubAttribute(int attIndex)
Returns a subattribute of the A_VALUE of this process's associated data element.

Parameters:
attIndex - the index of the desired subattribute
Returns:
a string containing that attribute, or null if that attribute is not specified, if the dataelement does not exist, or if the attIndex is out of bounds.

setSubAttribute

protected void setSubAttribute(int attIndex,
                               String newSubAttribute)
Helper method for setting any attributes of the underlying DataElement.

Parameters:
attIndex -
newSubAttribute -

RSE
Release 1.0

Copyright (c) IBM Corporation and others 2000, 2006. All Rights Reserved.