You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by da...@apache.org on 2006/11/06 09:53:28 UTC
svn commit: r471671 -
/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java
Author: davidillsley
Date: Mon Nov 6 00:53:27 2006
New Revision: 471671
URL: http://svn.apache.org/viewvc?view=rev&rev=471671
Log:
Replace NPE with specific exception to improve clarity of a failure case.
Modified:
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java?view=diff&rev=471671&r1=471670&r2=471671
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java Mon Nov 6 00:53:27 2006
@@ -16,18 +16,17 @@
package org.apache.axis2.util;
+import java.util.HashMap;
+
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFault;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.RelatesTo;
-import org.apache.axis2.addressing.AddressingConstants;
import org.apache.axis2.client.async.AsyncResult;
import org.apache.axis2.client.async.Callback;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.engine.MessageReceiver;
-import java.util.HashMap;
-
/**
* This is a MessageReceiver which is used on the client side to accept the
* messages (response) that come to the client. This correlates the incoming message to
@@ -47,6 +46,9 @@
public void receive(MessageContext messageCtx) throws AxisFault {
RelatesTo relatesTO = messageCtx.getOptions().getRelatesTo();
+ if(relatesTO == null){
+ throw new AxisFault("Cannot identify correct Callback object. RelatesTo is null");
+ }
String messageID = relatesTO.getValue();
Callback callback = (Callback) callbackStore.get(messageID);
AsyncResult result = new AsyncResult(messageCtx);
@@ -69,7 +71,7 @@
}
callback.setComplete(true);
} else {
- throw new AxisFault("The Callback realtes to MessageID " + messageID + " is not found");
+ throw new AxisFault("The Callback relates to MessageID " + messageID + " is not found");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org