invoke your java program with the flag
-DManagementServerURL=rmi://<ManagementServer Host>/<ManagementServer Name>
There is currently a slight bug; some thread remains running, and the JVM
won't voluntarily terminate with a thread running. Worse yet, it appears
that all threads are appropriately instructed to quit, so the bug is subtle.
Call System.exit(0) at the end of your program to force an exit.
- Author:
- David L. Roxe
-
manageFunctionInvocation(String, String, String)
- This is one of the two public methods intended for use by programmers.
-
manageFunctionTermination(String, String, String)
- This is one of the two public methods intended for use by programmers.
-
run()
- This method lets the ManagementClient be
spawned in a thread, and gets it to keep
trying to flush its log to the server.
-
setInvocationRV(String, String, int)
- This public RMI method allows the server to set return values.
-
setLogCapacity(int)
-
This public RMI method allows the server
to set the LogSize.
-
setTerminationRV(String, String, int)
- This public RMI method allows the server to set return values.
manageFunctionInvocation
public static int manageFunctionInvocation(String ClientName,
String FunctionName,
String KeyFunctionArg) throws ManagementSystemErrorException, ManagementAccessDeniedException
- This is one of the two public methods intended for use by programmers.
The first time a system component calls this function (determined by
FunctionName.equals(Main)), it calls initClientThread(ModuleName).
This method returns almost immediately. Before it does, it spawns
an anonymous thread which invokes a method on the client's
ClientLog to log the information passed via the parameters.
- Parameters:
- ClientName - the name given to this client. ClientName should be unique
for each ManagementClient on a given host.
- FunctionName - the name of the function call being logged
- KeyFunctionArg - a String containing all interesting information about
the parameters given to the function call being logged. The string should
be formatted according to the Management interface specification. If the
function call being logged is "main," KeyFunctionArg should include the
type of the module using this ManagementClient.
- Returns:
- the server-specified RV for this client for invocation this function for this parameter information.
- Throws: ManagementSystemErrorException
- Throws an exception if the operation can not complete.
- Throws: ManagementAccessDeniedException
- Throws an exception if the operation may not complete.
- See Also:
- setInvocationRV, InvocationRVs
manageFunctionTermination
public static int manageFunctionTermination(String ClientName,
String FunctionName,
String KeyFunctionArg) throws ManagementSystemErrorException, ManagementAccessDeniedException
- This is one of the two public methods intended for use by programmers.
- Parameters:
- ClientName - the name given to this client. ClientName should be unique
for each ManagementClient on a given host.
- FunctionName - the name of the function call being logged
- KeyFunctionArg - a String containing all interesting information about
the parameters given to the function call being logged. The string should
be formatted according to the Management interface specification. If the
function call being logged is "main," KeyFunctionArg should include the
type of the module using this ManagementClient.
- Returns:
- the server-specified RV for this client for termination of this function for this parameter information.
- Throws: ManagementSystemErrorException
- Throws an exception if the operation can not complete.
- Throws: ManagementAccessDeniedException
- Throws an exception if the operation may not complete.
- See Also:
- manageFunctionInvocation, TerminationRVs, setTerminationRV
run
public void run()
- This method lets the ManagementClient be
spawned in a thread, and gets it to keep
trying to flush its log to the server.
setLogCapacity
public int setLogCapacity(int NewLogSize) throws RemoteException
- This public RMI method allows the server
to set the LogSize.
- Parameters:
- NewLogSize - the new LogSize
- Returns:
- the updated LogSize
setInvocationRV
public int setInvocationRV(String FunctionName,
String KeyFunctionArg,
int NewInvocationRV) throws RemoteException
- This public RMI method allows the server to set return values.
- Parameters:
- FunctionName - the name of the
function whose return value is being set.
- KeyFunctionArg - the value of
the key argument to the given
FunctionName
for which
the return value is being set.
- NewInvocationRV - the new return
value for
manageFunctionInvocation
, for the given
FunctionName
and FunctionArg
.
- Returns:
- the updated value of the specified
InvocationRV, which should be the same as NewInvocationRV if
the method was successful.
setTerminationRV
public int setTerminationRV(String FunctionName,
String KeyFunctionArg,
int NewTerminationRV) throws RemoteException
- This public RMI method allows the server to set return values.
- See Also:
- setInvocationRV
All Packages Class Hierarchy This Package Previous Next Index