org.rhq.enterprise.agent
Class AgentUpdateThread
java.lang.Object
java.lang.Thread
org.rhq.enterprise.agent.AgentUpdateThread
- All Implemented Interfaces:
- Runnable
public class AgentUpdateThread
- extends Thread
This is a thread that will attempt to update the agent to the latest
version. This will shutdown the currently running agent, so it is
"destructive" in the sense that if successful, the VM this thread is running
in will eventually die.
- Author:
- John Mazzitelli
|
Method Summary |
static boolean |
isUpdatingNow()
This returns true if the agent is currently in the process of performing an update. |
void |
run()
|
static void |
updateAgentNow(AgentMain agent,
boolean wait)
This static method will immediately begin to update the agent. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, 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 |
updateAgentNow
public static void updateAgentNow(AgentMain agent,
boolean wait)
throws IllegalStateException
- This static method will immediately begin to update the agent.
Once you call this, there is no turning back - if all goes well,
the currently running agent (and the VM its running in) will soon exit.
- Parameters:
agent - the running agent that is to be updatedwait - if true, this will wait for the update thread
to die. Note that if the agent update is successful, and you pass
wait=true, this method will never return. It will only
return if the update failed and the VM is still alive. Pass
false if you want to fire-and-forget the agent update
thread and return immediately.
- Throws:
IllegalStateException - if the agent is already being updated
UnsupportedOperationException - if the agent is not allowed to update itself
isUpdatingNow
public static boolean isUpdatingNow()
- This returns
true if the agent is currently in the process of performing an update.
When this returns true, it should be assumed the agent's VM will die shortly.
- Returns:
true if an update thread is running and the update is being performed
run
public void run()
- Specified by:
run in interface Runnable- Overrides:
run in class Thread
Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.