janus.net
Class ProxyServer

java.lang.Object
  extended by janus.net.ServerBase
      extended by janus.net.ProxyServer
All Implemented Interfaces:
Runnable

public class ProxyServer
extends ServerBase

Diese Klasse implementiert einen einfachen Echo-Server. Zus&aauml;zlich werden regelmäß UMS-Nachrichten erzeugt.


Nested Class Summary
static class ProxyServer.Config
          Innere Klasse für die Konfigurationsdaten
protected static class ProxyServer.UmsThread
          Eigener UMS-Thread für jede Pool-Connection
 
Field Summary
protected  boolean autorelease
          Autorelease-Flag
protected  Connection hostConn
          Host-Connection (aus Pool)
 
Fields inherited from class janus.net.ServerBase
conn, debug, debugStream, exceptionListener, name, replyPending, serverSet, success_hi, success_lo, thread, transaction_type, ums_alias, ums_buffer, ums_length, UMS_MAXLENGTH, ums_reply_len, ums_terminal, umsConn, umsThread, userObject
 
Constructor Summary
ProxyServer()
          Konstruktor - Setzt den Namen
 
Method Summary
protected  void forward()
          Reiche eine Nachricht transparent durch.
protected  void getNextUms()
          Lese die nächste UMS-Nachricht.
protected  void handleAccept()
          UMS-Verbindungsaufbau
protected  void handleAwaitIo()
          Warte auf einen NOWAIT-I/O
protected  void handleCancel()
          Breche einen I/O ab
protected  void handleData()
          Verarbeite eine eingehende Daten-Nachricht.
protected  void handleExit()
          Ende des Servers.
protected  void handleInit()
          Initialisierung.
protected  void handleMessage(int message_tag)
          Verarbeite eine eingehende Message.
protected  void handleTransaction()
          Transaktions-Behandlung.
protected  void handleUms()
          Behandle eine Antwort vom UMS-Client.
protected  void handleUmsException(Throwable t)
          Behandle eine Exception in der UMS-Kommunikation
static void main(String[] args)
          test-Hauptprogramm
protected  void releaseConnection()
          Gebe die Connection wieder zurück.
protected  void reserveConnection()
          Hole eine Connection aus dem Pool
 
Methods inherited from class janus.net.ServerBase
beginTransaction, endTransaction, getConnection, getDebugStream, getName, getUmsConnection, getUserObject, isDebug, logException, rollbackTransaction, run, sendAck, sendAck, sendError, sendError, sendError, sendReply, sendReply, sendReply, setConnection, setDebug, setDebugStream, setDebugStream, setExceptionListener, setName, setUserObject, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

autorelease

protected boolean autorelease
Autorelease-Flag


hostConn

protected Connection hostConn
Host-Connection (aus Pool)

Constructor Detail

ProxyServer

public ProxyServer()
Konstruktor - Setzt den Namen

Method Detail

forward

protected void forward()
                throws CommException
Reiche eine Nachricht transparent durch.

Throws:
CommException

getNextUms

protected void getNextUms()
Lese die nächste UMS-Nachricht.

Overrides:
getNextUms in class ServerBase

handleAccept

protected void handleAccept()
                     throws Exception
UMS-Verbindungsaufbau

Overrides:
handleAccept in class ServerBase
Throws:
Exception
See Also:
Connection.acceptNew()

handleAwaitIo

protected void handleAwaitIo()
                      throws CommException
Warte auf einen NOWAIT-I/O

Overrides:
handleAwaitIo in class ServerBase
Throws:
CommException
See Also:
ServerConnection

handleCancel

protected void handleCancel()
                     throws CommException
Breche einen I/O ab

Overrides:
handleCancel in class ServerBase
Throws:
CommException
See Also:
ServerConnection

handleData

protected void handleData()
                   throws CommException
Verarbeite eine eingehende Daten-Nachricht.

Overrides:
handleData in class ServerBase
Throws:
CommException
See Also:
ServerConnection

handleExit

protected void handleExit()
Ende des Servers.

Overrides:
handleExit in class ServerBase

handleInit

protected void handleInit()
                   throws Exception
Initialisierung.

Overrides:
handleInit in class ServerBase
Throws:
Exception

handleMessage

protected void handleMessage(int message_tag)
                      throws Exception
Verarbeite eine eingehende Message. Behandelt die automatische Reservierung und Freigabe der Connection.

Overrides:
handleMessage in class ServerBase
Parameters:
message_tag - Nachrichtentyp aus Connection
Throws:
Exception - Beliebige Ausnahme der Handler

handleTransaction

protected void handleTransaction()
                          throws Exception
Transaktions-Behandlung. Die Parameter werden an die Host-Verbindung durchgereicht

Overrides:
handleTransaction in class ServerBase
Throws:
Exception

handleUms

protected void handleUms()
Behandle eine Antwort vom UMS-Client.

Overrides:
handleUms in class ServerBase

handleUmsException

protected void handleUmsException(Throwable t)
Behandle eine Exception in der UMS-Kommunikation

Overrides:
handleUmsException in class ServerBase

main

public static void main(String[] args)
                 throws Exception
test-Hauptprogramm

Throws:
Exception

releaseConnection

protected void releaseConnection()
Gebe die Connection wieder zurück.


reserveConnection

protected void reserveConnection()
                          throws CommException
Hole eine Connection aus dem Pool

Throws:
CommException


Copyright © 2008 MvC Systemsoftware.