|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.lutris.multiServer.MultiServer
A stand-alone server. It starts and stops services like the ServletContainer.
At startup time a configuration file is read, and it describes what services to start. After this config file is read, and the server is set up, no further action is taken by the server. The thread that ran through main() exits. The Services must create threads, and they are responsible for receiving requests from the outside world and processing them.
Normally one of the Servlets will be an administration application. This admin app knows about this class, and so it knows how to talk to the current ConnectionMethods and Servlets. It may change the server setup on the fly. For example, it can create and add a new ConnectionMethod. Or it could add a new channel to an already existing ConnectionMethod. Or register a new Servlet. Or add a logging filter to a channel. Or monitor performance.
This class implements main(). It is meant to be run as a java application. Do not instantiate this class. Use the static variables.
The main()
function will initialize and configure the
global logging facility. The facility name is "MultiServer", and you
may use any of the level names defined in the Logger
class. One set of level names listed in the MultiServer config file
have their output directed to the server log file. Another set of
level names have their output directed to stderr
.
Text written to any other level name not mentioned in the server
config file will be ignored.
Any class running in this virtual machine
may write to the MultiServer log file, using the following code:
import com.lutris.logging.*; LogChannel logChan = Logger.getCentralLogger().getChannel("Multiserver"); int level = logChan.getLevel("ERROR"); logChan.write(level, "An error occured: ....");
Field Summary | |
static java.lang.String |
ACTIVATION_KEY
|
static java.lang.String |
ENTRAY_FILE
|
static java.lang.String |
LOG_CONF_FILE
|
static java.lang.String |
LOG_FILE
|
static java.lang.String |
LOG_TO_FILE
|
static java.lang.String |
LOG_TO_STDERR
|
static java.lang.String |
SERIAL_NUMBER
|
static java.lang.String |
SERVER
|
Method Summary | |
static long |
currentMemoryUsage(boolean forceGC)
This method is used to get the current value of the amount of memory being used by the virtual machine. |
static long |
getMaxMemoryUsage()
This method if for getting the value that has been stored as highwater mark for memory usage by the virtual machine. |
static Service |
getService(java.lang.String name)
Get the named service. |
static void |
main(java.lang.String[] argv)
The entry point for the stand-alone server. |
static void |
resetMaxMemoryUsage()
This method is used to reset the maxMemoryUsage back to zero. |
static void |
setMaxMemoryUsage(long used)
This method is used for setting the highwater mark for the amount of memory that the virtual machine has used. |
static void |
shutdown()
Shut down the server. |
static void |
stopAllServices()
Stops all services and returns. |
static java.lang.String |
writeConfigFile(java.lang.String filename)
This function examines the current state of the server and writes it out to the same config file that was read when the server was started up. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String SERVER
public static final java.lang.String LOG_FILE
public static final java.lang.String LOG_TO_FILE
public static final java.lang.String LOG_TO_STDERR
public static final java.lang.String SERIAL_NUMBER
public static final java.lang.String ACTIVATION_KEY
public static final java.lang.String LOG_CONF_FILE
public static final java.lang.String ENTRAY_FILE
Method Detail |
public static void main(java.lang.String[] argv)
argv
- An array of input parameters. None are required.public static void stopAllServices()
public static void shutdown()
public static Service getService(java.lang.String name)
public static java.lang.String writeConfigFile(java.lang.String filename)
filename
- The filename of the config file to write out.
If null, the same file that was read at startup time will be
rewritten.public static long getMaxMemoryUsage()
public static void setMaxMemoryUsage(long used)
used
- The amount of memory that has been used.public static void resetMaxMemoryUsage()
public static long currentMemoryUsage(boolean forceGC)
forceGC
- A boolean value to tell the method whether or
not to run garbage collection before getting the memory
statistics. WARNING!!! forcing garbage collection can cause
a major performance impact.
|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |