biz.hammurapi.jms.adapter.converters
Class StylingXmlBeansConverter

java.lang.Object
  extended by biz.hammurapi.config.ComponentBase
      extended by biz.hammurapi.jms.adapter.converters.StylingXmlConverter
          extended by biz.hammurapi.jms.adapter.converters.StylingXmlBeansConverter
All Implemented Interfaces:
biz.hammurapi.config.Component, biz.hammurapi.config.Context, Converter, biz.hammurapi.metrics.MeasurementCollector, biz.hammurapi.metrics.MeasurementConsumer

public class StylingXmlBeansConverter
extends StylingXmlConverter

Uses XmlBeans to bind XML to Java

Author:
Pavel

Field Summary
 
Fields inherited from class biz.hammurapi.jms.adapter.converters.StylingXmlConverter
transformerFactory
 
Fields inherited from class biz.hammurapi.config.ComponentBase
owner
 
Constructor Summary
StylingXmlBeansConverter()
           
 
Method Summary
 javax.jms.Message convert(java.lang.Exception ex, javax.jms.Session session, java.util.Map properties, javax.jms.Message request)
          This method serializes exception using XML Beans and schema defined in http://www.hammurapi.biz/invocation namespace, file invocation.xsd This method supports error-style optional property - URL of stylesheet to apply after Exception -> Conversion.
protected  javax.xml.transform.Source convert(java.lang.Object request)
          Request must be XmlObject or Invocation.
protected  javax.xml.transform.Result createResult()
          Creates stream result backed by string writer.
protected  java.lang.Object processResult(javax.xml.transform.Result result)
          Parses result to an instance of XmlObject.
 
Methods inherited from class biz.hammurapi.jms.adapter.converters.StylingXmlConverter
convert, convert, createDocument, getTransformer, start, stop
 
Methods inherited from class biz.hammurapi.config.ComponentBase
addMeasurement, get, getChild, getMeasurementConsumer, getOwner, getOwner, setMeasurementConsumer, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StylingXmlBeansConverter

public StylingXmlBeansConverter()
Method Detail

convert

protected javax.xml.transform.Source convert(java.lang.Object request)
                                      throws java.lang.Exception
Request must be XmlObject or Invocation.

Specified by:
convert in class StylingXmlConverter
Returns:
Throws:
java.lang.Exception

createResult

protected javax.xml.transform.Result createResult()
Creates stream result backed by string writer.

Specified by:
createResult in class StylingXmlConverter
Returns:
Result instance.

processResult

protected java.lang.Object processResult(javax.xml.transform.Result result)
                                  throws java.lang.Exception
Parses result to an instance of XmlObject.

Specified by:
processResult in class StylingXmlConverter
Returns:
Throws:
java.lang.Exception

convert

public javax.jms.Message convert(java.lang.Exception ex,
                                 javax.jms.Session session,
                                 java.util.Map properties,
                                 javax.jms.Message request)
                          throws java.lang.Exception
This method serializes exception using XML Beans and schema defined in http://www.hammurapi.biz/invocation namespace, file invocation.xsd This method supports error-style optional property - URL of stylesheet to apply after Exception -> Conversion. If URL starts with resource: then it is loaded from classloader resource. This implementation uses ThrowableSerializer to convert exception to XML. Correlates by message ID.

Specified by:
convert in interface Converter
Overrides:
convert in class StylingXmlConverter
session - Session to create message
properties - Configuration properties
request - Request message, can be null.
Returns:
Populated and ready to send message
Throws:
java.lang.Exception


Copyright © 2006 Hammurapi Group. All Rights Reserved.