net.kwfgrid.gwes.uiproxy
Class DefaultBuffer

java.lang.Object
  extended by net.kwfgrid.gwes.uiproxy.AbstractBuffer
      extended by net.kwfgrid.gwes.uiproxy.DefaultBuffer
All Implemented Interfaces:
Buffer, Consumer

public class DefaultBuffer
extends AbstractBuffer

Default implementation of buffer. Just a simple FIFO mechanism. This buffer supports the following properties:


Field Summary
protected  List _content
           
protected  boolean _overflow
           
 
Fields inherited from class net.kwfgrid.gwes.uiproxy.AbstractBuffer
_id, _size, DEFAULT_SIZE, SIZE_PROPERTY_KEY
 
Constructor Summary
DefaultBuffer()
           
 
Method Summary
 void handle(Object message)
          Handle a message.
 Object[] read()
          Read buffered messages.
protected  boolean shouldHandle(Object message)
          Determine if this buffer should handle the specified message.
 
Methods inherited from class net.kwfgrid.gwes.uiproxy.AbstractBuffer
getID, getSize, setID, setProperties, setProperty, setSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_content

protected List _content

_overflow

protected boolean _overflow
Constructor Detail

DefaultBuffer

public DefaultBuffer()
Method Detail

handle

public void handle(Object message)
Description copied from interface: Buffer
Handle a message. The buffer itself determines if it is responsible for buffering the specified Message. Buffer overflows or other exceptions must be remembered internally and notified on forthcoming calls of read().

Specified by:
handle in interface Buffer
Specified by:
handle in interface Consumer
Specified by:
handle in class AbstractBuffer
Parameters:
message - The message.

read

public Object[] read()
              throws BufferException
Description copied from interface: Buffer
Read buffered messages. Details are determined by the implementations.

Specified by:
read in interface Buffer
Specified by:
read in class AbstractBuffer
Throws:
BufferException - If a message could not be handled for some reason.

shouldHandle

protected boolean shouldHandle(Object message)
Determine if this buffer should handle the specified message. The default implementation always returns true. Subclasses must override this method in order to sort out messages of interest.



Copyright © 2005-2011 Fraunhofer FIRST. All Rights Reserved.