ecologylab.services.logging
Class NIOLoggingServer
java.lang.Object
ecologylab.generic.Debug
ecologylab.services.distributed.impl.NIOServerBase
ecologylab.services.distributed.server.DoubleThreadedNIOServer
ecologylab.services.logging.NIOLoggingServer
- All Implemented Interfaces:
- StartAndStoppable, NetworkingConstants, ServerConstants, ServicesHostsAndPorts, SessionObjects, Shutdownable, NIOServerFrontend, java.lang.Runnable
public class NIOLoggingServer
- extends DoubleThreadedNIOServer
- implements ServicesHostsAndPorts
A server that automatically records any incoming log data to a local file. The file is specified by the Prologue
provided by the Logging client.
- Author:
- Zachary O. Toups (toupsz@cs.tamu.edu)
- See Also:
Logging
|
Constructor Summary |
protected |
NIOLoggingServer(int portNumber,
java.net.InetAddress[] inetAddress,
TranslationSpace requestTranslationSpace,
Scope objectRegistry,
int idleConnectionTimeout,
int maxPacketSize)
|
|
Method Summary |
protected LoggingClientManager |
generateContextManager(java.lang.Object token,
java.nio.channels.SelectionKey sk,
TranslationSpace translationSpaceIn,
Scope registryIn)
Hook method to allow changing the ContextManager to enable specific extra
functionality. |
static NIOLoggingServer |
getInstance(java.net.InetAddress[] inetAddress,
Scope objectRegistry,
int idleConnectionTimeout,
int maxPacketSize)
This is the actual way to create an instance of this. |
static NIOLoggingServer |
getInstance(java.net.InetAddress inetAddress,
Scope objectRegistry,
int idleConnectionTimeout,
int maxPacketSize)
This is the actual way to create an instance of this. |
java.lang.String |
getLogFilesPath()
|
static void |
main(java.lang.String[] args)
Launches an instance of the logging server. |
void |
setLogFilesPath(java.lang.String path)
Sets the directory to which to write log files. |
void |
start()
Displays some information about the logging server, then calls super.start() |
| Methods inherited from class ecologylab.generic.Debug |
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
LOGGING_CLASSES
public static final java.lang.Class[] LOGGING_CLASSES
NIOLoggingServer
protected NIOLoggingServer(int portNumber,
java.net.InetAddress[] inetAddress,
TranslationSpace requestTranslationSpace,
Scope objectRegistry,
int idleConnectionTimeout,
int maxPacketSize)
throws java.io.IOException,
java.net.BindException
- Throws:
java.io.IOException
java.net.BindException
getInstance
public static NIOLoggingServer getInstance(java.net.InetAddress inetAddress,
Scope objectRegistry,
int idleConnectionTimeout,
int maxPacketSize)
- This is the actual way to create an instance of this.
- Parameters:
portNumber - translationSpace - objectRegistry - authListFilename - -
a file name indicating the location of the authentication list; this should be an XML file of an
AuthenticationList object.
- Returns:
- A server instance, or null if it was not possible to open a ServerSocket on the port on this machine.
getInstance
public static NIOLoggingServer getInstance(java.net.InetAddress[] inetAddress,
Scope objectRegistry,
int idleConnectionTimeout,
int maxPacketSize)
- This is the actual way to create an instance of this.
- Parameters:
portNumber - translationSpace - objectRegistry - authListFilename - -
a file name indicating the location of the authentication list; this should be an XML file of an
AuthenticationList object.
- Returns:
- A server instance, or null if it was not possible to open a ServerSocket on the port on this machine.
main
public static void main(java.lang.String[] args)
throws java.net.UnknownHostException
- Launches an instance of the logging server.
- Parameters:
args - the parameters for the server instance: first argument is the local directory to which to write files;
second argument is the maximum packet size to accept from the client.
- Throws:
java.net.UnknownHostException
setLogFilesPath
public void setLogFilesPath(java.lang.String path)
- Sets the directory to which to write log files.
- Parameters:
path -
getLogFilesPath
public java.lang.String getLogFilesPath()
- Returns:
- the log file path.
generateContextManager
protected LoggingClientManager generateContextManager(java.lang.Object token,
java.nio.channels.SelectionKey sk,
TranslationSpace translationSpaceIn,
Scope registryIn)
- Description copied from class:
DoubleThreadedNIOServer
- Hook method to allow changing the ContextManager to enable specific extra
functionality.
- Overrides:
generateContextManager in class DoubleThreadedNIOServer
start
public void start()
- Displays some information about the logging server, then calls super.start()
- Specified by:
start in interface StartAndStoppable- Overrides:
start in class DoubleThreadedNIOServer
- See Also:
DoubleThreadedNIOServer.start()