From 924b972e48012ca06d2f945535a618ee557a20d0 Mon Sep 17 00:00:00 2001 From: vamsic007 Date: Tue, 27 Jan 2009 13:45:50 +0000 Subject: Process services in component pre-processing. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@738090 13f79535-47bb-0310-9956-ffa450edef68 --- .../ejb/impl/EJBImplementationImpl.java | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'branches/sca-java-1.x/modules') 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; + } } -- cgit v1.2.3