|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread biz.chitec.quarterback.gjsa.server.GJSAServer
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.
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 |
private static final int MAXLASTEXCEPTIONSIZE
public Vulture vulture
private LoggerCenter loggercenter
public LogFileWriter logfilewriter
private java.lang.String localipfromparams
protected int port
protected java.net.ServerSocket serversocket
protected java.util.Map anyvalue
protected Logger mess
protected Logger adminmsg
protected UpdateableLogger clie
protected InitialExecutorAdder initialexecutoradder
protected ServerThreadInitiator sti
protected GJSAServer.SocketListeningThread mainpl
protected GJSAServer.SocketListeningThread utf8pl
protected GJSAServer.SocketListeningThread objpl
protected GJSAServer.SocketListeningThread sslpl
protected GJSAServer.SocketListeningThread utf8sslpl
protected GJSAServer.SocketListeningThread objsslpl
protected GJSAServer.SocketListeningThread secondarypl
protected boolean sslavailable
protected boolean clsupport
protected java.util.List serverstatesymbols
protected java.util.Map serverthreadbases
protected Killer mykiller
private java.lang.String loggingandportprefix
private java.util.LinkedList lastexceptions
Constructor Detail |
public GJSAServer(int portx, java.lang.String loggingandportprefixx, ServerThreadInitiator stix, InitialExecutorAdder initialexecutoradderx)
portx
- Description of the Parameterstix
- Description of the Parameterinitialexecutoradderx
- Description of the Parameterpublic GJSAServer(int portx, ServerThreadInitiator stix, InitialExecutorAdder initialexecutoradderx)
public GJSAServer(int portx, ServerThreadInitiator stix)
portx
- Description of the Parameterstix
- Description of the Parameterpublic GJSAServer(int portx, InitialExecutorAdder initialexecutoradderx)
portx
- Description of the Parameterinitialexecutoradderx
- Description of the Parameterpublic GJSAServer(int portx, java.lang.String loggingandportprefixx)
public GJSAServer(int portx)
public GJSAServer()
Method Detail |
public abstract java.lang.String getServerName()
public abstract int getVersion()
public abstract int getSubVersion()
public abstract int getPatchLevel()
public abstract java.lang.String getAddon()
protected abstract java.lang.String getSaveFileName()
protected EDate getBuildDate()
public java.util.List getSaveNames()
public java.util.List getPropertyDescriptions(java.util.Locale locale)
public java.lang.String getCompleteVersionString()
public boolean getConnectionlessSupported()
public java.lang.String getServerStateName(int state)
public int getServerStateSymbol(java.lang.String statename)
statename
- A server state name
public boolean isCLSupported()
public void registerThreadBase(ServerThreadBase stb)
public void releaseThreadBase(ServerThreadBase stb)
public ServerEnvelope handleCLEnvelope(ServerEnvelope se, boolean encrypted, int encodingmode)
se
- Query to askencrypted
- Flag whether the query came through an encrypted channelencodingmode
- Connection encoding
public java.util.Map getServerThreadBaseMap()
public java.lang.Object get(java.lang.String key)
key
- Description of the Parameter
public void put(java.lang.String key, java.lang.Object value)
key
- Description of the Parametervalue
- Description of the Parameterpublic java.lang.Object remove(java.lang.String key)
key
- Description of the Parameter
public boolean getBoolean(java.lang.String key, boolean deft)
key
- Description of the Parameterdeft
- Description of the Parameter
public boolean getBoolean(java.lang.String key)
key
- Description of the Parameter
public void putBoolean(java.lang.String key, boolean bool)
key
- Description of the Parameterbool
- Description of the Parameterpublic java.lang.String getString(java.lang.String key, java.lang.String defaultvalue)
key
- Key to search for in the internal data storage.defaultvalue
- Value to return if the key is not found.
public java.lang.String getString(java.lang.String key)
key
- Key to search for in the internal data storage.
public void putString(java.lang.String key, java.lang.String value)
key
- Description of the Parametervalue
- Description of the Parameterpublic int getInteger(java.lang.String key, int defaultvalue)
key
- Value namedefaultvalue
- Default value to return if nothing is stored
public int getInteger(java.lang.String key)
key
- Description of the Parameter
public void putInteger(java.lang.String key, int value)
key
- Description of the Parametervalue
- Description of the Parameterpublic void saveToFile(java.lang.String savefile) throws java.io.IOException
savefile
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic void saveToFile() throws java.io.IOException
java.io.IOException
- Description of the Exceptionprotected void loadFromFile()
public Logger getLogger(java.lang.String key)
key
- Description of the Parameter
protected void putLogger(java.lang.String key, Logger l)
key
- Description of the Parameterl
- Description of the Parameterprotected void removeLogger(java.lang.String key)
key
- Description of the Parameterpublic LoggerCenter getLoggerCenter()
public void addDebugException(java.lang.Throwable t)
t
- Throwable to store for debug purposespublic java.util.List getDebugExceptions(int count)
count
- Number of exceptions to return, always returned from the most current one backwards
public void setPort(int p)
p
- The new port valuepublic int getPort()
public boolean sslListening()
public boolean utf8Listening()
public boolean sslUtf8Listening()
public boolean objListening()
public boolean sslObjListening()
public void setInitialExecutorAdder(InitialExecutorAdder initialexecutoradderx)
initialexecutoradderx
- The new initialExecutorAdder valuepublic void setServerThreadInitiator(ServerThreadInitiator stix)
stix
- The new serverThreadInitiator valuepublic CommandExecutor getAdminExecutor(ServerThreadBase stb)
stb
- Description of the Parameter
public java.util.List getAdditionalLoggingExecutors(ServerThreadBase stb)
private java.lang.String makeLogString(java.lang.String str)
str
- Description of the Parameter
protected void showLoadedArguments()
protected void showHelp()
protected int evalArgument(int i, java.lang.String[] args) throws java.lang.Exception
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...)
i
- Current position in the argument arrayargs
- The complete argument array
java.lang.Exception
- All exceptions lead to evaluation abortion.protected final void loadArguments(java.lang.String[] args)
evalArgument(int, String[])
.
args
- The complete argument list.protected final void loadPropertyFileName(java.lang.String[] args)
args
- Complete argument list.protected void runBootSequence(java.lang.String[] args)
args
- List of argumentsprivate java.net.ServerSocket getServerSocket(javax.net.ServerSocketFactory ssf, int minport, int maxport, java.net.InetAddress localaddress) throws java.io.IOException
ssf
- Description of the Parameterminport
- Description of the Parametermaxport
- Description of the Parameter
java.io.IOException
- Description of the Exceptionprotected void startAdditionalServices(java.net.InetAddress localaddress)
protected void startServices(int exitcode)
public void restartServices()
protected void stopServices()
public void run()
public void exitRequest(boolean forceexit, int exitcode, java.lang.String configlogger, int prekilltime, java.lang.String message)
forceexit
- Description of the Parameterexitcode
- Description of the Parameterconfiglogger
- Description of the Parameterpublic void exitRequest(boolean forceexit, int exitcode, java.lang.String configlogger, int prekilltime)
public void exitRequest(boolean forceexit, int exitcode, java.lang.String configlogger)
public void exitRequest(boolean forceexit, int exitcode)
forceexit
- Description of the Parameterexitcode
- Description of the Parameterpublic void stopExitProcess()
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |