You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ve...@apache.org on 2009/02/27 23:56:56 UTC
svn commit: r748730 - in
/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2:
client/Options.java client/ServiceClient.java transport/TransportSender.java
Author: veithen
Date: Fri Feb 27 22:56:55 2009
New Revision: 748730
URL: http://svn.apache.org/viewvc?rev=748730&view=rev
Log:
Added Javadoc explaining the meaning of TransportSender#cleanup, ServiceClient#cleanupTransport and Options#callTransportCleanup.
Modified:
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/Options.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportSender.java
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/Options.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/Options.java?rev=748730&r1=748729&r2=748730&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/Options.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/Options.java Fri Feb 27 22:56:55 2009
@@ -1605,11 +1605,26 @@
}
}
-
+ /**
+ * Get the value of the <code>callTransportCleanup</code> property.
+ * This property determines whether {@link ServiceClient#cleanupTransport()} is called
+ * automatically (<code>true</code>) or not (<code>false</code>).
+ *
+ * @return the value of the <code>callTransportCleanup</code> property
+ * @see ServiceClient#cleanupTransport()
+ */
public boolean isCallTransportCleanup() {
return callTransportCleanup;
}
+ /**
+ * Set the value of the <code>callTransportCleanup</code> property.
+ * This property determines whether {@link ServiceClient#cleanupTransport()} is called
+ * automatically (<code>true</code>) or not (<code>false</code>).
+ *
+ * @param callTransportCleanup the new value
+ * @see ServiceClient#cleanupTransport()
+ */
public void setCallTransportCleanup(boolean callTransportCleanup) {
this.callTransportCleanup = callTransportCleanup;
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java?rev=748730&r1=748729&r2=748730&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java Fri Feb 27 22:56:55 2009
@@ -510,11 +510,16 @@
* Directly invoke an anonymous operation with an In-Out MEP. This method sends your supplied
* XML and receives a response. For more control, you can instead create a client for the
* operation and use that client to execute the exchange.
+ * <p>
+ * Unless the <code>callTransportCleanup</code> property on the {@link Options} object has been
+ * set to <code>true</code>, the caller must invoke {@link #cleanupTransport()} after
+ * processing the response.
*
* @param elem the data to send (becomes the content of SOAP body)
* @return response
* @throws AxisFault in case of error
* @see #createClient(QName)
+ * @see #cleanupTransport()
*/
public OMElement sendReceive(OMElement elem) throws AxisFault {
return sendReceive(ANON_OUT_IN_OP, elem);
@@ -524,11 +529,16 @@
* Directly invoke a named operationQName with an In-Out MEP. This method sends your supplied
* XML and receives a response. For more control, you can instead create a client for the
* operationQName and use that client to execute the exchange.
+ * <p>
+ * Unless the <code>callTransportCleanup</code> property on the {@link Options} object has been
+ * set to <code>true</code>, the caller must invoke {@link #cleanupTransport()} after
+ * processing the response.
*
* @param operationQName name of operationQName to be invoked (non-<code>null</code>)
* @param xmlPayload the data to send (becomes the content of SOAP body)
* @return response OMElement
* @throws AxisFault in case of error
+ * @see #cleanupTransport()
*/
public OMElement sendReceive(QName operationQName, OMElement xmlPayload)
throws AxisFault {
@@ -803,6 +813,27 @@
}
}
+ /**
+ * Release resources allocated by the transport during the last service invocation.
+ * This method will call
+ * {@link org.apache.axis2.transport.TransportSender#cleanup(MessageContext)} on the
+ * transport sender used during that invocation.
+ * <p>
+ * If the <code>callTransportCleanup</code> property on the {@link Options} object is
+ * set to <code>false</code> (which is the default), then this method must be called
+ * after each invocation of an operation with an in-out MEP, but not before the response
+ * from that operation has been completely processed (or {@link OMElement#build()}
+ * has been called on the response element).
+ * <p>
+ * If the <code>callTransportCleanup</code> property is set to <code>true</code>,
+ * then this method is called automatically. Note that in this case, {@link OMElement#build()}
+ * will be called on the response element before is returned. This effectively disables
+ * deferred parsing of the response and prevents the code from starting to process the
+ * response before it has been completely received. Therefore this approach is not recommended
+ * whenever performance is important.
+ *
+ * @throws AxisFault
+ */
public void cleanupTransport() throws AxisFault {
if (getLastOperationContext() != null) {
MessageContext outMessageContext =
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportSender.java?rev=748730&r1=748729&r2=748730&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportSender.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportSender.java Fri Feb 27 22:56:55 2009
@@ -33,10 +33,21 @@
public interface TransportSender extends Handler {
/**
- * Clean up
+ * Release resources associated with a given message context.
+ * This method is called after processing the response of an invocation of
+ * a synchronous out-in operation to allow the transport to release any resources allocated
+ * during that invocation.
+ * <p>
+ * This method is mainly useful for connection oriented transports that return from
+ * {@link #invoke(MessageContext)} before the entire response is available. A transport of
+ * this type will construct an {@link java.io.InputStream} object and set it as the
+ * {@link MessageContext#TRANSPORT_IN} property on the
+ * {@link org.apache.axis2.context.OperationContext}). In order for this to work, the
+ * connection must remain open until the response has been processed. This method is then
+ * used to release the connection explicitly.
*
* @param msgContext
- * @throws org.apache.axis2.AxisFault
+ * @throws AxisFault
*/
public void cleanup(MessageContext msgContext) throws AxisFault;