net.kwfgrid.gwes.uiproxy
Class DefaultBuffer
java.lang.Object
net.kwfgrid.gwes.uiproxy.AbstractBuffer
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:
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_content
protected List _content
_overflow
protected boolean _overflow
DefaultBuffer
public DefaultBuffer()
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.