diff options
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/main/java/sampleasync/impl/SampleAsyncProvider.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/main/java/sampleasync/impl/SampleAsyncProvider.java b/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/main/java/sampleasync/impl/SampleAsyncProvider.java index 9538a88a67..bc56877469 100644 --- a/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/main/java/sampleasync/impl/SampleAsyncProvider.java +++ b/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/main/java/sampleasync/impl/SampleAsyncProvider.java @@ -20,6 +20,8 @@ package sampleasync.impl; import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Map; import org.apache.tuscany.sca.assembly.ComponentReference; import org.apache.tuscany.sca.core.ExtensionPointRegistry; @@ -30,7 +32,7 @@ import org.apache.tuscany.sca.interfacedef.java.JavaInterface; import org.apache.tuscany.sca.interfacedef.java.JavaOperation; import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation; import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.provider.ImplementationProvider; +import org.apache.tuscany.sca.provider.ImplementationAsyncProvider; import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.apache.tuscany.sca.runtime.RuntimeComponentService; @@ -39,12 +41,13 @@ import org.apache.tuscany.sca.runtime.RuntimeComponentService; * * @version $Rev$ $Date$ */ -class SampleAsyncProvider implements ImplementationProvider { +class SampleAsyncProvider implements ImplementationAsyncProvider { final RuntimeComponent comp; final SampleAsyncImplementation impl; final ProxyFactory pxf; final ExtensionPointRegistry ep; Object instance; + Map<String, Object> asyncMessageMap = new HashMap<String, Object>(); SampleAsyncProvider(final RuntimeComponent comp, final SampleAsyncImplementation impl, ProxyFactory pf, ExtensionPointRegistry ep) { this.comp = comp; @@ -66,7 +69,7 @@ class SampleAsyncProvider implements ImplementationProvider { if(i instanceof JavaInterface) f.set(instance, pxf.createProxy(comp.getComponentContext().getServiceReference(f.getType(), r.getName()))); else - f.set(instance, new SampleWSDLProxy(r.getEndpointReferences().get(0), i, ep)); + f.set(instance, new SampleWSDLProxy(asyncMessageMap, r.getEndpointReferences().get(0), i, ep)); } } catch(Exception e) { throw new RuntimeException(e); @@ -91,4 +94,8 @@ class SampleAsyncProvider implements ImplementationProvider { throw new RuntimeException(e); } } + + public Invoker createAsyncInvoker(RuntimeComponentService service, Operation operation) { + return new SampleAsyncInvoker(asyncMessageMap, operation, impl.clazz, instance); + } } |