You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jm...@apache.org on 2006/11/05 15:57:41 UTC
svn commit: r471439 - in /incubator/tuscany/java/sca/kernel/core/src:
main/resources/org/apache/tuscany/core/implementation.scdl
test/java/org/apache/tuscany/core/integration/implementation/IntrospectionRegistryIntegrationTestCase.java
Author: jmarino
Date: Sun Nov 5 06:57:40 2006
New Revision: 471439
URL: http://svn.apache.org/viewvc?view=rev&rev=471439
Log:
enable @Resource processing in the runtime
Modified:
incubator/tuscany/java/sca/kernel/core/src/main/resources/org/apache/tuscany/core/implementation.scdl
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/implementation/IntrospectionRegistryIntegrationTestCase.java
Modified: incubator/tuscany/java/sca/kernel/core/src/main/resources/org/apache/tuscany/core/implementation.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/resources/org/apache/tuscany/core/implementation.scdl?view=diff&rev=471439&r1=471438&r2=471439
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/resources/org/apache/tuscany/core/implementation.scdl (original)
+++ incubator/tuscany/java/sca/kernel/core/src/main/resources/org/apache/tuscany/core/implementation.scdl Sun Nov 5 06:57:40 2006
@@ -57,4 +57,8 @@
<component name="implementation.Monitor">
<system:implementation.system class="org.apache.tuscany.core.implementation.processor.MonitorProcessor"/>
</component>
+ <component name="implementation.Resource">
+ <system:implementation.system class="org.apache.tuscany.core.implementation.processor.ResourceProcessor"/>
+ </component>
+
</composite>
Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/implementation/IntrospectionRegistryIntegrationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/implementation/IntrospectionRegistryIntegrationTestCase.java?view=diff&rev=471439&r1=471438&r2=471439
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/implementation/IntrospectionRegistryIntegrationTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/implementation/IntrospectionRegistryIntegrationTestCase.java Sun Nov 5 06:57:40 2006
@@ -23,12 +23,13 @@
import org.osoa.sca.annotations.Property;
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Resource;
+import org.apache.tuscany.spi.implementation.java.ImplementationProcessorService;
import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
import org.apache.tuscany.spi.implementation.java.JavaMappedService;
import org.apache.tuscany.spi.implementation.java.PojoComponentType;
-import org.apache.tuscany.spi.implementation.java.ImplementationProcessorService;
import static org.apache.tuscany.spi.model.Scope.MODULE;
import junit.framework.TestCase;
@@ -39,6 +40,7 @@
import org.apache.tuscany.core.implementation.processor.InitProcessor;
import org.apache.tuscany.core.implementation.processor.PropertyProcessor;
import org.apache.tuscany.core.implementation.processor.ReferenceProcessor;
+import org.apache.tuscany.core.implementation.processor.ResourceProcessor;
import org.apache.tuscany.core.implementation.processor.ScopeProcessor;
import org.apache.tuscany.core.monitor.NullMonitorFactory;
@@ -60,6 +62,7 @@
assertEquals(MODULE, type.getImplementationScope());
assertEquals(Foo.class.getMethod("setBar", String.class), type.getProperties().get("bar").getMember());
assertEquals(Foo.class.getMethod("setTarget", Foo.class), type.getReferences().get("target").getMember());
+ assertEquals(Foo.class.getMethod("setResource", Foo.class), type.getResources().get("resource").getMember());
}
protected void setUp() throws Exception {
@@ -73,13 +76,14 @@
ImplementationProcessorService service = new ImplementationProcessorServiceImpl(interfaceProcessorRegistry);
registry.registerProcessor(new PropertyProcessor(service));
registry.registerProcessor(new ReferenceProcessor(interfaceProcessorRegistry));
+ registry.registerProcessor(new ResourceProcessor());
}
@Scope("MODULE")
private static class Foo {
protected Foo target;
protected String bar;
-
+ protected Foo resource;
private boolean initialized;
private boolean destroyed;
@@ -116,6 +120,11 @@
@Property
public void setBar(String bar) {
this.bar = bar;
+ }
+
+ @Resource
+ public void setResource(Foo resource) {
+ this.resource = resource;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org