summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java
diff options
context:
space:
mode:
authoredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2011-01-24 20:02:06 +0000
committeredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2011-01-24 20:02:06 +0000
commit0d84cc78489ac547b2bacec57286a33a06dfcab3 (patch)
tree4fb9772f389840f0b6a8b2a9f5d84468892d0d86 /sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java
parent0232f3394601df2306b87b78cbf53e873ca74d78 (diff)
Fixing serialization of AsyncResponseInvoker in support of async services under TUSCANY-3783
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1062950 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java
index 2e675c5e7a..da1c7f365e 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java
@@ -70,7 +70,7 @@ public class AsyncResponseInvoker<T> implements InvokerAsyncResponse, Serializab
private T responseTargetAddress;
private String relatesToMsgID;
private String operationName;
- private MessageFactory messageFactory;
+ private transient MessageFactory messageFactory;
private String bindingType = "";
private boolean isNativeAsync;
@@ -79,6 +79,7 @@ public class AsyncResponseInvoker<T> implements InvokerAsyncResponse, Serializab
private String domainURI;
private transient EndpointRegistry endpointRegistry;
+ private transient ExtensionPointRegistry registry;
public AsyncResponseInvoker(RuntimeEndpoint requestEndpoint,
RuntimeEndpointReference responseEndpointReference,
@@ -104,6 +105,7 @@ public class AsyncResponseInvoker<T> implements InvokerAsyncResponse, Serializab
if( context != null ) {
domainURI = context.getDomainURI();
+ registry = context.getExtensionPointRegistry();
} // end if
if ((requestEndpoint.getBindingProvider() instanceof EndpointAsyncProvider) &&
@@ -237,6 +239,8 @@ public class AsyncResponseInvoker<T> implements InvokerAsyncResponse, Serializab
requestEndpoint = retrieveEndpoint(endpointURI);
responseEndpointReference = retrieveEndpointReference(endpointReferenceURI);
+ messageFactory = getMessageFactory();
+
if (responseTargetAddress instanceof EndpointReference){
// fix the target as in this case it will be an EPR
EndpointReference epr = (EndpointReference)responseTargetAddress;
@@ -245,6 +249,14 @@ public class AsyncResponseInvoker<T> implements InvokerAsyncResponse, Serializab
} // end method readObject
/**
+ * Gets a message factory
+ * @return
+ */
+ private MessageFactory getMessageFactory() {
+ return registry.getExtensionPoint(FactoryExtensionPoint.class).getFactory(MessageFactory.class);
+ } // end method getMessageFactory
+
+ /**
* Fetches the EndpointReference identified by an endpoint reference URI
* @param uri - the URI of the endpoint reference
* @return - the EndpointReference matching the supplied URI - null if no EPR is found which
@@ -290,7 +302,10 @@ public class AsyncResponseInvoker<T> implements InvokerAsyncResponse, Serializab
if( context != null ) {
registry = context.getExtensionPointRegistry();
endpointRegistry = getEndpointRegistry( registry );
- if( endpointRegistry != null ) return endpointRegistry;
+ if( endpointRegistry != null ) {
+ this.registry = registry;
+ return endpointRegistry;
+ } // end if
} // end if
// Deal with the case where there is no context available
@@ -303,6 +318,7 @@ public class AsyncResponseInvoker<T> implements InvokerAsyncResponse, Serializab
if( endpointRegistry != null ) {
for( Endpoint endpoint : endpointRegistry.findEndpoint(uri) ) {
// TODO: For the present, simply return the first registry with a matching endpoint
+ this.registry = registry;
return endpointRegistry;
} // end for
} // end if