|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.v3.admin.cluster.CommandRunnable
public class CommandRunnable
This class wraps a CommandInvocation so that it can be run via a thread pool. On construction you pass it the CommandInvocation to execute as well as a response queue and the ActionReport that was set on the CommandInvocation. When the run() method is called the CommandInvocation is executed (which sets its results in the ActionReport) and then it adds itself to the response queue where it can be picked up and the ActionReport inspected for the results.
| Constructor Summary | |
|---|---|
CommandRunnable(CommandRunner.CommandInvocation ci,
ActionReport report,
java.util.concurrent.BlockingQueue<CommandRunnable> q)
Construct a CommandRunnable. |
|
| Method Summary | |
|---|---|
ActionReport |
getActionReport()
Returns the ActionReport that was passed on the constructor. |
CommandRunner.CommandInvocation |
getCommandInvocation()
Returns the CommandInvocation that was passed on the constructor |
java.lang.String |
getName()
Get the name that was previously set. |
void |
run()
|
void |
setName(java.lang.String s)
Set a name on the runnable. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CommandRunnable(CommandRunner.CommandInvocation ci,
ActionReport report,
java.util.concurrent.BlockingQueue<CommandRunnable> q)
ci - A CommandInvocation containing the command you want
to run.report - The ActionReport you used with the CommandInvocationq - A blocking queue that this class will add itself to
when its run method has completed.
After dispatching this class to a thread pool the caller can block
on the response queue where it will dequeue CommandRunnables and then
use the getActionReport() method to retrieve the results.| Method Detail |
|---|
public void run()
run in interface java.lang.Runnablepublic void setName(java.lang.String s)
s - The namepublic java.lang.String getName()
public CommandRunner.CommandInvocation getCommandInvocation()
public ActionReport getActionReport()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||