|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread edu.sdsc.inca.agent.ReporterManagerStarter
public class ReporterManagerStarter
Handles the creation of a remote reporter manager process on a specified resource.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static java.lang.String |
CURRENT_SUITE
|
protected static int |
DEFAULT_AGE
|
static java.lang.String |
LAST_CHANGE
|
protected static int |
MANUAL_WAIT_PERIOD
|
static java.lang.String |
RMBUILDSCRIPT
|
static java.lang.String |
RMCERT
|
static java.lang.String |
RMDIST
|
static java.lang.String |
RMKEY
|
static java.lang.String |
RMREQ
|
static java.lang.String |
RMTRUSTED
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ReporterManagerStarter(ReporterManagerStarter rmStarter)
Create a new reporter manager starter object, whose configuration is identical to rmStarter |
|
ReporterManagerStarter(java.lang.String resource,
Agent agent)
Create a new reporter manager starter object for a resource. |
Method Summary | |
---|---|
void |
create()
Start the reporter manager process on the remote resource using the method specified in the resource configuration file. |
protected java.lang.String |
createRmCertificate()
Create a certificate for the reporter manager from the given certificate request |
void |
findBashLoginShellOption()
Test for the bash login shell option on the reporter manager resource. |
java.lang.String |
getCurrentHost()
Returns the currently selected host (chosen by the run method when the reporter manager is started). |
java.lang.String[] |
getEquivalentHosts()
Returns the equivalent hosts for this resource. |
AccessMethod |
getProcessHandle()
Return the process handle being used by this reporter manager starter. |
java.lang.String |
getRmRootPath()
Return the path to the remote reporter manager installation directory. |
long |
getStartAttemptTime()
Returns the amount of elapsed time since attempting a start of a remote reporter manager. |
java.lang.String |
getTemporaryDirectory()
Gets the directory path where the temporary files can be stored. |
boolean |
isManual()
Return whether the reporter manager is being controlled manually (and not by the agent) |
boolean |
isRunning()
Return true if the reporter manager is currently registered and running. |
boolean |
isStaged()
Checks to see if the reporter manager is available and installed on the machine. |
void |
nextHost()
Assume the current host is not reachable and try the next host in the list (if there is one) |
protected static java.lang.String |
parseWorkingDir(java.lang.String dir,
AccessMethod method)
Parse the working dir string and resolve different ways of expressing the home dir |
void |
refreshHosts()
Set the resources document referenced by the reporter manager. |
void |
run()
Starts a thread to create the reporter manager on the remote resource. |
void |
setBashLoginOption(java.lang.String bashLoginOption)
For testing purposes only. |
protected void |
setHost(int hostId)
Select the specified host for the resource and set the reporter manager attributes accordingly. |
void |
setRunning(boolean isRunning)
Set the status of the reporter manager to running and notify any waiting threads. |
void |
setStartAttemptComplete()
Set that the start attempt has been completed. |
void |
setStartAttemptTimeNow()
Set the clock on when a start attempt has been made so we can time it out if it gets stuck. |
void |
setTempDir(java.lang.String tempDir)
Set the location of the temporary directory. |
void |
stage(java.lang.String upgrade)
Stage the Reporter Manager distribution over to the remote resource. |
boolean |
waitForReporterManager()
To be used after the function create in order to wait for the remote reporter manager process to start up and connect to the agent. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String RMBUILDSCRIPT
public static final java.lang.String RMCERT
public static final java.lang.String RMDIST
public static final java.lang.String RMKEY
public static final java.lang.String RMREQ
public static final java.lang.String RMTRUSTED
public static final java.lang.String LAST_CHANGE
public static final java.lang.String CURRENT_SUITE
protected static final int DEFAULT_AGE
protected static final int MANUAL_WAIT_PERIOD
Constructor Detail |
---|
public ReporterManagerStarter(java.lang.String resource, Agent agent)
resource
- Name of the resource (from the resource configuration
file) to start the reporter manager on.agent
- Path to a location where temporary/state files can bepublic ReporterManagerStarter(ReporterManagerStarter rmStarter)
rmStarter
- A reporter manager starter object that will be used to
configure this reporter manager starter object.Method Detail |
---|
public void create() throws AccessMethodException
AccessMethodException
- if problem creating remote reporter manager
processpublic void findBashLoginShellOption() throws java.lang.InterruptedException, ReporterManagerException
java.lang.InterruptedException
- if interrupted while determining remote
bash login option
ReporterManagerException
- if unable to determine remote bash login
option.public java.lang.String getCurrentHost()
public java.lang.String[] getEquivalentHosts()
public java.lang.String getRmRootPath()
public AccessMethod getProcessHandle()
public long getStartAttemptTime()
public java.lang.String getTemporaryDirectory()
public boolean isManual()
public boolean isRunning()
public boolean isStaged() throws java.lang.InterruptedException
java.lang.InterruptedException
- if interrupted while determining if remote
reporter manager is staged.public void nextHost() throws edu.sdsc.inca.ConfigurationException
edu.sdsc.inca.ConfigurationException
- if configuration related problem with the
next host selectedpublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void refreshHosts()
public void setBashLoginOption(java.lang.String bashLoginOption)
bashLoginOption
- flag for remote bash login option.public void setStartAttemptTimeNow()
public void setStartAttemptComplete()
public void setRunning(boolean isRunning)
isRunning
- True indicates the reporter manager is running on the
remote machine and available; false otherwise.public void setTempDir(java.lang.String tempDir)
tempDir
- A path to a directory where temporary files can be stored.public void stage(java.lang.String upgrade) throws java.lang.InterruptedException, ReporterManagerException
upgrade
- If not null, runs the buildRM.sh script with the upgrade
option turned on. Otherwise a regular full install is done.
java.lang.InterruptedException
- if interrupted while executing build script
ReporterManagerException
- if build failspublic boolean waitForReporterManager() throws java.lang.InterruptedException
java.lang.InterruptedException
- if interrupted while waiting for remote
reporter manager to check in.protected java.lang.String createRmCertificate() throws java.security.GeneralSecurityException, java.io.IOException
java.security.GeneralSecurityException
- if unable to create certificate
java.io.IOException
- if unable to store certificateprotected static java.lang.String parseWorkingDir(java.lang.String dir, AccessMethod method)
dir
- A string containing the raw value of working dirmethod
- An access method that will be used to resolve home
protected void setHost(int hostId) throws edu.sdsc.inca.ConfigurationException
hostId
- The host id to select to execute the reporter manager on.
edu.sdsc.inca.ConfigurationException
- If unable to get host configuration info
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |