net.kwfgrid.gwes.uiproxy.jdom
Class JDOMSequenceBuffer
java.lang.Object
net.kwfgrid.gwes.uiproxy.AbstractBuffer
net.kwfgrid.gwes.uiproxy.SequenceBuffer
net.kwfgrid.gwes.uiproxy.jdom.JDOMSequenceBuffer
- All Implemented Interfaces:
- Buffer, Consumer
public abstract class JDOMSequenceBuffer
- extends SequenceBuffer
Implementation of SequenceBuffer for sequenced XML messages in the JDOM object model.
The sequence number of the messages must be accessible by an XPath query. The jaxen XPath engine
is used to query incoming messages for their sequence number.
This buffer supports the following properties:
- Buffer.size
- SequenceBuffer.first
- JDOMSequenceBuffer.xpath_sequenceNumber
- JDOMSequenceBuffer.xpath_shouldHandle
The JDOMSequenceBuffer.* properties must be set at initialization time of the buffer.
|
Method Summary |
protected int |
getSequenceNumber(Object message)
Generic method to access the sequence number of the specified message. |
void |
setProperty(String key,
String value)
This implementation only interprets the Buffer.size property. |
protected boolean |
shouldHandle(Object message)
This buffer handles messages which are instance of org.jdom.Element. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XPATH_SEQUENCE_NUMBER_PROPERTY_KEY
public static final String XPATH_SEQUENCE_NUMBER_PROPERTY_KEY
- See Also:
- Constant Field Values
XPATH_SHOULD_HANDLE_PROPERTY_KEY
public static final String XPATH_SHOULD_HANDLE_PROPERTY_KEY
- See Also:
- Constant Field Values
JDOMSequenceBuffer
public JDOMSequenceBuffer(String xpath)
throws InstantiationException
- Constructor.
- Parameters:
xpath - The XPath expression to access the sequence number inside of an incoming message.
- Throws:
InstantiationException - If the XPath string could not be parsed.
setProperty
public void setProperty(String key,
String value)
throws BufferException
- Description copied from class:
AbstractBuffer
- This implementation only interprets the
Buffer.size property.
- Specified by:
setProperty in interface Buffer- Overrides:
setProperty in class SequenceBuffer
- Throws:
BufferException
getSequenceNumber
protected int getSequenceNumber(Object message)
throws org.jaxen.JaxenException,
NumberFormatException,
IllegalStateException
- Description copied from class:
SequenceBuffer
- Generic method to access the sequence number of the specified message.
Sequence numbers are expected to be positive integers.
- Specified by:
getSequenceNumber in class SequenceBuffer
- Throws:
IllegalStateException - If the property JDOMSequenceBuffer.xpath_sequenceNumber is not set.
org.jaxen.JaxenException
NumberFormatException
shouldHandle
protected boolean shouldHandle(Object message)
throws org.jaxen.JaxenException,
IllegalStateException
- This buffer handles messages which are instance of
org.jdom.Element.
Additionally the XPath expression provided through property JDOMSequenceBuffer.xpath_shouldHandle must
evaluate to true for the incoming message.
- Specified by:
shouldHandle in class SequenceBuffer
- Throws:
IllegalStateException - If the property JDOMSequenceBuffer.xpath_shouldHandle is not set.
org.jaxen.JaxenException
Copyright © 2005-2011 Fraunhofer FIRST. All Rights Reserved.