QJCC homepage

biz.chitec.quarterback.gjsa.server
Class GJSAServer

java.lang.Object
  extended byjava.lang.Thread
      extended bybiz.chitec.quarterback.gjsa.server.GJSAServer
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
QJChatServer, SyncBurstReceiverDemo.SyncBurstDemoServer

public abstract class GJSAServer
extends java.lang.Thread

GJSA server main base. The master main thread of a GJSA server. This one listens on the port and instanciates new ServerThreadHandlers for every new connection. Furthermore, it handles the storage of overall server properties and controls the encryption engine for the GJSA connection, if available.

Version:
$Id: 2465f3e19502b5c8dc60b62650af41c92bd5a257 $
Author:
Dirk Hillbrecht 1997-2000, chitec/Dirk Hillbrecht 2000-2002. Distributed under the terms of the GNU LGPL.

Nested Class Summary
protected static class GJSAServer.SocketListeningThread
          Socket listening thread.
 
Field Summary
protected  Logger adminmsg
          The logger for messages from the admin to all conntected clients
protected  java.util.Map anyvalue
          The internal data storage.
protected  UpdateableLogger clie
          Logger for changes in client list
protected  boolean clsupport
          Flag to indicate whether connectionless connections are supported
protected  InitialExecutorAdder initialexecutoradder
          Storage for the object that stores the vectors with the initial executors.
private  java.util.LinkedList lastexceptions
          Global list for storing "normal" exceptions for debug purposes
private  java.lang.String localipfromparams
          Special storage for local ip if given by command line parameter
 LogFileWriter logfilewriter
          Main logging object writer utility.
private  LoggerCenter loggercenter
          storage for all loggers
private  java.lang.String loggingandportprefix
          Special prefix for port and logging data, only used for server startup, not for administratin on
protected  GJSAServer.SocketListeningThread mainpl
          Listener thread for the object mode port.
private static int MAXLASTEXCEPTIONSIZE
           
protected  Logger mess
          The main logger.
protected  Killer mykiller
          Killer if started with prekill time
protected  GJSAServer.SocketListeningThread objpl
          Listener thread for the object mode port.
protected  GJSAServer.SocketListeningThread objsslpl
          Listener thread for the object mode port.
protected  int port
          Which port do I listen on?
protected  GJSAServer.SocketListeningThread secondarypl
          Listener thread for the object mode port.
protected  java.net.ServerSocket serversocket
          The server socket object.
protected  java.util.List serverstatesymbols
          List of symbol holders for the server states.
protected  java.util.Map serverthreadbases
          Map of all ServerThreadBase objects
protected  boolean sslavailable
          Stores whether SSL is activated
protected  GJSAServer.SocketListeningThread sslpl
          Listener thread for the object mode port.
protected  ServerThreadInitiator sti
          The initiator for new threads.
protected  GJSAServer.SocketListeningThread utf8pl
          Listener thread for the object mode port.
protected  GJSAServer.SocketListeningThread utf8sslpl
          Listener thread for the object mode port.
 Vulture vulture
          The connection remover
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
GJSAServer()
          Minimalistic constructor that does not do anything more than the absolutely mandatory steps.
GJSAServer(int portx)
          Constructor with ports only.
GJSAServer(int portx, InitialExecutorAdder initialexecutoradderx)
          Constructor with ports and executors init.
GJSAServer(int portx, ServerThreadInitiator stix)
          Constructor with ports and thread init.
GJSAServer(int portx, ServerThreadInitiator stix, InitialExecutorAdder initialexecutoradderx)
           
GJSAServer(int portx, java.lang.String loggingandportprefixx)
          Constructor with port and prefix for logging and port property
GJSAServer(int portx, java.lang.String loggingandportprefixx, ServerThreadInitiator stix, InitialExecutorAdder initialexecutoradderx)
          Stadard constructor with ports, thread init object and executors
 
Method Summary
 void addDebugException(java.lang.Throwable t)
          Adds an exception instance to the debug information
protected  int evalArgument(int i, java.lang.String[] args)
          Evaluate one argument.
 void exitRequest(boolean forceexit, int exitcode)
          Start exit sequence without a config logger.
 void exitRequest(boolean forceexit, int exitcode, java.lang.String configlogger)
           
 void exitRequest(boolean forceexit, int exitcode, java.lang.String configlogger, int prekilltime)
           
 void exitRequest(boolean forceexit, int exitcode, java.lang.String configlogger, int prekilltime, java.lang.String message)
          Start exit sequence.
 java.lang.Object get(java.lang.String key)
          Get any object out of the storage, might return null.
 java.util.List getAdditionalLoggingExecutors(ServerThreadBase stb)
          Returns list of additional executors for logging state
abstract  java.lang.String getAddon()
          Return version addon
 CommandExecutor getAdminExecutor(ServerThreadBase stb)
          Returns the adminsitrative executor.
 boolean getBoolean(java.lang.String key)
          Get boolean value.
 boolean getBoolean(java.lang.String key, boolean deft)
          Get a boolean value out of the storage.
protected  EDate getBuildDate()
          Return the build date if such a mechanism is available.
 java.lang.String getCompleteVersionString()
          Returns a standard version string.
 boolean getConnectionlessSupported()
          returns whether connectionless connections are supported.
 java.util.List getDebugExceptions(int count)
          Returns the last exceptions stored for debug purposes.
 int getInteger(java.lang.String key)
          Get an Integer out of the storage.
 int getInteger(java.lang.String key, int defaultvalue)
          Get an Integer out of the storage.
 Logger getLogger(java.lang.String key)
          Get a named logger.
 LoggerCenter getLoggerCenter()
          Returns the logger center for registering or unregistering receivers.
abstract  int getPatchLevel()
          Return patchlevel number
 int getPort()
          Returns the port the server listens on.
 java.util.List getPropertyDescriptions(java.util.Locale locale)
           
protected abstract  java.lang.String getSaveFileName()
          Return default name of savefile.
 java.util.List getSaveNames()
          Return names of saveable data.
abstract  java.lang.String getServerName()
          Return name of the server application.
private  java.net.ServerSocket getServerSocket(javax.net.ServerSocketFactory ssf, int minport, int maxport, java.net.InetAddress localaddress)
          Create a socket on a free port.
 java.lang.String getServerStateName(int state)
          Converts a server state numeric value into its symbols equivalent.
 int getServerStateSymbol(java.lang.String statename)
          Transforms a server state symbolic name into its numerical equivalent.
 java.util.Map getServerThreadBaseMap()
          Returns the ServerThreadBases' map
 java.lang.String getString(java.lang.String key)
          Get a string out of the storage.
 java.lang.String getString(java.lang.String key, java.lang.String defaultvalue)
          Get a string out of the storage.
abstract  int getSubVersion()
          Return subversion number
abstract  int getVersion()
          Return main version number
 ServerEnvelope handleCLEnvelope(ServerEnvelope se, boolean encrypted, int encodingmode)
          Passes a connectionless query from a remote client to the appropriate ServerThreadBase.
 boolean isCLSupported()
          Returns whether connectionless connections are allowed
protected  void loadArguments(java.lang.String[] args)
          Argument evaluation loop.
protected  void loadFromFile()
          Load the properties from the persistance file into the internal storage.
protected  void loadPropertyFileName(java.lang.String[] args)
          Search for the propertyfile name in the arguments.
private  java.lang.String makeLogString(java.lang.String str)
          Make a String to [not given] if not available.
 boolean objListening()
          Returns whether the server accepts unencryted object mode connections.
 void put(java.lang.String key, java.lang.Object value)
          Store any object into the storage
 void putBoolean(java.lang.String key, boolean bool)
          Put a boolean into the storage.
 void putInteger(java.lang.String key, int value)
          Put an Integer into the storage.
protected  void putLogger(java.lang.String key, Logger l)
          Add a Logger.
 void putString(java.lang.String key, java.lang.String value)
          Put a String into the Storage.
 void registerThreadBase(ServerThreadBase stb)
           
 void releaseThreadBase(ServerThreadBase stb)
           
 java.lang.Object remove(java.lang.String key)
          Remove an object from the storage.
protected  void removeLogger(java.lang.String key)
          Remove a Logger (server-internally callable only)
 void restartServices()
          Restarts the port listeners and the handle threads for them.
 void run()
          Does the main handling loop.
protected  void runBootSequence(java.lang.String[] args)
          Top level booting function.
 void saveToFile()
          Save all properties into the default persistance file.
 void saveToFile(java.lang.String savefile)
          Save all properties into a persistance file.
 void setInitialExecutorAdder(InitialExecutorAdder initialexecutoradderx)
          Sets the object which holds the information about the initially used CommandExecutor objects.
 void setPort(int p)
          Set the port the server listens on.
 void setServerThreadInitiator(ServerThreadInitiator stix)
          Introduce an alternative thread initiating method.
protected  void showHelp()
          Show help text.
protected  void showLoadedArguments()
          Show all loaded properties or arguments.
 boolean sslListening()
          Returns whether the server accepts encrypted ISO-8859-15-String mode connections.
 boolean sslObjListening()
          Returns whether the server accepts encryted object mode connections.
 boolean sslUtf8Listening()
          Returns whether the server accepts encryted UTF-8-String mode connections.
protected  void startAdditionalServices(java.net.InetAddress localaddress)
          Start the service by opening all needed socket listening threads and finally the main ServerSocket object
protected  void startServices(int exitcode)
          Starts all listening services on the ports and the additional threads for them.
 void stopExitProcess()
          Stops a pending exit request in prekill phase.
protected  void stopServices()
          Stop all port listeners and handle threads.
 boolean utf8Listening()
          Returns whether the server accepts unencryted UTF-8-String mode connections.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAXLASTEXCEPTIONSIZE

private static final int MAXLASTEXCEPTIONSIZE
See Also:
Constant Field Values

vulture

public Vulture vulture
The connection remover


loggercenter

private LoggerCenter loggercenter
storage for all loggers


logfilewriter

public LogFileWriter logfilewriter
Main logging object writer utility.


localipfromparams

private java.lang.String localipfromparams
Special storage for local ip if given by command line parameter


port

protected int port
Which port do I listen on?


serversocket

protected java.net.ServerSocket serversocket
The server socket object.


anyvalue

protected java.util.Map anyvalue
The internal data storage.


mess

protected Logger mess
The main logger.


adminmsg

protected Logger adminmsg
The logger for messages from the admin to all conntected clients


clie

protected UpdateableLogger clie
Logger for changes in client list


initialexecutoradder

protected InitialExecutorAdder initialexecutoradder
Storage for the object that stores the vectors with the initial executors.


sti

protected ServerThreadInitiator sti
The initiator for new threads.


mainpl

protected GJSAServer.SocketListeningThread mainpl
Listener thread for the object mode port.


utf8pl

protected GJSAServer.SocketListeningThread utf8pl
Listener thread for the object mode port.


objpl

protected GJSAServer.SocketListeningThread objpl
Listener thread for the object mode port.


sslpl

protected GJSAServer.SocketListeningThread sslpl
Listener thread for the object mode port.


utf8sslpl

protected GJSAServer.SocketListeningThread utf8sslpl
Listener thread for the object mode port.


objsslpl

protected GJSAServer.SocketListeningThread objsslpl
Listener thread for the object mode port.


secondarypl

protected GJSAServer.SocketListeningThread secondarypl
Listener thread for the object mode port.


sslavailable

protected boolean sslavailable
Stores whether SSL is activated


clsupport

protected boolean clsupport
Flag to indicate whether connectionless connections are supported


serverstatesymbols

protected java.util.List serverstatesymbols
List of symbol holders for the server states. This one should be extended by decessors of GJSAServer to include symbol holders for the server states that are specific for that server


serverthreadbases

protected java.util.Map serverthreadbases
Map of all ServerThreadBase objects


mykiller

protected Killer mykiller
Killer if started with prekill time


loggingandportprefix

private java.lang.String loggingandportprefix
Special prefix for port and logging data, only used for server startup, not for administratin on


lastexceptions

private java.util.LinkedList lastexceptions
Global list for storing "normal" exceptions for debug purposes

Constructor Detail

GJSAServer

public GJSAServer(int portx,
                  java.lang.String loggingandportprefixx,
                  ServerThreadInitiator stix,
                  InitialExecutorAdder initialexecutoradderx)
Stadard constructor with ports, thread init object and executors

Parameters:
portx - Description of the Parameter
stix - Description of the Parameter
initialexecutoradderx - Description of the Parameter

GJSAServer

public GJSAServer(int portx,
                  ServerThreadInitiator stix,
                  InitialExecutorAdder initialexecutoradderx)

GJSAServer

public GJSAServer(int portx,
                  ServerThreadInitiator stix)
Constructor with ports and thread init.

Parameters:
portx - Description of the Parameter
stix - Description of the Parameter

GJSAServer

public GJSAServer(int portx,
                  InitialExecutorAdder initialexecutoradderx)
Constructor with ports and executors init.

Parameters:
portx - Description of the Parameter
initialexecutoradderx - Description of the Parameter

GJSAServer

public GJSAServer(int portx,
                  java.lang.String loggingandportprefixx)
Constructor with port and prefix for logging and port property


GJSAServer

public GJSAServer(int portx)
Constructor with ports only.


GJSAServer

public GJSAServer()
Minimalistic constructor that does not do anything more than the absolutely mandatory steps.

Method Detail

getServerName

public abstract java.lang.String getServerName()
Return name of the server application.

Returns:
The serverName value

getVersion

public abstract int getVersion()
Return main version number

Returns:
The version value

getSubVersion

public abstract int getSubVersion()
Return subversion number

Returns:
The subVersion value

getPatchLevel

public abstract int getPatchLevel()
Return patchlevel number

Returns:
The patchLevel value

getAddon

public abstract java.lang.String getAddon()
Return version addon

Returns:
The addon value

getSaveFileName

protected abstract java.lang.String getSaveFileName()
Return default name of savefile. Must be set/(re)defined.

Returns:
The saveFileName value

getBuildDate

protected EDate getBuildDate()
Return the build date if such a mechanism is available. Default implementation returns null.

Returns:
Build date of the server, null if no build date is available.

getSaveNames

public java.util.List getSaveNames()
Return names of saveable data. Format of returned data is List of Strings semantically alternating between a "name" and a "value". "name" is the name of a property, "value" is further information about the property. Each value consists of one or more of the following characters:

Returns:
The saveNames value

getPropertyDescriptions

public java.util.List getPropertyDescriptions(java.util.Locale locale)

getCompleteVersionString

public java.lang.String getCompleteVersionString()
Returns a standard version string.

Returns:
The completeVersionString value

getConnectionlessSupported

public boolean getConnectionlessSupported()
returns whether connectionless connections are supported.


getServerStateName

public java.lang.String getServerStateName(int state)
Converts a server state numeric value into its symbols equivalent. If the state is not known, an exception is raised to help debugging, and a replacement representation is returned.


getServerStateSymbol

public int getServerStateSymbol(java.lang.String statename)
Transforms a server state symbolic name into its numerical equivalent.

Parameters:
statename - A server state name
Returns:
Numerical representation of the server state

isCLSupported

public boolean isCLSupported()
Returns whether connectionless connections are allowed


registerThreadBase

public void registerThreadBase(ServerThreadBase stb)

releaseThreadBase

public void releaseThreadBase(ServerThreadBase stb)

handleCLEnvelope

public ServerEnvelope handleCLEnvelope(ServerEnvelope se,
                                       boolean encrypted,
                                       int encodingmode)
Passes a connectionless query from a remote client to the appropriate ServerThreadBase. The query contains the handle number of the ServerThreadBase which should handle it. Sequence counters are checked. Local control is explicitly disabled.

Parameters:
se - Query to ask
encrypted - Flag whether the query came through an encrypted channel
encodingmode - Connection encoding
Returns:
Same envelope as having been passed, but with answers included

getServerThreadBaseMap

public java.util.Map getServerThreadBaseMap()
Returns the ServerThreadBases' map


get

public java.lang.Object get(java.lang.String key)
Get any object out of the storage, might return null.

Parameters:
key - Description of the Parameter
Returns:
Description of the Return Value

put

public void put(java.lang.String key,
                java.lang.Object value)
Store any object into the storage

Parameters:
key - Description of the Parameter
value - Description of the Parameter

remove

public java.lang.Object remove(java.lang.String key)
Remove an object from the storage.

Parameters:
key - Description of the Parameter
Returns:
Description of the Return Value

getBoolean

public boolean getBoolean(java.lang.String key,
                          boolean deft)
Get a boolean value out of the storage. If there is no object with this key in the storage, returns the given default value.

Parameters:
key - Description of the Parameter
deft - Description of the Parameter
Returns:
The boolean value

getBoolean

public boolean getBoolean(java.lang.String key)
Get boolean value. If there is no object with this key in the storage, returns false.

Parameters:
key - Description of the Parameter
Returns:
The boolean value

putBoolean

public void putBoolean(java.lang.String key,
                       boolean bool)
Put a boolean into the storage.

Parameters:
key - Description of the Parameter
bool - Description of the Parameter

getString

public java.lang.String getString(java.lang.String key,
                                  java.lang.String defaultvalue)
Get a string out of the storage. Returns the given default value if object does not exist.

Parameters:
key - Key to search for in the internal data storage.
defaultvalue - Value to return if the key is not found.
Returns:
Value in the storage stored for the given key or the given default value if the key is not found

getString

public java.lang.String getString(java.lang.String key)
Get a string out of the storage. Returns empty string ("") if object does not exist.

Parameters:
key - Key to search for in the internal data storage.
Returns:
Value in the storage stored for the given key or the given default value if the key is not found

putString

public void putString(java.lang.String key,
                      java.lang.String value)
Put a String into the Storage.

Parameters:
key - Description of the Parameter
value - Description of the Parameter

getInteger

public int getInteger(java.lang.String key,
                      int defaultvalue)
Get an Integer out of the storage. Returns the given default value if there is no appropriate object.

Parameters:
key - Value name
defaultvalue - Default value to return if nothing is stored
Returns:
Value, given default if nothing is stored

getInteger

public int getInteger(java.lang.String key)
Get an Integer out of the storage. Returns 0 if there is no appropriate object.

Parameters:
key - Description of the Parameter
Returns:
The integer value

putInteger

public void putInteger(java.lang.String key,
                       int value)
Put an Integer into the storage.

Parameters:
key - Description of the Parameter
value - Description of the Parameter

saveToFile

public void saveToFile(java.lang.String savefile)
                throws java.io.IOException
Save all properties into a persistance file.

Parameters:
savefile - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

saveToFile

public void saveToFile()
                throws java.io.IOException
Save all properties into the default persistance file.

Throws:
java.io.IOException - Description of the Exception

loadFromFile

protected void loadFromFile()
Load the properties from the persistance file into the internal storage.


getLogger

public Logger getLogger(java.lang.String key)
Get a named logger.

Parameters:
key - Description of the Parameter
Returns:
The logger value

putLogger

protected void putLogger(java.lang.String key,
                         Logger l)
Add a Logger. Note that Logger can only be inserted by the server itself, the server-provided logger objects are more or less static during the server's livetime.

Parameters:
key - Description of the Parameter
l - Description of the Parameter

removeLogger

protected void removeLogger(java.lang.String key)
Remove a Logger (server-internally callable only)

Parameters:
key - Description of the Parameter

getLoggerCenter

public LoggerCenter getLoggerCenter()
Returns the logger center for registering or unregistering receivers.


addDebugException

public void addDebugException(java.lang.Throwable t)
Adds an exception instance to the debug information

Parameters:
t - Throwable to store for debug purposes

getDebugExceptions

public java.util.List getDebugExceptions(int count)
Returns the last exceptions stored for debug purposes. Data is returned in a string-based manner.

Parameters:
count - Number of exceptions to return, always returned from the most current one backwards
Returns:
List of exception descriptions - exception name and stack trace in string version are returned.

setPort

public void setPort(int p)
Set the port the server listens on. This method must be called before the main loop begins, because afterwards, the ServerSocket object is fixed to that certain port.

Parameters:
p - The new port value

getPort

public int getPort()
Returns the port the server listens on.

Returns:
The port value

sslListening

public boolean sslListening()
Returns whether the server accepts encrypted ISO-8859-15-String mode connections.


utf8Listening

public boolean utf8Listening()
Returns whether the server accepts unencryted UTF-8-String mode connections.


sslUtf8Listening

public boolean sslUtf8Listening()
Returns whether the server accepts encryted UTF-8-String mode connections.


objListening

public boolean objListening()
Returns whether the server accepts unencryted object mode connections.


sslObjListening

public boolean sslObjListening()
Returns whether the server accepts encryted object mode connections.


setInitialExecutorAdder

public void setInitialExecutorAdder(InitialExecutorAdder initialexecutoradderx)
Sets the object which holds the information about the initially used CommandExecutor objects. By this method, the server becomes configurable on the whole.

Parameters:
initialexecutoradderx - The new initialExecutorAdder value

setServerThreadInitiator

public void setServerThreadInitiator(ServerThreadInitiator stix)
Introduce an alternative thread initiating method. This way, one can introduce another way to establish connections on the low level (e.g. connectionless connections).

Parameters:
stix - The new serverThreadInitiator value

getAdminExecutor

public CommandExecutor getAdminExecutor(ServerThreadBase stb)
Returns the adminsitrative executor. By default, this method returns an instance of BasicAdminExecutor. If overloaded, it should return an ancestor of BasicAdminExecutor.

Parameters:
stb - Description of the Parameter
Returns:
The adminExecutor value

getAdditionalLoggingExecutors

public java.util.List getAdditionalLoggingExecutors(ServerThreadBase stb)
Returns list of additional executors for logging state


makeLogString

private java.lang.String makeLogString(java.lang.String str)
Make a String to [not given] if not available.

Parameters:
str - Description of the Parameter
Returns:
Description of the Return Value

showLoadedArguments

protected void showLoadedArguments()
Show all loaded properties or arguments.


showHelp

protected void showHelp()
Show help text. This one should be overloaded if applicable...


evalArgument

protected int evalArgument(int i,
                           java.lang.String[] args)
                    throws java.lang.Exception
Evaluate one argument. The method is called from the argument evaluation loop. It evaluates whatever is at the given position and returns the next position in the arguments which has not been covered by that evaluation.

If a descending class wants to evaluate additional arguments, it should override this method and call the super implementation (which happens to be this one...)

Parameters:
i - Current position in the argument array
args - The complete argument array
Returns:
Next position to handle in the argument array
Throws:
java.lang.Exception - All exceptions lead to evaluation abortion.

loadArguments

protected final void loadArguments(java.lang.String[] args)
Argument evaluation loop. Evaluation of the arguments happens in evalArgument(int, String[]).

Parameters:
args - The complete argument list.

loadPropertyFileName

protected final void loadPropertyFileName(java.lang.String[] args)
Search for the propertyfile name in the arguments.

Parameters:
args - Complete argument list.

runBootSequence

protected void runBootSequence(java.lang.String[] args)
Top level booting function. Runs the complete bootstraping sequence: Evaluate parameters, load persistance storage.

Parameters:
args - List of arguments

getServerSocket

private java.net.ServerSocket getServerSocket(javax.net.ServerSocketFactory ssf,
                                              int minport,
                                              int maxport,
                                              java.net.InetAddress localaddress)
                                       throws java.io.IOException
Create a socket on a free port. Scans port range to find a free port if the first one is not available

Parameters:
ssf - Description of the Parameter
minport - Description of the Parameter
maxport - Description of the Parameter
Returns:
The serverSocket value
Throws:
java.io.IOException - Description of the Exception

startAdditionalServices

protected void startAdditionalServices(java.net.InetAddress localaddress)
Start the service by opening all needed socket listening threads and finally the main ServerSocket object


startServices

protected void startServices(int exitcode)
Starts all listening services on the ports and the additional threads for them. If opening the main port fails, the complete server will be halted with the given exitcode.


restartServices

public void restartServices()
Restarts the port listeners and the handle threads for them. Any config changes to ports or listener types are reflected by the result of execution. If any errors occur connecting the main listener, exit(1) is performed.


stopServices

protected void stopServices()
Stop all port listeners and handle threads. Be careful with this method. If it is executed without installing new listeners afterwards, the server will not be able to accept any new connections.


run

public void run()
Does the main handling loop. Makes the last checks on settings, then starts the additional listeners for object and SSL connections. Finally, starts main listener and calls its run() method so that it is not dispatched into own thread.


exitRequest

public void exitRequest(boolean forceexit,
                        int exitcode,
                        java.lang.String configlogger,
                        int prekilltime,
                        java.lang.String message)
Start exit sequence. Shuts the server down. If forceexit is set to true, this happens immideately, otherwise the actual turn down is delayed for some time (30 seconds max.) if some operations still run. if configlogger ist not null every five seconds it gets a message about the remaining seconds.

Parameters:
forceexit - Description of the Parameter
exitcode - Description of the Parameter
configlogger - Description of the Parameter

exitRequest

public void exitRequest(boolean forceexit,
                        int exitcode,
                        java.lang.String configlogger,
                        int prekilltime)

exitRequest

public void exitRequest(boolean forceexit,
                        int exitcode,
                        java.lang.String configlogger)

exitRequest

public void exitRequest(boolean forceexit,
                        int exitcode)
Start exit sequence without a config logger.

Parameters:
forceexit - Description of the Parameter
exitcode - Description of the Parameter

stopExitProcess

public void stopExitProcess()
Stops a pending exit request in prekill phase. If stopping is not possible, a CommandException is thrown. This happens either if no stopping is currently running or if stopping is already in killing phase.


QJCC homepage