Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Service Bus
11g Release 1 (11.1.1.7)

E15033-09


com.bea.wli.sb.sources
Class JavaXmlSource

java.lang.Object
  extended by com.bea.wli.sb.sources.JavaXmlSource

All Implemented Interfaces:
Source, java.io.Serializable

public class JavaXmlSource
extends java.lang.Object
implements Source, java.io.Serializable

A JavaXmlSource represents the payload carried by the services that supports java objects as the arguments. It is comprised of a XML representation defining the shape of message body in the pipeline and a map containing java objects against the unique keys.

In the XML representation, java object arguments are substituted by <ctx:java-content ref='jcid:xyz' xmlns:ctx="http://www.bea.com/wli/sb/context" /> elements, having the value of the ref attribute equal to a key in the JavaObjects map that indexes the replaced java object.

Map contains the objects to be registered in pipeline java object repository against the unique ids as present in the XML representation

Example:

Let’s assume, we have an inbound jejb transport endpoint based on method myMethod(String, int, com.acme.SomeXMLObject, com.acme.SomePOJO). The proxy service configuration specifies the names “my-method” for the operation, and arg0, arg1, arg2 and arg3 for the arguments. When a transport invocation occurs and a JavaXmlSource is composed by the inbound endpoint, the XML representation will have the following contents:

 <tes:my-method xmlns:tes=”default/someURI">
 &nbsp&nbsp<arg0>Some string</arg0>
 &nbsp&nbsp<arg1>88</arg1>
 &nbsp&nbsp<arg2><inlined xml object contents .../></arg2>
 &nbsp&nbsp<arg3><con:java-content ref=”key1” xmlns:con="http://www.bea.com/wli/sb/context”/></arg3>
 </tes:my-method>
 

In this example, the java objects map will contain:

key1 --> the java object passed as the fourth 'SomePOJO' argument.

Author:
mpoplace
See Also:
Serialized Form

Field Summary

 

Fields inherited from interface com.bea.wli.sb.sources.Source
DEFAULT_CHARACTER_SET_ENCODING

 

Constructor Summary
JavaXmlSource(XmlObjectSource xmlSource, java.util.Map<java.lang.String,java.lang.Object> pojoMap)
          Creates an instance of JavaXmlSource given a XML representation defining the shape of message body in the pipeline and a map containing java objects against the unique keys.

 

Method Summary
 java.io.InputStream getInputStream(TransformOptions options)
          Returns an input stream that contains the XML representation, defining the shape of the message body.
 java.util.Map<java.lang.String,java.lang.Object> getPojoMap()
          Returns the map containing the objects stored against the unique ids as present in the XML representation.
 XmlObjectSource getXmlSource()
          Returns the XmlObjectSource containing the XML representation of the payload.
 void writeTo(java.io.OutputStream os, TransformOptions options)
          Writes the XmlObjectSource contents to a byte-based stream.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

JavaXmlSource

public JavaXmlSource(XmlObjectSource xmlSource,
                     java.util.Map<java.lang.String,java.lang.Object> pojoMap)
Creates an instance of JavaXmlSource given a XML representation defining the shape of message body in the pipeline and a map containing java objects against the unique keys. Each object is expected to implement java.io.Serializable interface.
Parameters:
xmlSource - xml representation defining the shape of message body
pojoMap - the sequence of objects to be registered in pipeline java object repository against the unique ids as present in the XML representation

Method Detail

getInputStream

public java.io.InputStream getInputStream(TransformOptions options)
                                   throws java.io.IOException,
                                          TransformException
Returns an input stream that contains the XML representation, defining the shape of the message body.
Specified by:
getInputStream in interface Source
Parameters:
options - Options used to affect the serialization
Returns:
a InputStream for retrieving the XmlObjectSource containing the XML represenation of the message body
Throws:
java.io.IOException
TransformException

writeTo

public void writeTo(java.io.OutputStream os,
                    TransformOptions options)
             throws java.io.IOException,
                    TransformException
Writes the XmlObjectSource contents to a byte-based stream.
Specified by:
writeTo in interface Source
Parameters:
os - the OutputStream to which serialized content will be written
options - TransformOptions used to affect the serialization
Throws:
java.io.IOException
TransformException

getXmlSource

public XmlObjectSource getXmlSource()
Returns the XmlObjectSource containing the XML representation of the payload.
Returns:
the XmlObjectSource containing the XML representation of the payload

getPojoMap

public java.util.Map<java.lang.String,java.lang.Object> getPojoMap()
Returns the map containing the objects stored against the unique ids as present in the XML representation.
Returns:
the map containing the objects

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Service Bus
11g Release 1 (11.1.1.7)

E15033-09


Copyright © 2008, 2013, Oracle. All rights reserved.