All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class telephony.manager.ManagementClient

java.lang.Object
   |
   +----java.rmi.server.RemoteObject
           |
           +----java.rmi.server.RemoteServer
                   |
                   +----java.rmi.server.UnicastRemoteObject
                           |
                           +----telephony.manager.ManagementClient

public class ManagementClient
extends UnicastRemoteObject
implements ManagementClientInterface, Runnable
The ManagementClient is the class which provides functionality to system components via local static methods.

The two methods of interest to progammers using this class are

manageFunctionInvocation()

manageFunctionTermination()

To use this class in a java program, do the following:

  • import telephony.manager.ManagementClient (note that your CLASSPATH must be set appropriately, e.g. CLASSPATH = /usr/local/jdk1.1.6/lib/classes.zip:/amd/babbage/a/cs519g1)
  • at the beginning of each interface function,call manageFunctionInvocation
  • at the end of each interface function, call manageFunctionTermination
  • if an exception is caught, check the return value and take appropriate action as described in the management interface specification
  • note that the argument ClientName handed to these functions is a String. It should be unique among all modules running on the same host.
  • note that for the function name, "main," the KeyFunctionArg should begin with the module type of the module.
  • 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

    Method Index

     o manageFunctionInvocation(String, String, String)
    This is one of the two public methods intended for use by programmers.
     o manageFunctionTermination(String, String, String)
    This is one of the two public methods intended for use by programmers.
     o run()
    This method lets the ManagementClient be spawned in a thread, and gets it to keep trying to flush its log to the server.
     o setInvocationRV(String, String, int)
    This public RMI method allows the server to set return values.
     o setLogCapacity(int)
    This public RMI method allows the server to set the LogSize.
     o setTerminationRV(String, String, int)
    This public RMI method allows the server to set return values.

    Methods

     o 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
     o 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
     o 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.

     o 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
     o 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.
     o 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