janus.web.service
Class ServerLoopService

java.lang.Object
  extended by janus.web.config.PropertyConfig
      extended by janus.web.service.Service
          extended by janus.web.service.ServerLoopService
All Implemented Interfaces:
ExceptionListener
Direct Known Subclasses:
EchoService, ProxyService

public abstract class ServerLoopService
extends Service

Server-Dienst, der einen beliebigen ServerLoop implementiert. Dies ist eine Basisklasse.


Field Summary
protected  String address
          Listener-Adresse (Interface)
static String DEFAULT_ADDRESS
           
static int DEFAULT_PORT
           
protected  ServerLoop loop
          Der ServerLoop
protected  int port
          Listener-Port
protected  Class serverClass
          Die Server-Klasse
 
Fields inherited from class janus.web.service.Service
active, debug, debugStream, DEFAULT_ACTIVE, DEFAULT_DEBUG, DEFAULT_PACKAGE, errorlog, log, status, toStringParameters, TRACE
 
Fields inherited from class janus.web.config.PropertyConfig
prefix, props
 
Constructor Summary
ServerLoopService()
           
 
Method Summary
 String getAddress()
          Ermittle die Listener-Adresse
 int getPort()
          Ermittle den Listener-Port
 ServerLoop getServerLoop()
          Ermittle den Timeout
protected  void init(Properties props, Class clazz)
          Initialisierung aus den Properties.
protected  void setToStringParameters(String param)
          Setze die Paramter für Service.toString()
 void start(Object config)
          Starte den Service.
 void stop()
          Stoppe den Service
 
Methods inherited from class janus.web.service.Service
create, getDebugStream, getName, getStatus, getTraceName, handleException, isActive, isDebug, setField, setTraceName, start, toString
 
Methods inherited from class janus.web.config.PropertyConfig
convertProperties, getBooleanProperty, getBooleanProperty, getBooleanPropertyArray, getBooleanPropertyArray, getIntProperty, getIntProperty, getIntPropertyArray, getIntPropertyArray, getLogger, getPrefix, getProperties, getProperty, getProperty, getPropertyArray, getPropertyArray, init, readFile, setPrefix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

address

protected String address
Listener-Adresse (Interface)


DEFAULT_ADDRESS

public static final String DEFAULT_ADDRESS

DEFAULT_PORT

public static final int DEFAULT_PORT
See Also:
Constant Field Values

loop

protected ServerLoop loop
Der ServerLoop


port

protected int port
Listener-Port


serverClass

protected Class serverClass
Die Server-Klasse

Constructor Detail

ServerLoopService

public ServerLoopService()
Method Detail

getAddress

public String getAddress()
Ermittle die Listener-Adresse


getPort

public int getPort()
Ermittle den Listener-Port


getServerLoop

public ServerLoop getServerLoop()
Ermittle den Timeout


init

protected void init(Properties props,
                    Class clazz)
             throws IllegalAccessException
Initialisierung aus den Properties. Da standardmäßig nur die Felder der abgeleiteten Klasse gesetzt werden, setzen wir hier auch die Felder dieser Basisklasse.

Overrides:
init in class Service
Parameters:
props - Konfigurationsdaten
clazz - die eigene Klasse
Throws:
IllegalAccessException

setToStringParameters

protected void setToStringParameters(String param)
Setze die Paramter für Service.toString()

Overrides:
setToStringParameters in class Service

start

public void start(Object config)
           throws Throwable
Starte den Service. Muss von der start()-Methode der abgeleiteten Klasse aufgerufen werden, um den Loop zu starten.

Parameters:
config - Konfigurationsobjekt des Servers
Throws:
Throwable

stop

public void stop()
          throws Throwable
Stoppe den Service

Specified by:
stop in class Service
Throws:
Throwable


Copyright © 2008 MvC Systemsoftware.