blob: b68d238b3694a9c3f9bc7fba8f9cc473e1540c86 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_13) on Mon Dec 07 14:17:35 IST 2009 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
DataSourceMessageBuilder (Apache Axis2 - Transport - Root 1.0.0 API)
</TITLE>
<META NAME="date" CONTENT="2009-12-07">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="DataSourceMessageBuilder (Apache Axis2 - Transport - Root 1.0.0 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DataSourceMessageBuilder.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/axis2/format/BinaryFormatter.html" title="class in org.apache.axis2.format"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/axis2/format/ElementHelper.html" title="class in org.apache.axis2.format"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/axis2/format/DataSourceMessageBuilder.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="DataSourceMessageBuilder.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.axis2.format</FONT>
<BR>
Interface DataSourceMessageBuilder</H2>
<DL>
<DT><B>All Superinterfaces:</B> <DD>org.apache.axis2.builder.Builder</DD>
</DL>
<DL>
<DT><B>All Known Implementing Classes:</B> <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>
<DL>
<DT><PRE>public interface <B>DataSourceMessageBuilder</B><DT>extends org.apache.axis2.builder.Builder</DL>
</PRE>
<P>
Message builder able to build messages from <CODE>DataSource</CODE> objects.
This interface can be optionally implemented by <CODE>Builder</CODE>
implementations that support building messages from <CODE>DataSource</CODE> objects.
Since by definition the data from a <CODE>DataSource</CODE> 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 <CODE>Builder</CODE>.
<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>
<P>
<P>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;org.apache.axiom.om.OMElement</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/axis2/format/DataSourceMessageBuilder.html#processDocument(javax.activation.DataSource, java.lang.String, org.apache.axis2.context.MessageContext)">processDocument</A></B>(javax.activation.DataSource&nbsp;dataSource,
java.lang.String&nbsp;contentType,
org.apache.axis2.context.MessageContext&nbsp;messageContext)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.axis2.builder.Builder"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from interface org.apache.axis2.builder.Builder</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>processDocument</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="processDocument(javax.activation.DataSource, java.lang.String, org.apache.axis2.context.MessageContext)"><!-- --></A><H3>
processDocument</H3>
<PRE>
org.apache.axiom.om.OMElement <B>processDocument</B>(javax.activation.DataSource&nbsp;dataSource,
java.lang.String&nbsp;contentType,
org.apache.axis2.context.MessageContext&nbsp;messageContext)
throws org.apache.axis2.AxisFault</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>org.apache.axis2.AxisFault</CODE></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DataSourceMessageBuilder.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/axis2/format/BinaryFormatter.html" title="class in org.apache.axis2.format"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/axis2/format/ElementHelper.html" title="class in org.apache.axis2.format"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/axis2/format/DataSourceMessageBuilder.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="DataSourceMessageBuilder.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &#169; 2004-2009 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>