Skip navigation links

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

E15033-08


com.bea.wli.sb.sources
Class JavaObjectSource

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

All Implemented Interfaces:
Source, java.io.Serializable

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

A JavaObjectSource represents payload carried by the services that support OSB service binding type: Messaging Type : Java.

The objects that comprise this payload will be registered in pipeline java object repository by the binding layer and their contents will be visible in message context variables through <ctx:java-content ref='jcid:xyz' xmlns:ctx="http://www.bea.com/wli/sb/context" /> XML elements. Here, ref points to a unique id with which the object is stored within the java object repository.

Example:

Let’s assume, we have an inbound service with binding type: Messaging Type : java. When a transport invocation occurs and a JavaObjectSource is composed by the inbound endpoint with a single object say Obj1, the message payload in the pipeline will be represented as:

 <ctx:java-content ref='key1' xmlns:ctx="http://www.bea.com/wli/sb/context" />
 

In this example, the pipeline java object repository will contain:

key1 --> Obj1 .

See Also:
Serialized Form

Field Summary

 

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

 

Constructor Summary
JavaObjectSource(java.lang.Object... args)
          Creates an instance of JavaObjectSource given a sequence of objects.

 

Method Summary
 java.io.InputStream getInputStream(TransformOptions options)
          Returns an input stream that contains serialized representation of all objects in this source.
 java.lang.Object[] getObjects()
          Returns all the objects in this source.
 void writeTo(java.io.OutputStream os, TransformOptions options)
          Writes the contents of this source by wrapping OutputStream argument with java.io.ObjectOutputStream and serializing all objects into it.

 

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

 

Constructor Detail

JavaObjectSource

public JavaObjectSource(java.lang.Object... args)
Creates an instance of JavaObjectSource given a sequence of objects. Each object is expected to implement java.io.Serializable interface.
Parameters:
args - the sequence of objects to be registered in pipeline java object repository.

Method Detail

writeTo

public void writeTo(java.io.OutputStream os,
                    TransformOptions options)
             throws java.io.IOException,
                    TransformException
Writes the contents of this source by wrapping OutputStream argument with java.io.ObjectOutputStream and serializing all objects into it.
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

getInputStream

public java.io.InputStream getInputStream(TransformOptions options)
                                   throws java.io.IOException,
                                          TransformException
Returns an input stream that contains serialized representation of all objects in this source. The result of this method should be wrapped with java.io.ObjectInputStream in order to read individual objects
Specified by:
getInputStream in interface Source
Parameters:
options - Options used to affect the serialization
Returns:
a InputStream for retrieving the serialized content
Throws:
java.io.IOException
TransformException

getObjects

public java.lang.Object[] getObjects()
Returns all the objects in this source.
Returns:
all the objects in this source or empty array if no objects are available with this source

Skip navigation links

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

E15033-08


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