org.jlf.log
Class RemoteLogManagerImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--org.jlf.log.RemoteLogManagerImpl
All Implemented Interfaces:
java.rmi.Remote, RemoteLogManager, java.io.Serializable

public class RemoteLogManagerImpl
extends java.rmi.server.UnicastRemoteObject
implements RemoteLogManager

RemoteLogManagerImpl is a concrete class which provides an RMI interface to the LogManager class so that RMI clients can remote control the application's logs. This class houses the default RMI registration in its main() method, binding with a name of (ApplicationName)RemoteLogManager, where (ApplicationName) is the name of the application as recorded in the property file or overridden in the LogManager class.

See Also:
LogManager, RemoteLogManager, Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
RemoteLogManagerImpl()
          Default constructor method.
 
Method Summary
 void addLoggingMechanism(java.lang.String logName, java.lang.String mechanismName)
          Adds a logging mechanism to the log given.
 java.lang.String getLogFieldSeparator(java.lang.String logName)
          Gets the current log field separator of a particular log.
 int getLoggingLevel(java.lang.String logName)
          Gets the current logging level of a particular log.
 java.lang.String[] getLoggingMechanismNames(java.lang.String logName)
          Returns all of the names of the logging mechanisms currently active for the log given as input.
 java.lang.String[] getLogNames()
          Retrieves all of the names of the logs registered in the virtual machine.
protected  Log logForName(java.lang.String logName)
          Helper method to find a log in the LogManager given a String name.
 void logString(java.lang.String logName, java.lang.String logString, int loggingLevel)
          Adds a message string to the log if the log's level is currently set at or above the loggingLevel passed in.
static void main(java.lang.String[] args)
          This method binds the remote log manager so RMI clients can access it.
 void removeLoggingMechanism(java.lang.String logName, java.lang.String mechanismName)
          Removes a logging mechanism from the log given.
 void setLogFieldSeparator(java.lang.String logName, java.lang.String logFieldSeparator)
          Resets the current log field separator of a particular log.
 void setLoggingLevel(java.lang.String logName, int loggingLevel)
          Resets the current logging level of a particular log.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteLogManagerImpl

public RemoteLogManagerImpl()
                     throws java.rmi.RemoteException
Default constructor method.

Method Detail

logForName

protected Log logForName(java.lang.String logName)
Helper method to find a log in the LogManager given a String name.


getLogNames

public java.lang.String[] getLogNames()
                               throws java.rmi.RemoteException
Retrieves all of the names of the logs registered in the virtual machine.

Specified by:
getLogNames in interface RemoteLogManager
Throws:
java.rmi.RemoteException

getLogFieldSeparator

public java.lang.String getLogFieldSeparator(java.lang.String logName)
                                      throws java.rmi.RemoteException
Gets the current log field separator of a particular log.

Specified by:
getLogFieldSeparator in interface RemoteLogManager
Parameters:
logName - The name of the log as a string
java.rmi.RemoteException

setLogFieldSeparator

public void setLogFieldSeparator(java.lang.String logName,
                                 java.lang.String logFieldSeparator)
                          throws java.rmi.RemoteException
Resets the current log field separator of a particular log.

Specified by:
setLogFieldSeparator in interface RemoteLogManager
Parameters:
logName - The name of the log as a string
java.rmi.RemoteException

getLoggingLevel

public int getLoggingLevel(java.lang.String logName)
                    throws java.rmi.RemoteException
Gets the current logging level of a particular log.

Specified by:
getLoggingLevel in interface RemoteLogManager
Parameters:
logName - The name of the log as a string
java.rmi.RemoteException

setLoggingLevel

public void setLoggingLevel(java.lang.String logName,
                            int loggingLevel)
                     throws java.rmi.RemoteException
Resets the current logging level of a particular log.

Specified by:
setLoggingLevel in interface RemoteLogManager
Parameters:
logName - The name of the log as a string
java.rmi.RemoteException

getLoggingMechanismNames

public java.lang.String[] getLoggingMechanismNames(java.lang.String logName)
                                            throws java.rmi.RemoteException
Returns all of the names of the logging mechanisms currently active for the log given as input.

Specified by:
getLoggingMechanismNames in interface RemoteLogManager
Parameters:
logName - The name of the log as a string
java.rmi.RemoteException

addLoggingMechanism

public void addLoggingMechanism(java.lang.String logName,
                                java.lang.String mechanismName)
                         throws java.rmi.RemoteException
Adds a logging mechanism to the log given.

Specified by:
addLoggingMechanism in interface RemoteLogManager
Parameters:
logName - The name of the log as a string
java.rmi.RemoteException

removeLoggingMechanism

public void removeLoggingMechanism(java.lang.String logName,
                                   java.lang.String mechanismName)
                            throws java.rmi.RemoteException
Removes a logging mechanism from the log given.

Specified by:
removeLoggingMechanism in interface RemoteLogManager
Parameters:
logName - The name of the log as a string
java.rmi.RemoteException

main

public static void main(java.lang.String[] args)
This method binds the remote log manager so RMI clients can access it. The naming convention is .RemoteLogManager


logString

public void logString(java.lang.String logName,
                      java.lang.String logString,
                      int loggingLevel)
               throws java.rmi.RemoteException
Adds a message string to the log if the log's level is currently set at or above the loggingLevel passed in.

Specified by:
logString in interface RemoteLogManager
Parameters:
logName - The name of the log as a string
logString - The string to write to all logging mechanisms
loggingLevel - The level at which to log the string.
java.rmi.RemoteException