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 ds...@apache.org on 2006/10/28 19:42:48 UTC
svn commit: r468707 - in
/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/client/async:
AsyncResult.java Callback.java
Author: dsosnoski
Date: Sat Oct 28 10:42:48 2006
New Revision: 468707
URL: http://svn.apache.org/viewvc?view=rev&rev=468707
Log:
Synchronize completion flag methods for thread safety, JavaDoc improvements
Modified:
webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/client/async/AsyncResult.java
webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/client/async/Callback.java
Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/client/async/AsyncResult.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/client/async/AsyncResult.java?view=diff&rev=468707&r1=468706&r2=468707
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/client/async/AsyncResult.java (original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/client/async/AsyncResult.java Sat Oct 28 10:42:48 2006
@@ -21,27 +21,32 @@
import org.apache.axis2.context.MessageContext;
/**
- * This class represents the results of an asynchronous invocation. The axis2 engine
- * reports back the results in this object via the callback function.
+ * This class holds the results of an asynchronous invocation. The Axis2
+ * engine returns an instance of this class via the {@link
+ * Callback#onComplete(AsyncResult)} method when the operation completes
+ * successfully.
*/
public class AsyncResult {
/**
- * Field result
+ * Message context that supplies the result information.
*/
private MessageContext result;
/**
- *
- * @param result - resulting message context
+ * Constructor.
+ *
+ * @param result message context providing result information
+ * (<code>null</code> if no response)
*/
public AsyncResult(MessageContext result) {
this.result = result;
}
/**
- * This will return the message context of the resulting message context
- * @return SOAPEnvelope
+ * Get the SOAP Envelope for the response message.
+ *
+ * @return Envelope (<code>null</code> if none)
*/
public SOAPEnvelope getResponseEnvelope() {
if (result != null) {
@@ -52,7 +57,9 @@
}
/**
- * @return MessageContext
+ * Get the complete message context for the response.
+ *
+ * @return context (<code>null</code> if none)
*/
public MessageContext getResponseMessageContext() {
return result;
Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/client/async/Callback.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/client/async/Callback.java?view=diff&rev=468707&r1=468706&r2=468707
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/client/async/Callback.java (original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/client/async/Callback.java Sat Oct 28 10:42:48 2006
@@ -17,8 +17,13 @@
package org.apache.axis2.client.async;
/**
- * This Class is the abstract representation of a callback and is called at the completion of an
- * asynchronous invocation.
+ * Base class for asynchronous client callback handler. The application code
+ * needs to create an instance of this class (actually an instance of a
+ * subclass, since this base class cannot be used directly) and pass it to the
+ * generated startXXX client stub method when initiating an asynchronous
+ * operation. The Axis2 code then calls the appropriate methods of this class
+ * {@link #setComplete(boolean)}, and either {@link #onComplete(AsyncResult)}
+ * or {@link #onError(Exception)} when the operation is completed.
*/
public abstract class Callback {
@@ -28,14 +33,15 @@
private boolean complete;
/**
- * This method is invoked by Axis Engine once the asynchronous operation has completed successfully.
+ * Method is invoked by Axis2 once the asynchronous operation has completed
+ * successfully.
*
* @param result
*/
public abstract void onComplete(AsyncResult result);
/**
- * This method is called by Axis Engine if the asynchronous operation fails.
+ * Method invoked by Axis2 if the asynchronous operation fails.
*
* @param e
*/
@@ -55,16 +61,16 @@
*
* @return boolean
*/
- public boolean isComplete() {
+ public synchronized boolean isComplete() {
return complete;
}
/**
- * Method setComplete
+ * Method invoked by Axis2 to set the completion state of the operation.
*
* @param complete
*/
- public void setComplete(boolean complete) {
+ public synchronized void setComplete(boolean complete) {
this.complete = complete;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org