com.retrogui.messageserver.server
Class AbstractServerApplication

java.lang.Object
  extended byjava.lang.Thread
      extended bycom.retrogui.messageserver.server.AbstractServerApplication
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
DualRpcServerDispatcher

public abstract class AbstractServerApplication
extends java.lang.Thread

Abstract base class to provide some basic implementation


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AbstractServerApplication(MessageServer messageServer, Session psession, java.lang.Object pconfigurationObject)
          Creates a new AbstractServerApplication object.
 
Method Summary
 java.lang.Object getConfigurationObject()
          getter
 Message getMessage(boolean blockUntilMessage)
          get a message.
 MessageServer getMessageServer()
          getter
 Session getSession()
          getter
abstract  void run()
          main application loop - subclass must provide implementation
 void sendMessage(Message msg)
          send a message.
 
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
 

Constructor Detail

AbstractServerApplication

public AbstractServerApplication(MessageServer messageServer,
                                 Session psession,
                                 java.lang.Object pconfigurationObject)
Creates a new AbstractServerApplication object.

Parameters:
messageServer -
psession -
pconfigurationObject -
Method Detail

run

public abstract void run()
main application loop - subclass must provide implementation


sendMessage

public void sendMessage(Message msg)
                 throws SessionException
send a message. convenience method that wraps Session.sendMessage()

Parameters:
msg - - a message
Throws:
SessionException

getMessage

public Message getMessage(boolean blockUntilMessage)
                   throws SessionException
get a message. convenience method that wraps Session.getMessage()

Parameters:
blockUntilMessage - - if true then method blocks until a message arrives. if false then the method will immediately with either a message object or null
Returns:
- a message object (or null)
Throws:
SessionException

getSession

public Session getSession()
getter

Returns:

getConfigurationObject

public java.lang.Object getConfigurationObject()
getter

Returns:

getMessageServer

public MessageServer getMessageServer()
getter

Returns: