org.deegree_impl.services
Class AbstractHandler

java.lang.Object
  extended byorg.deegree_impl.services.AbstractHandler
All Implemented Interfaces:
java.util.EventListener, Handler
Direct Known Subclasses:
Dispatcher_Impl

public abstract class AbstractHandler
extends java.lang.Object
implements Handler

-------------------------------------------------------------------------

Version:
$Revision: 1.12 $ $Date: 2004/03/15 07:34:39 $

Author:
Andreas Poth

Nested Class Summary
 class AbstractHandler.Loop
          The loop have to be started by the classes that extends AbstractHandler.
 
Field Summary
protected  java.util.List handlerList
           
 java.util.Map inProgressList
          list of request that are performed actualy
protected  int loopFrequency
          time (millis) the loop 'sleep' before looking for new requests or responses
protected  int loopTimeout
          maximal time a loop runs without existing a request or response to handle
protected  java.util.List requestList
           
protected  java.util.List responseList
           
protected  int responseTimeout
          maximal time (millis) the perfomrmance of a request is allowed to take
protected  long timestamp
           
 
Constructor Summary
AbstractHandler()
           
 
Method Summary
 void dispose()
           
 boolean fireRequest(OGCWebServiceEvent event)
          fires a request by notifiy all interested (responsible) Handler If for minimum one Handler was found that is responsible the method returns true otherwise false will be returned.
 boolean fireResponse(OGCWebServiceEvent event)
          fires a response by notifiy all interested (responsible) Handler If for minimum one Handler was found that is responsible the method returns true otherwise false will be returned.
 void registerHandler(Handler handler)
          registers a Handler so this Handler is able to act as a proxy to the registered handler
 void removeHandler(Handler handler)
           
 void setLoopFrequency(int millisec)
          sets the frequency/time a loop looks for new requests/responses to perform.
 void setLoopTimeout(int seconds)
          sets the time in seconds the handler keeps on running the request and response loops when no more requests or responses are registered to be performed.
 void setResponseTimeout(int seconds)
          sets time in seconds the waits for a response of a WMSService that serves a request (default: 2 seconds).
abstract  void stopLoops()
          stops the processing loop(s)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.deegree.services.Handler
handleRequest, handleResponse, isInterested
 

Field Detail

handlerList

protected java.util.List handlerList

requestList

protected java.util.List requestList

responseList

protected java.util.List responseList

inProgressList

public java.util.Map inProgressList
list of request that are performed actualy


responseTimeout

protected int responseTimeout
maximal time (millis) the perfomrmance of a request is allowed to take


loopTimeout

protected int loopTimeout
maximal time a loop runs without existing a request or response to handle


loopFrequency

protected int loopFrequency
time (millis) the loop 'sleep' before looking for new requests or responses


timestamp

protected long timestamp
Constructor Detail

AbstractHandler

public AbstractHandler()
Method Detail

dispose

public void dispose()

registerHandler

public void registerHandler(Handler handler)
registers a Handler so this Handler is able to act as a proxy to the registered handler

Specified by:
registerHandler in interface Handler

removeHandler

public void removeHandler(Handler handler)
Specified by:
removeHandler in interface Handler
See Also:
registerHandler(Handler)

fireRequest

public boolean fireRequest(OGCWebServiceEvent event)
fires a request by notifiy all interested (responsible) Handler If for minimum one Handler was found that is responsible the method returns true otherwise false will be returned.


fireResponse

public boolean fireResponse(OGCWebServiceEvent event)
fires a response by notifiy all interested (responsible) Handler If for minimum one Handler was found that is responsible the method returns true otherwise false will be returned.


setResponseTimeout

public void setResponseTimeout(int seconds)
sets time in seconds the waits for a response of a WMSService that serves a request (default: 2 seconds).


setLoopTimeout

public void setLoopTimeout(int seconds)
sets the time in seconds the handler keeps on running the request and response loops when no more requests or responses are registered to be performed. A value of -1 (default) indicates that the loops will be stopped immidiatly if no more requests or responses are registered to be performed.


setLoopFrequency

public void setLoopFrequency(int millisec)
sets the frequency/time a loop looks for new requests/responses to perform.


stopLoops

public abstract void stopLoops()
stops the processing loop(s)