|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectSK.gnome.dwarf.GenericService
SK.gnome.dwarf.GenericServer
SK.gnome.dwarf.main.MainServer
The main server application.
It can be used as a common container for other - more specific - servers. It provides also
remote management via the Console. An instance of this class can be created an started
easily by the Main static class.
| Field Summary | |
protected long |
started
The starting time of the server. |
| Fields inherited from class SK.gnome.dwarf.GenericService |
initParameters, parent |
| Fields inherited from interface SK.gnome.dwarf.Service |
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED |
| Constructor Summary | |
MainServer(java.lang.String name)
Creates a new MainServer. |
|
| Method Summary | |
void |
addService(Service service)
Adds a service to the server. |
Console |
getConsole()
Returns the server console. |
java.lang.String |
getUptime()
Returns the uptime. |
java.lang.String |
report()
Returns the service report. |
void |
shutdown()
Shuts down the server. |
void |
start()
Starts the server. |
| Methods inherited from class SK.gnome.dwarf.GenericServer |
addService, getAuthenticator, getLogger, getParameters, getService, getServices, getServices, init, removeService, stop |
| Methods inherited from class SK.gnome.dwarf.GenericService |
getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getName, getPrincipal, getShutdownTimeout, getState, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface SK.gnome.dwarf.Service |
getFullName, getName, getState, log, log, login, logout |
| Field Detail |
protected long started
| Constructor Detail |
public MainServer(java.lang.String name)
| Method Detail |
public Console getConsole()
Returns a reference to directly contained instance of the Console class,
or null if no such service exists.
The Console instance may be used to execute various console commands.
If a security manager is installed, the ServicePermission "getConsole" is checked first.
public void addService(Service service)
throws ServiceException
If the service being added to the server is an instance of the Console class,
a reference to it is stored inernally, and can be obtained later by the getConsole()
method.
addService in interface ServeraddService in class GenericServerServiceException
public void start()
throws ServiceException
The value of the started field is set to the current system time.
start in interface Servicestart in class GenericServerServiceExceptionpublic void shutdown()
GenericServerFirst shuts down the superclass and then shuts down all services contained by the
server by calling their Service.shutdown() methoda. Services will be processed
in the reverse order they were added to the server. It is left to the developer to take
care of the eventual service dependencies.
shutdown in interface Serviceshutdown in class GenericServerpublic java.lang.String getUptime()
Returns the total running time of the server.
public java.lang.String report()
Returns the uptime, starting time and the memory usage.
report in interface Reportablereport in class GenericServer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||