tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edward...@apache.org
Subject svn commit: r711918 - in /tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation: JavaComponentContextProvider.java JavaImplementationInvoker.java JavaImplementationProvider.java
Date Thu, 06 Nov 2008 17:32:56 GMT
Author: edwardsmj
Date: Thu Nov  6 09:32:10 2008
New Revision: 711918

URL: http://svn.apache.org/viewvc?rev=711918&view=rev
Log: (empty)

Modified:
    tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java
    tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java
    tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProvider.java

Modified: tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java?rev=711918&r1=711917&r2=711918&view=diff
==============================================================================
--- tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java
(original)
+++ tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java
Thu Nov  6 09:32:10 2008
@@ -34,6 +34,7 @@
 import org.apache.tuscany.sca.assembly.ComponentProperty;
 import org.apache.tuscany.sca.assembly.ComponentReference;
 import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Consumer;
 import org.apache.tuscany.sca.assembly.Multiplicity;
 import org.apache.tuscany.sca.assembly.Reference;
 import org.apache.tuscany.sca.context.ComponentContextFactory;
@@ -320,6 +321,14 @@
         return new JavaImplementationInvoker(operation, method, component);
     }
 
+    // Method added to deal with Consumer invocation
+    Invoker createInvoker(Operation operation, Consumer consumer) throws NoSuchMethodException
{
+        Class<?> implClass = instanceFactoryProvider.getImplementationClass();
+
+        Method method = JavaInterfaceUtil.findMethod(implClass, operation);
+        return new JavaImplementationInvoker(operation, method, component, consumer);
+    }
+    
     private static class OptimizedObjectFactory<T> implements ObjectFactory<T>
{
         private ScopeContainer scopeContainer;
 

Modified: tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java?rev=711918&r1=711917&r2=711918&view=diff
==============================================================================
--- tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java
(original)
+++ tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java
Thu Nov  6 09:32:10 2008
@@ -21,6 +21,7 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
+import org.apache.tuscany.sca.assembly.Consumer;
 import org.apache.tuscany.sca.core.context.InstanceWrapper;
 import org.apache.tuscany.sca.core.scope.Scope;
 import org.apache.tuscany.sca.core.scope.ScopeContainer;
@@ -48,10 +49,21 @@
     protected Operation operation;
     protected Method method;
     protected boolean allowsPBR;
+    protected Consumer consumer = null;
 
     @SuppressWarnings("unchecked")
     protected final ScopeContainer scopeContainer;
 
+    public JavaImplementationInvoker(Operation operation, Method method, 
+    		                         RuntimeComponent component, Consumer consumer) {
+        assert method != null : "Operation method cannot be null";
+        this.method = method;
+        this.operation = operation;
+        this.scopeContainer = ((ScopedRuntimeComponent)component).getScopeContainer();
+        this.allowsPBR = ((JavaImplementation)component.getImplementation()).isAllowsPassByReference(method);
+        this.consumer = consumer;
+    }
+    
     public JavaImplementationInvoker(Operation operation, Method method, RuntimeComponent
component) {
         assert method != null : "Operation method cannot be null";
         this.method = method;

Modified: tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProvider.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProvider.java?rev=711918&r1=711917&r2=711918&view=diff
==============================================================================
--- tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProvider.java
(original)
+++ tuscany/sandbox/event/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProvider.java
Thu Nov  6 09:32:10 2008
@@ -146,7 +146,12 @@
 
     public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
         try {
-            return componentContextProvider.createInvoker(operation);
+        	// Added separate processing for Consumers...     Mike Edwards, 06/11/2008
+        	if( service.isConsumer() ){
+        		return componentContextProvider.createInvoker(operation, service.getConsumer()
);
+        	} else {
+        		return componentContextProvider.createInvoker(operation);
+        	} // end if      
         } catch (NoSuchMethodException e) {
             // It's possible that the instance being invoked is a user-specified
             // callback object that isn't an instance of the component implementation



Mime
View raw message