Skip to content
Permalink
Browse files
AXIS2-5315 - Removed Callback usage from Transport project.
  • Loading branch information
Sagara Gunathunga committed May 30, 2012
1 parent b3dfd94 commit afc1ca01d168044af9a4f1359b03520fa77513c6
Showing 2 changed files with 33 additions and 10 deletions.
@@ -34,8 +34,7 @@
import org.apache.axis2.client.OperationClient;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.client.async.AsyncResult;
import org.apache.axis2.client.async.Callback;
import org.apache.axis2.client.async.AxisCallback;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContext;
@@ -113,10 +112,10 @@ public void testEchoXMLASync() throws Exception {
options.setTransportInProtocol(Constants.TRANSPORT_TCP);
options.setAction(Constants.AXIS2_NAMESPACE_URI + "/" + operationName.getLocalPart());

Callback callback = new Callback() {
public void onComplete(AsyncResult result) {
AxisCallback callback = new AxisCallback() {
public void onComplete(MessageContext msgCtx) {
try {
result.getResponseEnvelope().serialize(StAXUtils
msgCtx.getEnvelope().serialize(StAXUtils
.createXMLStreamWriter(System.out));
} catch (XMLStreamException e) {
onError(e);
@@ -129,6 +128,18 @@ public void onError(Exception e) {
log.info(e.getMessage());
finish = true;
}

public void onComplete() {

}

public void onFault(MessageContext msgCtx) {
onComplete(msgCtx);
}

public void onMessage(MessageContext msgCtx) {
onComplete(msgCtx);
}
};

ServiceClient sender = new ServiceClient(configContext, clientService);
@@ -31,9 +31,9 @@
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.client.async.AsyncResult;
import org.apache.axis2.client.async.Callback;
import org.apache.axis2.client.async.AxisCallback;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.util.Utils;
import org.apache.commons.logging.Log;
@@ -99,10 +99,10 @@ public void testEchoXMLCompleteASync() throws Exception {
options.setTransportInProtocol(Constants.TRANSPORT_TCP);
options.setUseSeparateListener(true);
options.setAction(operationName.getLocalPart());
Callback callback = new Callback() {
public void onComplete(AsyncResult result) {
AxisCallback callback = new AxisCallback() {
public void onComplete(MessageContext msgCtx) {
try {
result.getResponseEnvelope().serializeAndConsume(StAXUtils
msgCtx.getEnvelope().serializeAndConsume(StAXUtils
.createXMLStreamWriter(System.out));
} catch (XMLStreamException e) {
onError(e);
@@ -115,6 +115,18 @@ public void onError(Exception e) {
log.info(e.getMessage());
finish = true;
}

public void onComplete() {

}

public void onFault(MessageContext msgCtx) {
onComplete(msgCtx);
}

public void onMessage(MessageContext msgCtx) {
onComplete(msgCtx);
}
};

AxisService serviceClient =

0 comments on commit afc1ca0

Please sign in to comment.