summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvamsic007 <vamsic007@13f79535-47bb-0310-9956-ffa450edef68>2009-01-27 13:45:50 +0000
committervamsic007 <vamsic007@13f79535-47bb-0310-9956-ffa450edef68>2009-01-27 13:45:50 +0000
commit924b972e48012ca06d2f945535a618ee557a20d0 (patch)
tree79159160c737e9cc3d80e8b0e4e06f240abaf31a
parent0f04ca069a3d18f56a5a26e19ae3060f2a123d9d (diff)
Process services in component pre-processing.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@738090 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.java b/branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.java
index c9bfaea00b..cf220a8339 100644
--- a/branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.java
+++ b/branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.java
@@ -116,6 +116,12 @@ class EJBImplementationImpl implements EJBImplementation, ComponentPreProcessor
getProperties().add(createProperty(property));
}
}
+
+ for(Service service : rtc.getServices()) {
+ if (getService(service.getName()) == null) {
+ getServices().add(createService(service));
+ }
+ }
}
protected Reference getReference(String name) {
@@ -155,4 +161,23 @@ class EJBImplementationImpl implements EJBImplementation, ComponentPreProcessor
}
return newProperty;
}
+
+ protected Service getService(String name) {
+ for (Service service : getServices()) {
+ if (service.getName().equals(name)) {
+ return service;
+ }
+ }
+ return null;
+ }
+
+ protected Service createService(Service service) {
+ Service newService;
+ try {
+ newService = (Service)service.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new AssertionError(e); // should not ever happen
+ }
+ return newService;
+ }
}