SK.gnome.dwarf.sample
Class QuoteServer

java.lang.Object
  extended bySK.gnome.dwarf.GenericService
      extended bySK.gnome.dwarf.GenericServer
          extended bySK.gnome.dwarf.thread.ThreadServer
              extended bySK.gnome.dwarf.thread.MultiThreadServer
                  extended bySK.gnome.dwarf.tcpip.TCPIPServer
                      extended bySK.gnome.dwarf.sample.QuoteServer
All Implemented Interfaces:
Reportable, java.lang.Runnable, Server, Service

public class QuoteServer
extends TCPIPServer

Container for the Quote of the Day Service (RFC 865) handlers.

It extends the generic TCPIPServer class. The getQuote() method must be implemented because it is required by the QuoteHandler class.


Field Summary
protected  java.lang.String[] quotes
          Array of string quotes.
 
Fields inherited from class SK.gnome.dwarf.tcpip.TCPIPServer
sslContext
 
Fields inherited from class SK.gnome.dwarf.thread.MultiThreadServer
counter
 
Fields inherited from class SK.gnome.dwarf.thread.ThreadServer
daemon, thread
 
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
QuoteServer(java.lang.String name)
          Creates a new QuoteServer.
 
Method Summary
 java.lang.String getQuote()
          Returns a single quote string.
 void setQuotes(java.util.Properties quotes)
          Sets the quote strings.
 
Methods inherited from class SK.gnome.dwarf.tcpip.TCPIPServer
createSSLServerSocket, createSSLServerSocket, createSSLSocket, enqueue, finish, getRequestReadTimeout, getTCPRequest, init, isBlocking, isSSLConfigured, loop, report, setKeyPwd, setKeyStorePwd, setKeyStoreURL, setRegistrationQueueSize, setRequestClass, setSSLProtocol, shutdown, start
 
Methods inherited from class SK.gnome.dwarf.thread.MultiThreadServer
addService, dequeue, enableThread, getHandlerTimeout, setHandlerClass, setHandlerTimeout, setMaxHandlers, setMinHandlers, setQueueSize, setSingleRequest, wakeUpHandlers
 
Methods inherited from class SK.gnome.dwarf.thread.ThreadServer
finish, run, setDaemon, stop
 
Methods inherited from class SK.gnome.dwarf.GenericServer
addService, getAuthenticator, getLogger, getParameters, getService, getServices, getServices, removeService
 
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

quotes

protected java.lang.String[] quotes
Array of string quotes.

Constructor Detail

QuoteServer

public QuoteServer(java.lang.String name)
Creates a new QuoteServer.

Method Detail

setQuotes

public void setQuotes(java.util.Properties quotes)
Sets the quote strings.

Parameters:
quotes - the quote strings

getQuote

public java.lang.String getQuote()
Returns a single quote string.

It cycles through the quote string array and returns a single quote string each time the method is invoked. The method must be synchronized to ensure the proper cycling of the quotes.

Returns:
a single string quote


Copyright (c) 1999-2005, Gnome Ltd. All rights reserved.