You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by va...@apache.org on 2009/01/27 14:45:50 UTC

svn commit: r738090 - /tuscany/branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.java

Author: vamsic007
Date: Tue Jan 27 13:45:50 2009
New Revision: 738090

URL: http://svn.apache.org/viewvc?rev=738090&view=rev
Log:
Process services in component pre-processing.

Modified:
    tuscany/branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.java

Modified: tuscany/branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.java?rev=738090&r1=738089&r2=738090&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.java (original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/impl/EJBImplementationImpl.java Tue Jan 27 13:45:50 2009
@@ -116,6 +116,12 @@
                 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 @@
         }
         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;
+    }
 }