public class RemoteTestModule extends UnicastRemoteObject implements RemoteTestModuleIF, Runnable
| Modifier and Type | Field and Description |
|---|---|
protected Thread |
baseClientThread
The base (parent) client thread associated with this instance
|
protected boolean |
busy
Flag to signal that we're already busy with a task
|
protected TestTask |
currentTask
The current task
|
protected static com.gemstone.gemfire.LogWriter |
log
The logger for this vm
|
static MasterProxyIF |
Master
Stub reference to a remote master controller
|
static int |
MyBaseThreadId
The base thread id for the vm
|
protected static String |
MyCanonicalHost
The canonical name of the host on which this VM runs
|
protected static String |
MyClientName
The logical client name
|
static String |
MyHost
The actual vm host
|
protected static String |
MyLogFileName
The log file name for this vm
|
protected static String |
MyLogicalHost
The logical host name
|
protected static int |
MyNumThreads
The number of threads in the vm
|
static int |
MyPid
The vm process id
|
protected int |
myThreadGroupId
Id identifying the current client thread uniquely to its threadgroup
|
protected String |
myThreadGroupName
Id identifying the current client thread's hydra threadgroup name
|
protected String |
myThreadName
Name identifying the current client thread uniquely
|
protected int |
myTid
Id identifying the current client thread uniquely to the master
|
protected static TimeClient |
MyTimeClient
The time client for this vm
|
protected static int |
MyVmid
The id for the client vm
|
protected static ThreadLocal |
rmiMod |
ref| Constructor and Description |
|---|
RemoteTestModule() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeClockSkewStatistics() |
void |
disconnectVM()
Used by the master to tell this VM to disconnect.
|
MethExecutorResult |
executeMethodOnClass(String className,
String methodName)
Called remotely by the master controller to cause the client to execute
the method on the class.
|
MethExecutorResult |
executeMethodOnClass(String className,
String methodName,
Object[] args)
Executes a given static method in a given class with the given
arguments.
|
MethExecutorResult |
executeMethodOnObject(Object obj,
String methodName)
Called remotely by the master controller to cause the client to execute
the instance method on the object.
|
MethExecutorResult |
executeMethodOnObject(Object obj,
String methodName,
Object[] args)
Executes a given instance method on a given object with the given
arguments.
|
void |
executeTask(int tsid,
int type,
int index)
Called remotely by the master controller to cause the client to execute
the test task.
|
protected void |
executeTask(int tsid,
TestTask task)
Spawns a new thread to execute the task.
|
static List<List<String>> |
getClientMapping() |
static long |
getClockSkew() |
TestTask |
getCurrentTask() |
static RemoteTestModule |
getCurrentThread()
Each test task is executed in a HydraThread spawned by a
RemoteTestModule instance (client).
|
static int |
getMyBaseThreadId() |
static String |
getMyClientName() |
static String |
getMyHost() |
static String |
getMyLogicalHost() |
static int |
getMyNumThreads() |
static int |
getMyPid() |
static int |
getMyVmid() |
int |
getThreadGroupId() |
String |
getThreadGroupName() |
int |
getThreadId() |
static boolean |
getWaitFlag() |
protected static void |
handleRemoteException(String msg,
RemoteException e)
Invokes RemoteException handler with the rethrow flag set to true.
|
protected static void |
handleRemoteException(String msg,
RemoteException e,
boolean rethrow)
Reports meaningful RemoteExceptions to the test error file for easier
viewing, and does away with bogus RemoteExceptions, for example when
clients are left running after a hang and master goes away.
|
protected static void |
initialize()
The startup routine for this remote test client.
|
protected void |
invokeShutdownHook(Long key,
Vector shutdownHook) |
static void |
main(String[] args) |
static void |
makeAndStartThreadClients()
Makes MyNumThreads new RemoteTestModules and fires off each in
a separate execution thread.
|
void |
notifyDynamicActionComplete(int actionId)
Notifies a client that dynamic action with the specified id is complete.
|
static void |
openClockSkewStatistics() |
void |
run()
Informs the master controller that the new client is ready for work and
provides its instance of RemoteTestModule to establish communication.
|
void |
runShutdownHook() |
static void |
setWaitFlag(boolean val) |
protected void |
shutdown() |
void |
shutDownVM(boolean disconnect,
boolean runShutdownHook)
Used by the master to tell this VM to quit.
|
protected static ConfigHashtable |
tab() |
clone, exportObject, exportObject, exportObject, unexportObjectgetClientHost, getLog, setLogprotected static String MyClientName
protected static String MyLogicalHost
public static String MyHost
protected static String MyCanonicalHost
protected static int MyVmid
public static int MyPid
protected static int MyNumThreads
public static int MyBaseThreadId
public static MasterProxyIF Master
protected static TimeClient MyTimeClient
protected static String MyLogFileName
protected static com.gemstone.gemfire.LogWriter log
protected Thread baseClientThread
protected boolean busy
protected TestTask currentTask
protected int myTid
protected String myThreadGroupName
protected int myThreadGroupId
protected String myThreadName
protected static ThreadLocal rmiMod
public RemoteTestModule()
throws RemoteException
RemoteExceptionpublic static void makeAndStartThreadClients()
public void run()
public void executeTask(int tsid,
int type,
int index)
throws RemoteException
executeTask in interface RemoteTestModuleIFtsid - the id of the scheduler who issued the assignmenttype - the type of task to executeindex - the index into the tasks of that typeRemoteExceptionprotected void executeTask(int tsid,
TestTask task)
public MethExecutorResult executeMethodOnObject(Object obj, String methodName)
executeMethodOnObject in interface RemoteTestModuleIFobj - the object to execute the method onmethodName - the name of the method to executepublic MethExecutorResult executeMethodOnObject(Object obj, String methodName, Object[] args)
executeMethodOnObject in interface RemoteTestModuleIFpublic MethExecutorResult executeMethodOnClass(String className, String methodName)
executeMethodOnClass in interface RemoteTestModuleIFclassName - the name of the class executemethodName - the name of the method to executepublic MethExecutorResult executeMethodOnClass(String className, String methodName, Object[] args)
executeMethodOnClass in interface RemoteTestModuleIFpublic static RemoteTestModule getCurrentThread()
public void notifyDynamicActionComplete(int actionId)
notifyDynamicActionComplete in interface RemoteTestModuleIFpublic static boolean getWaitFlag()
public static void setWaitFlag(boolean val)
public void disconnectVM()
throws RemoteException
disconnectVM in interface RemoteTestModuleIFRemoteExceptionpublic void shutDownVM(boolean disconnect,
boolean runShutdownHook)
throws RemoteException
shutDownVM in interface RemoteTestModuleIFdisconnect - whether to disconnect the VM from the distributed system
before shutting down.runShutdownHook - whether to run the client shutdown hookRemoteExceptionpublic void runShutdownHook()
runShutdownHook in interface RemoteTestModuleIFprotected void shutdown()
public static String getMyHost()
public static String getMyLogicalHost()
public static int getMyPid()
public static String getMyClientName()
public static int getMyVmid()
public int getThreadId()
public static int getMyBaseThreadId()
public static int getMyNumThreads()
public int getThreadGroupId()
public String getThreadGroupName()
public TestTask getCurrentTask()
protected static ConfigHashtable tab()
public static long getClockSkew()
public static void openClockSkewStatistics()
public static void closeClockSkewStatistics()
protected static void handleRemoteException(String msg, RemoteException e)
protected static void handleRemoteException(String msg, RemoteException e, boolean rethrow)
protected static void initialize()
public static void main(String[] args)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.