xmlBlaster 2.2.0 API

org.xmlBlaster.util.qos
Class StatusQosQuickParseFactory

java.lang.Object
  extended by org.xmlBlaster.util.qos.StatusQosQuickParseFactory
All Implemented Interfaces:
I_StatusQosFactory

public class StatusQosQuickParseFactory
extends java.lang.Object
implements I_StatusQosFactory

Parsing xml QoS (quality of service) of return status.

Here we parse it with normal string operations for better performance. This is 40 times faster than a SAX parse (6 microsec instead of 241 microsec on a 600 MHz AMD Linux).

For the xml representation see StatusQosSaxFactory.

Author:
xmlBlaster@marcelruff.info TODO: implement the parsing from the method name
See Also:
StatusQosData, StatusQosSaxFactory, StatusQosFactoryTest

Field Summary
private  Global glob
           
private static java.util.logging.Logger log
           
private  StatusQosData statusQosData
           
 
Constructor Summary
StatusQosQuickParseFactory(Global glob)
          Can be used as singleton.
 
Method Summary
 java.lang.String getName()
          A human readable name of this factory
private  java.lang.String parseOurself(java.lang.String str, java.lang.String token)
          Parse xml ourself, to gain performance
 StatusQosData readObject(java.lang.String xmlQos)
          Parses the given xml Qos and returns a StatusQosData holding the data.
 java.lang.String writeObject(StatusQosData statusQosData, java.lang.String extraOffset, java.util.Properties props)
          Dump state of this object into a XML ASCII string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static java.util.logging.Logger log

glob

private final Global glob

statusQosData

private StatusQosData statusQosData
Constructor Detail

StatusQosQuickParseFactory

public StatusQosQuickParseFactory(Global glob)
Can be used as singleton.

Method Detail

readObject

public StatusQosData readObject(java.lang.String xmlQos)
                         throws XmlBlasterException
Parses the given xml Qos and returns a StatusQosData holding the data. Parsing of update() and publish() QoS is supported here.

Specified by:
readObject in interface I_StatusQosFactory
Parameters:
the - XML based ASCII string
Throws:
XmlBlasterException

parseOurself

private final java.lang.String parseOurself(java.lang.String str,
                                            java.lang.String token)
Parse xml ourself, to gain performance

Returns:
The value of the attribute or null if not found

writeObject

public final java.lang.String writeObject(StatusQosData statusQosData,
                                          java.lang.String extraOffset,
                                          java.util.Properties props)
Dump state of this object into a XML ASCII string.

Specified by:
writeObject in interface I_StatusQosFactory
Parameters:
extraOffset - indenting of tags for nice output
props - Formatting hints (see Constants.TOXML_*)
Returns:
internal state of the RequestBroker as a XML ASCII string

getName

public java.lang.String getName()
A human readable name of this factory

Specified by:
getName in interface I_StatusQosFactory
Returns:
"StatusQosQuickParseFactory"

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.