diff options
Diffstat (limited to '')
-rw-r--r-- | branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.java | 25 |
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; + } } |