git://wamblee.org
/
utils
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ac19626
)
Now the component provides read-only access to the interfaces.
author
erik
<erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Thu, 5 Jun 2008 20:47:50 +0000
(20:47 +0000)
committer
erik
<erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Thu, 5 Jun 2008 20:47:50 +0000
(20:47 +0000)
trunk/system/spring/src/main/java/org/wamblee/system/spring/RequiredServiceBean.java
patch
|
blob
|
history
trunk/system/spring/src/main/java/org/wamblee/system/spring/SpringComponent.java
patch
|
blob
|
history
trunk/system/spring/src/test/java/org/wamblee/system/spring/SpringComponentTest.java
patch
|
blob
|
history
diff --git
a/trunk/system/spring/src/main/java/org/wamblee/system/spring/RequiredServiceBean.java
b/trunk/system/spring/src/main/java/org/wamblee/system/spring/RequiredServiceBean.java
index 2e72f733825556002864917afda508e8acdf0e52..abd5115ea68ab78384175e974280d43fa606fdee 100644
(file)
--- a/
trunk/system/spring/src/main/java/org/wamblee/system/spring/RequiredServiceBean.java
+++ b/
trunk/system/spring/src/main/java/org/wamblee/system/spring/RequiredServiceBean.java
@@
-18,6
+18,7
@@
package org.wamblee.system.spring;
import org.springframework.beans.factory.FactoryBean;
import org.wamblee.system.core.ProvidedInterface;
import org.wamblee.system.core.RequiredInterface;
import org.springframework.beans.factory.FactoryBean;
import org.wamblee.system.core.ProvidedInterface;
import org.wamblee.system.core.RequiredInterface;
+import org.wamblee.system.core.RequiredInterfaces;
import org.wamblee.system.core.SystemAssemblyException;
/**
import org.wamblee.system.core.SystemAssemblyException;
/**
@@
-35,7
+36,7
@@
class RequiredServiceBean implements FactoryBean {
* @param aId Id of the bean in the service registry.
*/
public RequiredServiceBean(String aId) {
* @param aId Id of the bean in the service registry.
*/
public RequiredServiceBean(String aId) {
- RequiredInterface
[]
required = SpringComponent.THIS.get().getRequiredInterfaces();
+ RequiredInterface
s
required = SpringComponent.THIS.get().getRequiredInterfaces();
for ( RequiredInterface intf: required) {
if ( intf.getName().equals(aId)) {
_required = intf;
for ( RequiredInterface intf: required) {
if ( intf.getName().equals(aId)) {
_required = intf;
diff --git
a/trunk/system/spring/src/main/java/org/wamblee/system/spring/SpringComponent.java
b/trunk/system/spring/src/main/java/org/wamblee/system/spring/SpringComponent.java
index 83a5133bd74122ef48213941ddffcd9ce6137f6b..c1e3a7b302f9098858cc468886b48e1f256bc3cb 100644
(file)
--- a/
trunk/system/spring/src/main/java/org/wamblee/system/spring/SpringComponent.java
+++ b/
trunk/system/spring/src/main/java/org/wamblee/system/spring/SpringComponent.java
@@
-113,7
+113,7
@@
public class SpringComponent extends AbstractComponent<Scope> {
SpringComponent old = THIS.get();
Scope oldScope = SCOPE.get();
THIS.set(this);
SpringComponent old = THIS.get();
Scope oldScope = SCOPE.get();
THIS.set(this);
- Scope scope = new DefaultScope(getProvidedInterfaces(), aExternalScope);
+ Scope scope = new DefaultScope(getProvidedInterfaces()
.toArray()
, aExternalScope);
SCOPE.set(scope);
try {
GenericApplicationContext parentContext = new GenericApplicationContext();
SCOPE.set(scope);
try {
GenericApplicationContext parentContext = new GenericApplicationContext();
diff --git
a/trunk/system/spring/src/test/java/org/wamblee/system/spring/SpringComponentTest.java
b/trunk/system/spring/src/test/java/org/wamblee/system/spring/SpringComponentTest.java
index 10e2ca8eb8a277b3319c9b712b48b53f3ac9a2d9..67ed048df8f19dbaed681191c855686d785486ac 100644
(file)
--- a/
trunk/system/spring/src/test/java/org/wamblee/system/spring/SpringComponentTest.java
+++ b/
trunk/system/spring/src/test/java/org/wamblee/system/spring/SpringComponentTest.java
@@
-158,7
+158,7
@@
public class SpringComponentTest extends TestCase {
HelloService.class);
Scope scope = new DefaultScope(new ProvidedInterface[] { helloService });
scope.publishInterface(helloService, helloObject);
HelloService.class);
Scope scope = new DefaultScope(new ProvidedInterface[] { helloService });
scope.publishInterface(helloService, helloObject);
- system.getRequiredInterfaces()
[0]
.setProvider(helloService);
+ system.getRequiredInterfaces()
.get(0)
.setProvider(helloService);
Scope runtime = system.start(scope);
system.stop(runtime);
Scope runtime = system.start(scope);
system.stop(runtime);
@@
-181,7
+181,7
@@
public class SpringComponentTest extends TestCase {
HelloService.class);
Scope scope = new DefaultScope(new ProvidedInterface[] { helloService });
scope.publishInterface(helloService, helloObject);
HelloService.class);
Scope scope = new DefaultScope(new ProvidedInterface[] { helloService });
scope.publishInterface(helloService, helloObject);
- system.getRequiredInterfaces()
[0]
.setProvider(helloService);
+ system.getRequiredInterfaces()
.get(0)
.setProvider(helloService);
Scope runtime = system.start(scope);
ProvidedInterface started = runtime.getProvidedInterfaces()[0];
Scope runtime = system.start(scope);
ProvidedInterface started = runtime.getProvidedInterfaces()[0];
@@
-222,7
+222,7
@@
public class SpringComponentTest extends TestCase {
assertSame(service, service2);
Object floatsvc = _externalScope.getInterfaceImplementation(system
assertSame(service, service2);
Object floatsvc = _externalScope.getInterfaceImplementation(system
- .getProvidedInterfaces()
[1]
, Object.class);
+ .getProvidedInterfaces()
.get(1)
, Object.class);
assertTrue(floatsvc instanceof Float);
assertTrue((((Float) floatsvc).floatValue() - 100.345f) < 0.00001);
assertTrue(floatsvc instanceof Float);
assertTrue((((Float) floatsvc).floatValue() - 100.345f) < 0.00001);
@@
-251,8
+251,8
@@
public class SpringComponentTest extends TestCase {
Scope scope = new DefaultScope(new ProvidedInterface[] { helloService });
scope.publishInterface(helloService, helloObject);
scope.publishInterface(floatService, 100.234f);
Scope scope = new DefaultScope(new ProvidedInterface[] { helloService });
scope.publishInterface(helloService, helloObject);
scope.publishInterface(floatService, 100.234f);
- system.getRequiredInterfaces()
[0]
.setProvider(helloService);
- system.getRequiredInterfaces()
[1]
.setProvider(floatService);
+ system.getRequiredInterfaces()
.get(0)
.setProvider(helloService);
+ system.getRequiredInterfaces()
.get(1)
.setProvider(floatService);
Scope runtime = system.start(scope);
system.stop(runtime);
Scope runtime = system.start(scope);
system.stop(runtime);