Keel 2.1RC2

org.keel.servers
Class KeelAbstractServer

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.keel.servers.KeelAbstractServer
All Implemented Interfaces:
EventListener, java.lang.Runnable
Direct Known Subclasses:
KeelDirectServer, KeelJBossMQServer, KeelJmsServer, KeelOpenJMSServer, KeelSocketServer

public abstract class KeelAbstractServer
extends java.lang.Thread
implements EventListener

This is an abstract base class that provides the common functionality of Keel server-side threads.

Version:
$Revision: 1.18 $ $Date: 2004/01/03 21:49:45 $
Author:
Shash Chatterjee Created on Nov 17, 2002

Nested Class Summary
private  class KeelAbstractServer.ShutDownHook
           
 
Field Summary
private  java.lang.String[] args
           
private static ContainerFactory containerFactory
           
private static java.util.Map contexts
           
private static EventManager eventManager
           
private  boolean initialized
           
protected  Logger logger
           
private  int maxRetries
           
protected static Container myContainer
           
private static java.lang.String PREFIX
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
KeelAbstractServer()
           
KeelAbstractServer(java.lang.String name)
           
 
Method Summary
protected  Container getContainer()
           
protected  ComparableContext getContext(ModelRequest req)
           
protected  Logger getLogger()
           
private  ComparableContext getNewContext(java.lang.String sessionId)
           
protected  void initialize()
           
protected  boolean isInitialized()
           
private  void postContext(java.lang.String sessionId, ComparableContext c)
           
 void receiveEvent(Event e)
          Receive event callbacks from the EventManager.
protected  void saveContext(ModelRequest req)
           
 void setArgs(java.lang.String[] args)
           
protected  void setInitialized(boolean initialized)
           
 void shutDown()
           
 
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, run, 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

logger

protected Logger logger

initialized

private boolean initialized

PREFIX

private static java.lang.String PREFIX

maxRetries

private int maxRetries

args

private java.lang.String[] args

myContainer

protected static Container myContainer

contexts

private static java.util.Map contexts

containerFactory

private static ContainerFactory containerFactory

eventManager

private static EventManager eventManager
Constructor Detail

KeelAbstractServer

public KeelAbstractServer()

KeelAbstractServer

public KeelAbstractServer(java.lang.String name)
Method Detail

getContext

protected ComparableContext getContext(ModelRequest req)

getContainer

protected Container getContainer()
                          throws ModelException
Throws:
ModelException

initialize

protected void initialize()
                   throws ModelException
Throws:
ModelException

setArgs

public void setArgs(java.lang.String[] args)

saveContext

protected void saveContext(ModelRequest req)
                    throws ModelException
Throws:
ModelException

postContext

private void postContext(java.lang.String sessionId,
                         ComparableContext c)
                  throws ModelException
Throws:
ModelException

isInitialized

protected boolean isInitialized()

setInitialized

protected void setInitialized(boolean initialized)

getLogger

protected Logger getLogger()

receiveEvent

public void receiveEvent(Event e)
Receive event callbacks from the EventManager. Whenever a message is recieved indicating a change to context, we get an event. Part of the event gives us the new context and the session ID associated with it.

Specified by:
receiveEvent in interface EventListener

getNewContext

private ComparableContext getNewContext(java.lang.String sessionId)

shutDown

public void shutDown()

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.