blob: 0c5893e42971fcd3ab849a25d86ee4ab87129b1e [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>DataSourceMessageBuilder (Apache Axis2)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="DataSourceMessageBuilder (Apache Axis2)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/DataSourceMessageBuilder.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/axis2/format/BinaryFormatter.html" title="class in org.apache.axis2.format"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/axis2/format/ManagedDataSource.html" title="interface in org.apache.axis2.format"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/axis2/format/DataSourceMessageBuilder.html" target="_top">Frames</a></li>
<li><a href="DataSourceMessageBuilder.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.axis2.format</div>
<h2 title="Interface DataSourceMessageBuilder" class="title">Interface DataSourceMessageBuilder</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="../../../../org/apache/axis2/builder/Builder.html" title="interface in org.apache.axis2.builder">Builder</a></dd>
</dl>
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../org/apache/axis2/format/BinaryBuilder.html" title="class in org.apache.axis2.format">BinaryBuilder</a>, <a href="../../../../org/apache/axis2/format/PlainTextBuilder.html" title="class in org.apache.axis2.format">PlainTextBuilder</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">DataSourceMessageBuilder</span>
extends <a href="../../../../org/apache/axis2/builder/Builder.html" title="interface in org.apache.axis2.builder">Builder</a></pre>
<div class="block">Message builder able to build messages from <a href="https://docs.oracle.com/javase/7/docs/api/javax/activation/DataSource.html?is-external=true" title="class or interface in javax.activation"><code>DataSource</code></a> objects.
This interface can be optionally implemented by <a href="../../../../org/apache/axis2/builder/Builder.html" title="interface in org.apache.axis2.builder"><code>Builder</code></a>
implementations that support building messages from <a href="https://docs.oracle.com/javase/7/docs/api/javax/activation/DataSource.html?is-external=true" title="class or interface in javax.activation"><code>DataSource</code></a> objects.
Since by definition the data from a <a href="https://docs.oracle.com/javase/7/docs/api/javax/activation/DataSource.html?is-external=true" title="class or interface in javax.activation"><code>DataSource</code></a> can be read multiple
times, this interface can be used by message builders to avoid storing the
message content in memory.
<p>
If a message builder implements this interface and the transport is able to
provide the message payload as a data source, then the method defined by this
interface should be preferred over the method defined by <a href="../../../../org/apache/axis2/builder/Builder.html" title="interface in org.apache.axis2.builder"><code>Builder</code></a>.
<p>
Implementing this interface helps optimizing message processing with transports
that use messaging providers that store messages in memory or on the file system.
Examples are JMS and VFS.
<p>
The builder will typically expose the data source directly or indirectly through
the returned <code>OMElement</code>, e.g. by adding to the tree an <code>OMText</code>
or <code>OMDataSource</code> node referencing the data source.
This means that the builder will not be able to guarantee that all streams requested
from the data source are properly closed. Note that code accessing the returned
<code>OMElement</code> can't be expected to take care of this since in many cases the fact
that a data source is being used is completely transparent to that code.
It is therefore the responsibility of the transport to make sure that all resources linked to
the data source itself as well as any open stream requested from that data source are properly
released after the message has been processed. Depending on the type of transport, there are
three possible cases:
<ol>
<li>All resources allocated to the data source or streams requested from it are
memory based. In that case the garbage collector will take care of freeing
these resources and the transport should simply pass the data source object
to the builder.</li>
<li>There are operation system resources linked to the data source and open
streams will become invalid when these resources are freed, i.e.
it is not required that all streams be closed explicitly.
In this case the transport only needs to take care to properly dispose of
the data source after the message has been processed by the Axis2 engine.</li>
<li>Requesting a stream from the data source allocates operation system resources
(e.g. a network connection) that remain linked to the stream, i.e. all streams requested
from the data source must be closed properly. In that case the transport should use
<a href="../../../../org/apache/axis2/format/ManagedDataSourceFactory.html#create-javax.activation.DataSource-"><code>ManagedDataSourceFactory.create(DataSource)</code></a> to wrap the original data source
before passing it to the builder. After the message has been processed it should
then call <a href="../../../../org/apache/axis2/format/ManagedDataSource.html#destroy--"><code>ManagedDataSource.destroy()</code></a> on the wrapper to close all remaining
open streams.</li>
</ol></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>org.apache.axiom.om.OMElement</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/axis2/format/DataSourceMessageBuilder.html#processDocument-javax.activation.DataSource-java.lang.String-org.apache.axis2.context.MessageContext-">processDocument</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/javax/activation/DataSource.html?is-external=true" title="class or interface in javax.activation">DataSource</a>&nbsp;dataSource,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;contentType,
<a href="../../../../org/apache/axis2/context/MessageContext.html" title="class in org.apache.axis2.context">MessageContext</a>&nbsp;messageContext)</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.axis2.builder.Builder">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;org.apache.axis2.builder.<a href="../../../../org/apache/axis2/builder/Builder.html" title="interface in org.apache.axis2.builder">Builder</a></h3>
<code><a href="../../../../org/apache/axis2/builder/Builder.html#processDocument-java.io.InputStream-java.lang.String-org.apache.axis2.context.MessageContext-">processDocument</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="processDocument-javax.activation.DataSource-java.lang.String-org.apache.axis2.context.MessageContext-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>processDocument</h4>
<pre>org.apache.axiom.om.OMElement&nbsp;processDocument(<a href="https://docs.oracle.com/javase/7/docs/api/javax/activation/DataSource.html?is-external=true" title="class or interface in javax.activation">DataSource</a>&nbsp;dataSource,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;contentType,
<a href="../../../../org/apache/axis2/context/MessageContext.html" title="class in org.apache.axis2.context">MessageContext</a>&nbsp;messageContext)
throws <a href="../../../../org/apache/axis2/AxisFault.html" title="class in org.apache.axis2">AxisFault</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/axis2/AxisFault.html" title="class in org.apache.axis2">AxisFault</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/DataSourceMessageBuilder.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/axis2/format/BinaryFormatter.html" title="class in org.apache.axis2.format"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/axis2/format/ManagedDataSource.html" title="interface in org.apache.axis2.format"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/axis2/format/DataSourceMessageBuilder.html" target="_top">Frames</a></li>
<li><a href="DataSourceMessageBuilder.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &copy; <a href="https://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</small></p>
</body>
</html>