You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/05/23 16:13:14 UTC

svn commit: r408901 [1/2] - in /incubator/servicemix/branches/java5: ./ servicemix-core/ servicemix-core/src/main/java/org/apache/servicemix/ servicemix-core/src/main/java/org/apache/servicemix/jbi/config/ servicemix-core/src/main/java/org/apache/servi...

Author: gnodet
Date: Tue May 23 07:13:08 2006
New Revision: 408901

URL: http://svn.apache.org/viewvc?rev=408901&view=rev
Log:
Upgrade core to java5.
Need to activate retro-translator plugin.

Added:
    incubator/servicemix/branches/java5/servicemix-schemas/   (with props)
    incubator/servicemix/branches/java5/servicemix-schemas/pom.xml
    incubator/servicemix/branches/java5/servicemix-schemas/src/
    incubator/servicemix/branches/java5/servicemix-schemas/src/main/
    incubator/servicemix/branches/java5/servicemix-schemas/src/main/java/
    incubator/servicemix/branches/java5/servicemix-schemas/src/main/java/org/
    incubator/servicemix/branches/java5/servicemix-schemas/src/main/java/org/apache/
    incubator/servicemix/branches/java5/servicemix-schemas/src/main/java/org/apache/servicemix/
    incubator/servicemix/branches/java5/servicemix-schemas/src/main/java/org/apache/servicemix/schemas/
    incubator/servicemix/branches/java5/servicemix-schemas/src/main/java/org/apache/servicemix/schemas/deployment/
    incubator/servicemix/branches/java5/servicemix-schemas/src/main/java/org/apache/servicemix/schemas/deployment/DescriptorFactory.java
    incubator/servicemix/branches/java5/servicemix-schemas/src/main/xjb/
    incubator/servicemix/branches/java5/servicemix-schemas/src/main/xjb/jbi.xjb
    incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/
    incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/component-info-list.xsd
    incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/jbi.xsd
    incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/management-message.xsd
    incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/service-assembly-info-list.xsd
    incubator/servicemix/branches/java5/servicemix-schemas/src/test/
    incubator/servicemix/branches/java5/servicemix-schemas/src/test/java/
    incubator/servicemix/branches/java5/servicemix-schemas/src/test/java/org/
    incubator/servicemix/branches/java5/servicemix-schemas/src/test/java/org/apache/
    incubator/servicemix/branches/java5/servicemix-schemas/src/test/java/org/apache/servicemix/
    incubator/servicemix/branches/java5/servicemix-schemas/src/test/java/org/apache/servicemix/schemas/
    incubator/servicemix/branches/java5/servicemix-schemas/src/test/java/org/apache/servicemix/schemas/deployment/
    incubator/servicemix/branches/java5/servicemix-schemas/src/test/java/org/apache/servicemix/schemas/deployment/DescriptorTest.java
    incubator/servicemix/branches/java5/servicemix-schemas/src/test/resources/
    incubator/servicemix/branches/java5/servicemix-schemas/src/test/resources/org/
    incubator/servicemix/branches/java5/servicemix-schemas/src/test/resources/org/apache/
    incubator/servicemix/branches/java5/servicemix-schemas/src/test/resources/org/apache/servicemix/
    incubator/servicemix/branches/java5/servicemix-schemas/src/test/resources/org/apache/servicemix/schemas/
    incubator/servicemix/branches/java5/servicemix-schemas/src/test/resources/org/apache/servicemix/schemas/deployment/
    incubator/servicemix/branches/java5/servicemix-schemas/src/test/resources/org/apache/servicemix/schemas/deployment/component.xml
Removed:
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/config/
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/
Modified:
    incubator/servicemix/branches/java5/pom.xml
    incubator/servicemix/branches/java5/servicemix-core/pom.xml
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/Main.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/EnvironmentContext.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/JBIContainer.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/AutoDeploymentService.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentRegistry.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/DeploymentService.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/EndpointRegistry.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallationService.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/Registry.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceAssemblyLifeCycle.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceAssemblyRegistry.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceUnitLifeCycle.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/loaders/ClassLoaderService.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlow.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/seda/SedaFlow.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/seda/SedaQueue.java
    incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/PropertiesLoginModule.java
    incubator/servicemix/branches/java5/servicemix-core/src/test/java/org/apache/servicemix/jbi/deployment/DeploymentTest.java
    incubator/servicemix/branches/java5/servicemix-core/src/test/java/org/apache/servicemix/jbi/deployment/ServiceAssemblyTest.java
    incubator/servicemix/branches/java5/servicemix-core/src/test/java/org/apache/servicemix/jbi/deployment/SharedLibraryTest.java

Modified: incubator/servicemix/branches/java5/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/pom.xml?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/pom.xml (original)
+++ incubator/servicemix/branches/java5/pom.xml Tue May 23 07:13:08 2006
@@ -197,6 +197,7 @@
   <modules>
     <module>servicemix-jbi</module>
     <module>servicemix-services</module>
+    <module>servicemix-schemas</module>
     <module>servicemix-core</module>
     <module>servicemix-components</module>
     <module>servicemix-common</module>
@@ -292,6 +293,11 @@
       <dependency>
         <groupId>${pom.groupId}</groupId>
         <artifactId>servicemix-services</artifactId>
+        <version>3.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>${pom.groupId}</groupId>
+        <artifactId>servicemix-schemas</artifactId>
         <version>3.0-SNAPSHOT</version>
       </dependency>
       <dependency>

Modified: incubator/servicemix/branches/java5/servicemix-core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/pom.xml?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/pom.xml (original)
+++ incubator/servicemix/branches/java5/servicemix-core/pom.xml Tue May 23 07:13:08 2006
@@ -42,6 +42,10 @@
       <artifactId>servicemix-services</artifactId>
     </dependency>
     <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>servicemix-schemas</artifactId>
+    </dependency>
+    <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
       <optional>true</optional>

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/Main.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/Main.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/Main.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/Main.java Tue May 23 07:13:08 2006
@@ -17,10 +17,8 @@
 
 import java.io.File;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
-import org.apache.servicemix.jbi.config.spring.XBeanProcessor;
 import org.apache.servicemix.jbi.container.SpringJBIContainer;
 import org.springframework.beans.factory.DisposableBean;
 import org.springframework.context.ApplicationContext;
@@ -28,6 +26,7 @@
 import org.apache.xbean.server.spring.configuration.ClassLoaderXmlPreprocessor;
 import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
 import org.apache.xbean.spring.context.FileSystemXmlApplicationContext;
+import org.apache.xbean.spring.context.SpringXmlPreprocessor;
 
 /**
  * A simple stand alone application which runs ServiceMix from the command line.
@@ -60,25 +59,10 @@
                     return;
                 }
                 
-                List processors = new ArrayList();
+                List<SpringXmlPreprocessor> processors = new ArrayList<SpringXmlPreprocessor>();
                 processors.add(new ClassLoaderXmlPreprocessor(new FileSystemRepository(new File("."))));
-                if (file.equals("-v1")) {
-                    
-                    processors.add(new XBeanProcessor());
-                    if (args.length <= 1) {
-                        System.out.println("Loading Apache ServiceMix (compatible 1.x) from servicemix.xml on the CLASSPATH");
-                        context = new ClassPathXmlApplicationContext("servicemix.xml", processors);
-                    }
-                    else {
-                        file = args[1];
-                        System.out.println("Loading Apache ServiceMix (compatible 1.x) from file: " + file);
-                        context = new FileSystemXmlApplicationContext(file, processors);
-                    }
-                }
-                else {
-                    System.out.println("Loading Apache ServiceMix from file: " + file);
-                    context = new FileSystemXmlApplicationContext(file, processors);
-                }
+                System.out.println("Loading Apache ServiceMix from file: " + file);
+                context = new FileSystemXmlApplicationContext(file, processors);
             }
             SpringJBIContainer container = (SpringJBIContainer) context.getBean("jbi");
             Object lock = new Object();

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/EnvironmentContext.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/EnvironmentContext.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/EnvironmentContext.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/EnvironmentContext.java Tue May 23 07:13:08 2006
@@ -21,6 +21,8 @@
 import java.util.Map;
 import java.util.Timer;
 import java.util.TimerTask;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.jbi.JBIException;
 import javax.management.JMException;
@@ -34,9 +36,6 @@
 import org.apache.servicemix.jbi.util.FileUtil;
 import org.apache.servicemix.jbi.util.FileVersionUtil;
 
-import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
-import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean;
-
 /**
  * Holder for environment information
  * 
@@ -64,7 +63,7 @@
     private File serviceAssembliesDir;
     private File tmpDir;
     private int statsInterval = 5;
-    private Map envMap = new ConcurrentHashMap();
+    private Map<ComponentMBeanImpl, ComponentEnvironment> envMap = new ConcurrentHashMap<ComponentMBeanImpl, ComponentEnvironment>();
     private AtomicBoolean started = new AtomicBoolean(false);
     private boolean dumpStats = false;
     private Timer statsTimer;
@@ -168,7 +167,7 @@
         buildDirectoryStructure();
     }
 
-    protected Class getServiceMBean() {
+    protected Class<EnvironmentContextMBean> getServiceMBean() {
         return EnvironmentContextMBean.class;
     }
 
@@ -205,8 +204,8 @@
      */
     public void shutDown() throws javax.jbi.JBIException {
         super.shutDown();
-        for (Iterator i = envMap.values().iterator();i.hasNext();) {
-            ComponentEnvironment ce = (ComponentEnvironment) i.next();
+        for (Iterator<ComponentEnvironment> i = envMap.values().iterator();i.hasNext();) {
+            ComponentEnvironment ce = i.next();
             ce.close();
         }
         if (timerTask != null) {
@@ -259,8 +258,8 @@
 
     protected void doDumpStats() {
         if (isDumpStats()) {
-            for (Iterator i = envMap.values().iterator();i.hasNext();) {
-                ComponentEnvironment ce = (ComponentEnvironment) i.next();
+            for (Iterator<ComponentEnvironment> i = envMap.values().iterator();i.hasNext();) {
+                ComponentEnvironment ce = i.next();
                 ce.dumpStats();
             }
         }
@@ -459,7 +458,7 @@
      * @param doDelete true if component is to be deleted
      */
     public void unreregister(ComponentMBeanImpl connector) {
-        ComponentEnvironment ce = (ComponentEnvironment) envMap.remove(connector);
+        ComponentEnvironment ce = envMap.remove(connector);
         if (ce != null) {
             ce.close();
         }

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/JBIContainer.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/JBIContainer.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/JBIContainer.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/JBIContainer.java Tue May 23 07:13:08 2006
@@ -1184,7 +1184,7 @@
         }
     }
     
-    public Object[] getListeners(Class lc) {
+    public <T extends EventListener> T[] getListeners(Class<T> lc) {
         return listeners.getListeners(lc);
     }
     

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/AutoDeploymentService.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/AutoDeploymentService.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/AutoDeploymentService.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/AutoDeploymentService.java Tue May 23 07:13:08 2006
@@ -41,9 +41,10 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.jbi.container.EnvironmentContext;
 import org.apache.servicemix.jbi.container.JBIContainer;
-import org.apache.servicemix.jbi.deployment.Descriptor;
-import org.apache.servicemix.jbi.deployment.DescriptorFactory;
-import org.apache.servicemix.jbi.deployment.ServiceAssembly;
+import org.apache.servicemix.schemas.deployment.Descriptor;
+import org.apache.servicemix.schemas.deployment.DescriptorFactory;
+import org.apache.servicemix.schemas.deployment.ServiceAssembly;
+import org.apache.servicemix.schemas.deployment.ServiceUnit;
 import org.apache.servicemix.jbi.management.AttributeInfoHelper;
 import org.apache.servicemix.jbi.management.BaseSystemService;
 import org.apache.servicemix.jbi.util.FileUtil;
@@ -299,10 +300,10 @@
 
     protected Set getComponentNames(ServiceAssembly sa) {
         Set names = null;
-        if (sa.getServiceUnits() != null && sa.getServiceUnits().length > 0) {
+        if (sa.getServiceUnit() != null && sa.getServiceUnit().size() > 0) {
             names = new HashSet();
-            for (int i = 0; i < sa.getServiceUnits().length; i++) {
-                names.add(sa.getServiceUnits()[i].getTarget().getComponentName());
+            for (ServiceUnit su : sa.getServiceUnit()) {
+                names.add(su.getTarget().getComponentName());
             }
         }
         return names;

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentRegistry.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentRegistry.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentRegistry.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentRegistry.java Tue May 23 07:13:08 2006
@@ -32,7 +32,7 @@
  */
 public class ComponentRegistry {
     
-    private Map idMap = new LinkedHashMap();
+    private Map<ComponentNameSpace, ComponentMBeanImpl> idMap = new LinkedHashMap<ComponentNameSpace, ComponentMBeanImpl>();
     private boolean runningStateInitialized = false;
     private Registry registry;
     
@@ -105,7 +105,7 @@
     }
     
     private Collection getReverseComponents() {
-        ArrayList l = new ArrayList(getComponents());
+        ArrayList<ComponentMBean> l = new ArrayList<ComponentMBean>(getComponents());
         Collections.reverse(l);
         return l;
     }
@@ -126,14 +126,14 @@
      * @return the ComponentConnector or null
      */
     public synchronized ComponentMBeanImpl getComponent(ComponentNameSpace id) {
-        return (ComponentMBeanImpl) idMap.get(id);
+        return idMap.get(id);
     }
     
     /**
      * 
      * @return Collection of ComponentConnectors held by the registry
      */
-    public synchronized Collection getComponents() {
+    public synchronized Collection<ComponentMBeanImpl> getComponents() {
         return idMap.values();
     }
 

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/DeploymentService.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/DeploymentService.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/DeploymentService.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/DeploymentService.java Tue May 23 07:13:08 2006
@@ -38,10 +38,10 @@
 import org.apache.servicemix.jbi.container.EnvironmentContext;
 import org.apache.servicemix.jbi.container.JBIContainer;
 import org.apache.servicemix.jbi.container.ServiceAssemblyEnvironment;
-import org.apache.servicemix.jbi.deployment.Descriptor;
-import org.apache.servicemix.jbi.deployment.DescriptorFactory;
-import org.apache.servicemix.jbi.deployment.ServiceAssembly;
-import org.apache.servicemix.jbi.deployment.ServiceUnit;
+import org.apache.servicemix.schemas.deployment.Descriptor;
+import org.apache.servicemix.schemas.deployment.DescriptorFactory;
+import org.apache.servicemix.schemas.deployment.ServiceAssembly;
+import org.apache.servicemix.schemas.deployment.ServiceUnit;
 import org.apache.servicemix.jbi.management.AttributeInfoHelper;
 import org.apache.servicemix.jbi.management.BaseSystemService;
 import org.apache.servicemix.jbi.management.OperationInfoHelper;
@@ -462,82 +462,77 @@
             throw ManagementSupport.failure("deploy", "Failed to rename " + tmpDir + " to " + saDirectory);
         }
         // Check all SUs requirements
-        ServiceUnit[] sus = sa.getServiceUnits();
-        if (sus != null) {
-            for (int i = 0; i < sus.length; i++) {
-                String suName = sus[i].getIdentification().getName();
-                String artifact = sus[i].getTarget().getArtifactsZip();
-                String componentName = sus[i].getTarget().getComponentName();
-                File artifactFile = new File(saDirectory, artifact);
-                if (!artifactFile.exists()) {
-                    throw ManagementSupport.failure("deploy", "Artifact " + artifact + " not found for service unit " + suName);
-                }
-                ComponentMBeanImpl lcc = container.getComponent(componentName);
-                if (lcc == null) {
-                    throw ManagementSupport.failure("deploy", "Target component " + componentName + " for service unit " + suName + " is not installed");
-                }
-                if (!lcc.isStarted()) {
-                    throw ManagementSupport.failure("deploy", "Target component " + componentName + " for service unit " + suName + " is not started");
-                }
-                if (lcc.getServiceUnitManager() == null) {
-                    throw ManagementSupport.failure("deploy", "Target component " + componentName + " for service unit " + suName + " does not accept deployments");
-                }
-                // TODO: check duplicates here ?
-                if (isDeployedServiceUnit(componentName, suName)) {
-                    throw ManagementSupport.failure("deploy", "Service unit " + suName + " is already deployed on component " + componentName);
-                }
+        for (ServiceUnit su : sa.getServiceUnit()) {
+            String suName = su.getIdentification().getName();
+            String artifact = su.getTarget().getArtifactsZip();
+            String componentName = su.getTarget().getComponentName();
+            File artifactFile = new File(saDirectory, artifact);
+            if (!artifactFile.exists()) {
+                throw ManagementSupport.failure("deploy", "Artifact " + artifact + " not found for service unit " + suName);
+            }
+            ComponentMBeanImpl lcc = container.getComponent(componentName);
+            if (lcc == null) {
+                throw ManagementSupport.failure("deploy", "Target component " + componentName + " for service unit " + suName + " is not installed");
+            }
+            if (!lcc.isStarted()) {
+                throw ManagementSupport.failure("deploy", "Target component " + componentName + " for service unit " + suName + " is not started");
+            }
+            if (lcc.getServiceUnitManager() == null) {
+                throw ManagementSupport.failure("deploy", "Target component " + componentName + " for service unit " + suName + " does not accept deployments");
+            }
+            // TODO: check duplicates here ?
+            if (isDeployedServiceUnit(componentName, suName)) {
+                throw ManagementSupport.failure("deploy", "Service unit " + suName + " is already deployed on component " + componentName);
             }
         }
         // Everything seems ok, so deploy all SUs
         int nbSuccess = 0;
         int nbFailures = 0;
         List componentResults = new ArrayList();
-        List suKeys = new ArrayList();
-        if (sus != null) {
-            for (int i = 0; i < sus.length; i++) {
-                File targetDir = null;
-                String suName = sus[i].getIdentification().getName();
-                String artifact = sus[i].getTarget().getArtifactsZip();
-                String componentName = sus[i].getTarget().getComponentName();
-                // TODO: skip duplicates
-                // Unpack SU
-                try {
-                    File artifactFile = new File(saDirectory, artifact);
-                    targetDir = env.getServiceUnitDirectory(componentName, suName);
-                    if (log.isDebugEnabled()) {
-                        log.debug("Unpack service unit archive " + artifactFile + " to " + targetDir);
-                    }
-                    FileUtil.unpackArchive(artifactFile, targetDir);
-                } catch (IOException e) {
-                    nbFailures++;
-                    componentResults.add(ManagementSupport.createComponentFailure(
-                            "deploy", componentName,
-                            "Error unpacking service unit", e));
-                    continue;
+        List<String> suKeys = new ArrayList<String>();
+        for (ServiceUnit su : sa.getServiceUnit()) {
+            File targetDir = null;
+            String suName = su.getIdentification().getName();
+            String artifact = su.getTarget().getArtifactsZip();
+            String componentName = su.getTarget().getComponentName();
+            // TODO: skip duplicates
+            // Unpack SU
+            try {
+                File artifactFile = new File(saDirectory, artifact);
+                targetDir = env.getServiceUnitDirectory(componentName, suName);
+                if (log.isDebugEnabled()) {
+                    log.debug("Unpack service unit archive " + artifactFile + " to " + targetDir);
                 }
-                // Deploy it
-                boolean success = false;
+                FileUtil.unpackArchive(artifactFile, targetDir);
+            } catch (IOException e) {
+                nbFailures++;
+                componentResults.add(ManagementSupport.createComponentFailure(
+                        "deploy", componentName,
+                        "Error unpacking service unit", e));
+                continue;
+            }
+            // Deploy it
+            boolean success = false;
+            try {
+                ComponentMBeanImpl lcc = container.getComponent(componentName);
+                ServiceUnitManager sum = lcc.getServiceUnitManager();
+                ClassLoader cl = Thread.currentThread().getContextClassLoader();
                 try {
-                    ComponentMBeanImpl lcc = container.getComponent(componentName);
-                    ServiceUnitManager sum = lcc.getServiceUnitManager();
-                    ClassLoader cl = Thread.currentThread().getContextClassLoader();
-                    try {
-                        Thread.currentThread().setContextClassLoader(lcc.getComponent().getClass().getClassLoader());
-                        String resultMsg = sum.deploy(suName, targetDir.getAbsolutePath());
-                        success = getComponentTaskResult(resultMsg, componentName, componentResults, true);
-                    } finally {
-                        Thread.currentThread().setContextClassLoader(cl);
-                    }
-                    // TODO: need to register the SU somewhere to keep track of its state
-                } catch (Exception e) {
-                    getComponentTaskError(e, componentName, componentResults);
-                }
-                if (success) {
-                    nbSuccess++;
-                    suKeys.add(registry.registerServiceUnit(sus[i], assemblyName, targetDir));
-                } else {
-                    nbFailures++;
+                    Thread.currentThread().setContextClassLoader(lcc.getComponent().getClass().getClassLoader());
+                    String resultMsg = sum.deploy(suName, targetDir.getAbsolutePath());
+                    success = getComponentTaskResult(resultMsg, componentName, componentResults, true);
+                } finally {
+                    Thread.currentThread().setContextClassLoader(cl);
                 }
+                // TODO: need to register the SU somewhere to keep track of its state
+            } catch (Exception e) {
+                getComponentTaskError(e, componentName, componentResults);
+            }
+            if (success) {
+                nbSuccess++;
+                suKeys.add(registry.registerServiceUnit(su, assemblyName, targetDir));
+            } else {
+                nbFailures++;
             }
         }
         // Note: the jbi spec says that if at least one deployment succeeds, 
@@ -564,7 +559,7 @@
         // Success
         else {
             // Register SA
-            String[] deployedSUs = (String[]) suKeys.toArray(new String[suKeys.size()]);
+            String[] deployedSUs = suKeys.toArray(new String[suKeys.size()]);
             ServiceAssemblyLifeCycle salc = registry.registerServiceAssembly(sa, deployedSUs, env);
             salc.writeRunningState();
             // Build result string

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/EndpointRegistry.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/EndpointRegistry.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/EndpointRegistry.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/EndpointRegistry.java Tue May 23 07:13:08 2006
@@ -36,8 +36,8 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jbi.deployment.Provides;
-import org.apache.servicemix.jbi.deployment.Services;
+import org.apache.servicemix.schemas.deployment.Provides;
+import org.apache.servicemix.schemas.deployment.Services;
 import org.apache.servicemix.jbi.event.EndpointEvent;
 import org.apache.servicemix.jbi.event.EndpointListener;
 import org.apache.servicemix.jbi.servicedesc.AbstractServiceEndpoint;
@@ -208,16 +208,15 @@
         for (int i = 0; i < sus.length; i++) {
             Services services = sus[i].getServices();
             if (services != null) {
-                Provides[] provides = services.getProvides();
-                for (int j = 0; j < provides.length; j++) {
-                    if (provides[j].getInterfaceName() != null &&
-                        serviceEndpoint.getServiceName().equals(provides[j].getServiceName()) &&
-                        serviceEndpoint.getEndpointName().equals(provides[j].getEndpointName())) {
+            	for (Provides provides : services.getProvides()) {
+                    if (provides.getInterfaceName() != null &&
+                        serviceEndpoint.getServiceName().equals(provides.getServiceName()) &&
+                        serviceEndpoint.getEndpointName().equals(provides.getEndpointName())) {
                         if (logger.isDebugEnabled()) {
                             logger.debug("Endpoint " + serviceEndpoint + " is provided by SU " + sus[i].getName());
-                            logger.debug("Endpoint " + serviceEndpoint + " implements interface " + provides[j].getInterfaceName());
+                            logger.debug("Endpoint " + serviceEndpoint + " implements interface " + provides.getInterfaceName());
                         }
-                        serviceEndpoint.addInterface(provides[j].getInterfaceName());
+                        serviceEndpoint.addInterface(provides.getInterfaceName());
                     }
                 }
             }

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallationService.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallationService.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallationService.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallationService.java Tue May 23 07:13:08 2006
@@ -19,8 +19,10 @@
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.jbi.JBIException;
 import javax.jbi.management.DeploymentException;
@@ -39,13 +41,6 @@
 import org.apache.servicemix.jbi.container.ComponentEnvironment;
 import org.apache.servicemix.jbi.container.EnvironmentContext;
 import org.apache.servicemix.jbi.container.JBIContainer;
-import org.apache.servicemix.jbi.deployment.ClassPath;
-import org.apache.servicemix.jbi.deployment.Component;
-import org.apache.servicemix.jbi.deployment.Descriptor;
-import org.apache.servicemix.jbi.deployment.DescriptorFactory;
-import org.apache.servicemix.jbi.deployment.InstallationDescriptorExtension;
-import org.apache.servicemix.jbi.deployment.SharedLibrary;
-import org.apache.servicemix.jbi.deployment.SharedLibraryList;
 import org.apache.servicemix.jbi.loaders.ClassLoaderService;
 import org.apache.servicemix.jbi.loaders.InstallationClassLoader;
 import org.apache.servicemix.jbi.management.BaseSystemService;
@@ -53,8 +48,13 @@
 import org.apache.servicemix.jbi.management.OperationInfoHelper;
 import org.apache.servicemix.jbi.management.ParameterHelper;
 import org.apache.servicemix.jbi.util.FileUtil;
+import org.apache.servicemix.schemas.deployment.ClassPath;
+import org.apache.servicemix.schemas.deployment.Component;
+import org.apache.servicemix.schemas.deployment.Descriptor;
+import org.apache.servicemix.schemas.deployment.DescriptorFactory;
+import org.apache.servicemix.schemas.deployment.Descriptor.SharedLibrary;
+import org.w3c.dom.DocumentFragment;
 
-import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
 /**
  * Installation Service - installs/uninstalls archives
  * 
@@ -65,8 +65,8 @@
     private EnvironmentContext environmentContext;
     private ManagementContext managementContext;
     private ClassLoaderService classLoaderService=new ClassLoaderService();
-    private Map installers=new ConcurrentHashMap();
-    private Map nonLoadedInstallers = new ConcurrentHashMap();
+    private Map<String, InstallerMBeanImpl> installers = new ConcurrentHashMap<String, InstallerMBeanImpl>();
+    private Map<String, InstallerMBeanImpl> nonLoadedInstallers = new ConcurrentHashMap<String, InstallerMBeanImpl>();
 
     /**
      * Get Description
@@ -163,36 +163,36 @@
         installationContext.setComponentName(name);
         installationContext.setComponentDescription(descriptor.getIdentification().getDescription());
         installationContext.setInstallRoot(installationDir);
-        installationContext.setComponentClassName(descriptor.getComponentClassName());
+        installationContext.setComponentClassName(descriptor.getComponentClassName().getContent());
         ClassPath cp = descriptor.getComponentClassPath();
         if (cp != null) {
-            installationContext.setClassPathElements(cp.getPathElements());
+            installationContext.setClassPathElements(cp.getPathElement());
         }
         // now build the ComponentContext
         File componentRoot = environmentContext.getComponentRootDir(componentName);
         ComponentContextImpl context = buildComponentContext(componentRoot, componentName);
         installationContext.setContext(context);
-        InstallationDescriptorExtension desc = descriptor.getDescriptorExtension();
+        DocumentFragment desc = DescriptorFactory.getDescriptorExtension(descriptor);
         if (desc != null) {
-            installationContext.setDescriptorExtension(desc.getDescriptorExtension());
+            installationContext.setDescriptorExtension(desc);
         }
-        installationContext.setBinding(descriptor.isBindingComponent());
-        installationContext.setEngine(descriptor.isServiceEngine());
+        installationContext.setBinding(DescriptorFactory.isBindingComponent(descriptor));
+        installationContext.setEngine(DescriptorFactory.isServiceEngine(descriptor));
         // now we must initialize the boot strap class
         String bootstrapClassName = descriptor.getBootstrapClassName();
         ClassPath bootStrapClassPath = descriptor.getBootstrapClassPath();
         InstallationClassLoader bootstrapLoader = null;
         if (bootstrapClassName != null && bootstrapClassName.length() > 0) {
-            boolean parentFirst = descriptor.isBootstrapClassLoaderDelegationParentFirst();
+            boolean parentFirst = DescriptorFactory.isBCLParentFirst(descriptor);
             bootstrapLoader = classLoaderService.buildClassLoader(
-                    installationDir, bootStrapClassPath.getPathElements(), parentFirst);
+                    installationDir, bootStrapClassPath.getPathElement(), parentFirst);
         }
-        SharedLibraryList[] lists = descriptor.getSharedLibraries();
-        String componentClassName = descriptor.getComponentClassName();
+        List<Component.SharedLibrary> lists = descriptor.getSharedLibraryList();
+        String componentClassName = descriptor.getComponentClassName().getContent();
         ClassPath componentClassPath = descriptor.getComponentClassPath();
-        boolean parentFirst = descriptor.isComponentClassLoaderDelegationParentFirst();
-        ClassLoader componentClassLoader = classLoaderService.buildClassLoader(installationDir, componentClassPath
-                        .getPathElements(), parentFirst, lists);
+        boolean parentFirst = DescriptorFactory.isCCLParentFirst(descriptor);
+        ClassLoader componentClassLoader = classLoaderService.buildClassLoader(
+        			installationDir, componentClassPath.getPathElement(), parentFirst, lists);
         InstallerMBeanImpl installer = new InstallerMBeanImpl(container,
                 installationContext, componentClassLoader,
                 componentClassName, bootstrapLoader,
@@ -245,7 +245,7 @@
             File tmpDir=AutoDeploymentService.unpackLocation(environmentContext.getTmpDir(),aSharedLibURI);
             if(tmpDir!=null){
                 Descriptor root=DescriptorFactory.buildDescriptor(tmpDir);
-                SharedLibrary sl=root.getSharedLibrary();
+                SharedLibrary sl = root.getSharedLibrary();
                 if(sl!=null){
                     result=doInstallSharedLibrary(tmpDir,sl);
                 }
@@ -489,34 +489,34 @@
             installationContext.setComponentName(name);
             installationContext.setComponentDescription(descriptor.getIdentification().getDescription());
             installationContext.setInstallRoot(installationDir);
-            installationContext.setComponentClassName(descriptor.getComponentClassName());
+            installationContext.setComponentClassName(descriptor.getComponentClassName().getContent());
             ClassPath cp=descriptor.getComponentClassPath();
             if(cp!=null){
-                installationContext.setClassPathElements(cp.getPathElements());
+                installationContext.setClassPathElements(cp.getPathElement());
             }
             // now build the ComponentContext
             installationContext.setContext(buildComponentContext(componentRoot,name));
-            InstallationDescriptorExtension desc=descriptor.getDescriptorExtension();
-            if(desc!=null){
-                installationContext.setDescriptorExtension(desc.getDescriptorExtension());
+            DocumentFragment desc = DescriptorFactory.getDescriptorExtension(descriptor);
+            if (desc != null) {
+                installationContext.setDescriptorExtension(desc);
             }
-            installationContext.setBinding(descriptor.isBindingComponent());
-            installationContext.setEngine(descriptor.isServiceEngine());
+            installationContext.setBinding(DescriptorFactory.isBindingComponent(descriptor));
+            installationContext.setEngine(DescriptorFactory.isServiceEngine(descriptor));
             // now we must initialize the boot strap class
             String bootstrapClassName=descriptor.getBootstrapClassName();
             ClassPath bootStrapClassPath=descriptor.getBootstrapClassPath();
             InstallationClassLoader bootstrapLoader=null;
-            if(bootstrapClassName!=null&&bootstrapClassName.length()>0){
-                boolean parentFirst=descriptor.isBootstrapClassLoaderDelegationParentFirst();
-                bootstrapLoader=classLoaderService.buildClassLoader(installationDir,bootStrapClassPath
-                                .getPathElements(),parentFirst);
+            if (bootstrapClassName != null && bootstrapClassName.length() > 0) {
+                boolean parentFirst = DescriptorFactory.isBCLParentFirst(descriptor);
+                bootstrapLoader = classLoaderService.buildClassLoader(
+                		installationDir, bootStrapClassPath.getPathElement(), parentFirst);
             }
-            SharedLibraryList[] lists=descriptor.getSharedLibraries();
-            String componentClassName=descriptor.getComponentClassName();
+            List<Component.SharedLibrary> lists = descriptor.getSharedLibraryList();
+            String componentClassName=descriptor.getComponentClassName().getContent();
             ClassPath componentClassPath=descriptor.getComponentClassPath();
-            boolean parentFirst=descriptor.isComponentClassLoaderDelegationParentFirst();
-            ClassLoader componentClassLoader=classLoaderService.buildClassLoader(installationDir,componentClassPath
-                            .getPathElements(),parentFirst,lists);
+            boolean parentFirst = DescriptorFactory.isCCLParentFirst(descriptor);
+            ClassLoader componentClassLoader=classLoaderService.buildClassLoader(
+            			installationDir, componentClassPath.getPathElement(), parentFirst, lists);
             result=new InstallerMBeanImpl(container,installationContext,componentClassLoader,componentClassName,
                             bootstrapLoader,bootstrapClassName, false);
             // create an MBean for the installer

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/Registry.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/Registry.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/Registry.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/Registry.java Tue May 23 07:13:08 2006
@@ -21,6 +21,8 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 import javax.jbi.JBIException;
 import javax.jbi.component.Component;
@@ -39,23 +41,20 @@
 import org.apache.servicemix.jbi.container.EnvironmentContext;
 import org.apache.servicemix.jbi.container.ServiceAssemblyEnvironment;
 import org.apache.servicemix.jbi.container.SubscriptionSpec;
-import org.apache.servicemix.jbi.deployment.ServiceAssembly;
-import org.apache.servicemix.jbi.deployment.ServiceUnit;
 import org.apache.servicemix.jbi.management.BaseSystemService;
 import org.apache.servicemix.jbi.messaging.MessageExchangeImpl;
 import org.apache.servicemix.jbi.servicedesc.AbstractServiceEndpoint;
 import org.apache.servicemix.jbi.servicedesc.DynamicEndpoint;
 import org.apache.servicemix.jbi.servicedesc.InternalEndpoint;
 import org.apache.servicemix.jbi.util.DOMUtil;
+import org.apache.servicemix.schemas.deployment.ServiceAssembly;
+import org.apache.servicemix.schemas.deployment.ServiceUnit;
 import org.w3c.dom.Document;
 import org.w3c.dom.DocumentFragment;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
-import edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArrayList;
-
 /**
  * Registry - state infomation including running state, SA's deployed etc.
  * 
@@ -68,7 +67,7 @@
     private EndpointRegistry endpointRegistry;
     private SubscriptionRegistry subscriptionRegistry;
     private ServiceAssemblyRegistry serviceAssemblyRegistry;
-    private Map serviceUnits;
+    private Map<String, ServiceUnitLifeCycle> serviceUnits;
     private List pendingAssemblies;
 
     /**
@@ -79,7 +78,7 @@
         this.endpointRegistry = new EndpointRegistry(this);
         this.subscriptionRegistry = new SubscriptionRegistry(this);
         this.serviceAssemblyRegistry = new ServiceAssemblyRegistry(this);
-        this.serviceUnits = new ConcurrentHashMap();
+        this.serviceUnits = new ConcurrentHashMap<String, ServiceUnitLifeCycle>();
         this.pendingAssemblies = new CopyOnWriteArrayList();
     }
     
@@ -437,7 +436,7 @@
      */
     public ObjectName[] getEngineComponents() {
         ObjectName[] result = null;
-        List tmpList = new ArrayList();
+        List<ObjectName> tmpList = new ArrayList<ObjectName>();
         for (Iterator i = getComponents().iterator(); i.hasNext();){
             ComponentMBeanImpl lcc = (ComponentMBeanImpl) i.next();
             if (!lcc.isPojo() && lcc.isService() && lcc.getMBeanName() != null){
@@ -456,7 +455,7 @@
      */
     public ObjectName[] getBindingComponents() {
         ObjectName[] result = null;
-        List tmpList = new ArrayList();
+        List<ObjectName> tmpList = new ArrayList<ObjectName>();
         for (Iterator i = getComponents().iterator(); i.hasNext();){
             ComponentMBeanImpl lcc = (ComponentMBeanImpl) i.next();
             if (!lcc.isPojo() && lcc.isBinding() && lcc.getMBeanName() != null){
@@ -474,7 +473,7 @@
      */
     public ObjectName[] getPojoComponents() {
         ObjectName[] result = null;
-        List tmpList = new ArrayList();
+        List<ObjectName> tmpList = new ArrayList<ObjectName>();
         for (Iterator i = getComponents().iterator(); i.hasNext();){
             ComponentMBeanImpl lcc = (ComponentMBeanImpl) i.next();
             if (lcc.isPojo() && lcc.getMBeanName() != null){
@@ -598,7 +597,7 @@
      */
     public ServiceUnitLifeCycle[] getDeployedServiceUnits(String componentName)  {
         Collection sus = serviceUnits.values();
-        List tmpList = new ArrayList();
+        List<ServiceUnitLifeCycle> tmpList = new ArrayList<ServiceUnitLifeCycle>();
         for (Iterator iter = sus.iterator(); iter.hasNext();) {
             ServiceUnitLifeCycle su = (ServiceUnitLifeCycle) iter.next();
             if (su.getComponentName().equals(componentName)) {

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceAssemblyLifeCycle.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceAssemblyLifeCycle.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceAssemblyLifeCycle.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceAssemblyLifeCycle.java Tue May 23 07:13:08 2006
@@ -38,17 +38,17 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.jbi.container.ServiceAssemblyEnvironment;
-import org.apache.servicemix.jbi.deployment.Connection;
-import org.apache.servicemix.jbi.deployment.Consumes;
-import org.apache.servicemix.jbi.deployment.DescriptorFactory;
-import org.apache.servicemix.jbi.deployment.ServiceAssembly;
-import org.apache.servicemix.jbi.deployment.Services;
 import org.apache.servicemix.jbi.event.ServiceAssemblyEvent;
 import org.apache.servicemix.jbi.event.ServiceAssemblyListener;
 import org.apache.servicemix.jbi.management.AttributeInfoHelper;
 import org.apache.servicemix.jbi.management.MBeanInfoProvider;
 import org.apache.servicemix.jbi.management.OperationInfoHelper;
 import org.apache.servicemix.jbi.util.XmlPersistenceSupport;
+import org.apache.servicemix.schemas.deployment.Connection;
+import org.apache.servicemix.schemas.deployment.Consumes;
+import org.apache.servicemix.schemas.deployment.DescriptorFactory;
+import org.apache.servicemix.schemas.deployment.ServiceAssembly;
+import org.apache.servicemix.schemas.deployment.Services;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
@@ -339,21 +339,21 @@
     
     protected void startConnections() throws JBIException {
         if (serviceAssembly.getConnections() == null ||
-            serviceAssembly.getConnections().getConnections() == null) {
+            serviceAssembly.getConnections().getConnection() == null) {
             return;
         }
-        Connection[] connections = serviceAssembly.getConnections().getConnections();
-        for (int i = 0; i < connections.length; i++) {
-            if (connections[i].getConsumer().getInterfaceName() != null) {
-                QName fromItf = connections[i].getConsumer().getInterfaceName();
-                QName toSvc = connections[i].getProvider().getServiceName();
-                String toEp = connections[i].getProvider().getEndpointName();
+        List<Connection> connections = serviceAssembly.getConnections().getConnection();
+        for (Connection connection : connections) {
+            if (connection.getConsumer().getInterfaceName() != null) {
+                QName fromItf = connection.getConsumer().getInterfaceName();
+                QName toSvc = connection.getProvider().getServiceName();
+                String toEp = connection.getProvider().getEndpointName();
                 registry.registerInterfaceConnection(fromItf, toSvc, toEp);
             } else {
-                QName fromSvc = connections[i].getConsumer().getServiceName();
-                String fromEp = connections[i].getConsumer().getEndpointName();
-                QName toSvc = connections[i].getProvider().getServiceName();
-                String toEp = connections[i].getProvider().getEndpointName();
+                QName fromSvc = connection.getConsumer().getServiceName();
+                String fromEp = connection.getConsumer().getEndpointName();
+                QName toSvc = connection.getProvider().getServiceName();
+                String toEp = connection.getProvider().getEndpointName();
                 String link = getLinkType(fromSvc, fromEp);
                 registry.registerEndpointConnection(fromSvc, fromEp, toSvc, toEp, link);
             }
@@ -364,11 +364,10 @@
         for (int i = 0; i < sus.length; i++) {
             Services s = sus[i].getServices();
             if (s != null && s.getConsumes() != null) {
-                Consumes[] consumes = s.getConsumes();
-                for (int j = 0; j < consumes.length; j++) {
-                    if (svc.equals(consumes[j].getServiceName()) &&
-                        ep.equals(consumes[j].getEndpointName())) {
-                        return consumes[j].getLinkType();
+                for (Consumes consumes : s.getConsumes()) {
+                    if (svc.equals(consumes.getServiceName()) &&
+                        ep.equals(consumes.getEndpointName())) {
+                        return consumes.getLinkType();
                     }
                 }
             }
@@ -378,17 +377,16 @@
     
     protected void stopConnections() {
         if (serviceAssembly.getConnections() == null ||
-            serviceAssembly.getConnections().getConnections() == null) {
+            serviceAssembly.getConnections().getConnection() == null) {
             return;
         }
-        Connection[] connections = serviceAssembly.getConnections().getConnections();
-        for (int i = 0; i < connections.length; i++) {
-            if (connections[i].getConsumer().getInterfaceName() != null) {
-                QName fromItf = connections[i].getConsumer().getInterfaceName();
+        for (Connection connection : serviceAssembly.getConnections().getConnection()) {
+            if (connection.getConsumer().getInterfaceName() != null) {
+                QName fromItf = connection.getConsumer().getInterfaceName();
                 registry.unregisterInterfaceConnection(fromItf);
             } else {
-                QName fromSvc = connections[i].getConsumer().getServiceName();
-                String fromEp = connections[i].getConsumer().getEndpointName();
+                QName fromSvc = connection.getConsumer().getServiceName();
+                String fromEp = connection.getConsumer().getEndpointName();
                 registry.unregisterEndpointConnection(fromSvc, fromEp);
             }
         }

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceAssemblyRegistry.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceAssemblyRegistry.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceAssemblyRegistry.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceAssemblyRegistry.java Tue May 23 07:13:08 2006
@@ -17,10 +17,10 @@
 
 import java.util.ArrayList;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.jbi.JBIException;
 import javax.jbi.management.DeploymentException;
@@ -30,10 +30,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.jbi.container.ServiceAssemblyEnvironment;
-import org.apache.servicemix.jbi.deployment.ServiceAssembly;
-import org.apache.servicemix.jbi.deployment.ServiceUnit;
-
-import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
+import org.apache.servicemix.schemas.deployment.ServiceAssembly;
+import org.apache.servicemix.schemas.deployment.ServiceUnit;
 
 /**
  * Registry for Components
@@ -43,7 +41,7 @@
 public class ServiceAssemblyRegistry {
     
     private static final Log log = LogFactory.getLog(ServiceAssemblyRegistry.class);
-    private Map serviceAssemblies = new ConcurrentHashMap();
+    private Map<String, ServiceAssemblyLifeCycle> serviceAssemblies = new ConcurrentHashMap<String, ServiceAssemblyLifeCycle>();
     private Registry registry;
 
     /**
@@ -78,11 +76,11 @@
         String saName = sa.getIdentification().getName();
         if (!serviceAssemblies.containsKey(saName)) {
             ServiceAssemblyLifeCycle salc = new ServiceAssemblyLifeCycle(sa, env, registry);
-            List sus = new ArrayList();
+            List<ServiceUnitLifeCycle> sus = new ArrayList<ServiceUnitLifeCycle>();
             for (int i = 0; i < suKeys.length; i++) {
                 sus.add(registry.getServiceUnit(suKeys[i]));
             }
-            salc.setServiceUnits((ServiceUnitLifeCycle[]) sus.toArray(new ServiceUnitLifeCycle[sus.size()]));
+            salc.setServiceUnits(sus.toArray(new ServiceUnitLifeCycle[sus.size()]));
             serviceAssemblies.put(saName, salc);
             try {
                 ObjectName objectName = registry.getContainer().getManagementContext().createObjectName(salc);
@@ -96,19 +94,19 @@
     }
     
     public ServiceAssemblyLifeCycle register(ServiceAssembly sa, ServiceAssemblyEnvironment env) throws DeploymentException {
-        List sus = new ArrayList();
-        if (sa.getServiceUnits() != null) {
-            for (int i = 0; i < sa.getServiceUnits().length; i++) {
+        List<String> sus = new ArrayList<String>();
+        if (sa.getServiceUnit() != null) {
+        	for (ServiceUnit su : sa.getServiceUnit()) {
                 String suKey = registry.registerServiceUnit(
-                                        sa.getServiceUnits()[i],
+                                        su,
                                         sa.getIdentification().getName(),
-                                        env.getServiceUnitDirectory(sa.getServiceUnits()[i].getTarget().getComponentName(),
-                                                                    sa.getServiceUnits()[i].getIdentification().getName()));
+                                        env.getServiceUnitDirectory(su.getTarget().getComponentName(),
+                                                                    su.getIdentification().getName()));
                 sus.add(suKey);
             }
         }
         return register(sa,
-                        (String[]) sus.toArray(new String[sus.size()]),
+                        sus.toArray(new String[sus.size()]),
                         env);
     }
     
@@ -162,15 +160,11 @@
    public String[] getDeployedServiceAssembliesForComponent(String componentName) {
        String[] result = null;
        // iterate through the service assembilies
-       Set tmpList = new HashSet();
-       for (Iterator iter = serviceAssemblies.values().iterator();iter.hasNext();) {
-           ServiceAssemblyLifeCycle salc = (ServiceAssemblyLifeCycle) iter.next();
-           ServiceUnit[] sus = salc.getServiceAssembly().getServiceUnits();
-           if (sus != null) {
-               for (int i = 0;i < sus.length;i++) {
-                   if (sus[i].getTarget().getComponentName().equals(componentName)) {
-                       tmpList.add(salc.getServiceAssembly().getIdentification().getName());
-                   }
+       Set<String> tmpList = new HashSet<String>();
+       for (ServiceAssemblyLifeCycle salc : serviceAssemblies.values()) {
+    	   for (ServiceUnit su : salc.getServiceAssembly().getServiceUnit()) {
+               if (su.getTarget().getComponentName().equals(componentName)) {
+                   tmpList.add(salc.getServiceAssembly().getIdentification().getName());
                }
            }
        }
@@ -186,20 +180,14 @@
     * @return list of component names.
     */
    public String[] getComponentsForDeployedServiceAssembly(String saName)  {
-       String[] result = null;
-       Set tmpList = new HashSet();
+       Set<String> tmpList = new HashSet<String>();
        ServiceAssemblyLifeCycle sa = getServiceAssembly(saName);
        if (sa != null) {
-           ServiceUnit[] sus = sa.getServiceAssembly().getServiceUnits();
-           if (sus != null) {
-               for (int i = 0;i < sus.length;i++) {
-                   tmpList.add(sus[i].getTarget().getComponentName());
-               }
+    	   for (ServiceUnit su : sa.getServiceAssembly().getServiceUnit()) {
+               tmpList.add(su.getTarget().getComponentName());
            }
        }
-       result = new String[tmpList.size()];
-       tmpList.toArray(result);
-       return result;
+       return tmpList.toArray(new String[tmpList.size()]);
    }
 
    /**
@@ -211,16 +199,12 @@
     */
    public boolean isDeployedServiceUnit(String componentName, String suName) {
        boolean result = false;
-       for (Iterator iter = serviceAssemblies.values().iterator();iter.hasNext();) {
-           ServiceAssemblyLifeCycle salc = (ServiceAssemblyLifeCycle) iter.next();
-           ServiceUnit[] sus = salc.getServiceAssembly().getServiceUnits();
-           if (sus != null) {
-               for (int i = 0;i < sus.length;i++) {
-                   if (sus[i].getTarget().getComponentName().equals(componentName)
-                           && sus[i].getIdentification().getName().equals(suName)) {
-                       result = true;
-                       break;
-                   }
+       for (ServiceAssemblyLifeCycle salc : serviceAssemblies.values()) {
+    	   for (ServiceUnit su : salc.getServiceAssembly().getServiceUnit()) {
+               if (su.getTarget().getComponentName().equals(componentName) &&
+                   su.getIdentification().getName().equals(suName)) {
+                   result = true;
+                   break;
                }
            }
        }

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceUnitLifeCycle.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceUnitLifeCycle.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceUnitLifeCycle.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ServiceUnitLifeCycle.java Tue May 23 07:13:08 2006
@@ -27,10 +27,10 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jbi.deployment.Descriptor;
-import org.apache.servicemix.jbi.deployment.DescriptorFactory;
-import org.apache.servicemix.jbi.deployment.ServiceUnit;
-import org.apache.servicemix.jbi.deployment.Services;
+import org.apache.servicemix.schemas.deployment.Descriptor;
+import org.apache.servicemix.schemas.deployment.DescriptorFactory;
+import org.apache.servicemix.schemas.deployment.ServiceUnit;
+import org.apache.servicemix.schemas.deployment.Services;
 import org.apache.servicemix.jbi.event.ServiceUnitEvent;
 import org.apache.servicemix.jbi.event.ServiceUnitListener;
 import org.apache.servicemix.jbi.management.AttributeInfoHelper;

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/loaders/ClassLoaderService.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/loaders/ClassLoaderService.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/loaders/ClassLoaderService.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/loaders/ClassLoaderService.java Tue May 23 07:13:08 2006
@@ -15,20 +15,21 @@
  */
 package org.apache.servicemix.jbi.loaders;
 
-import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jbi.deployment.ClassPath;
-import org.apache.servicemix.jbi.deployment.SharedLibrary;
-import org.apache.servicemix.jbi.deployment.SharedLibraryList;
-
-import javax.jbi.management.DeploymentException;
-
 import java.io.File;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.jbi.management.DeploymentException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.schemas.deployment.ClassPath;
+import org.apache.servicemix.schemas.deployment.Component;
+import org.apache.servicemix.schemas.deployment.Descriptor;
+import org.apache.servicemix.schemas.deployment.DescriptorFactory;
 
 /**
  * Build custom class loader
@@ -38,7 +39,7 @@
 public class ClassLoaderService {
 	private static final Log log = LogFactory.getLog(ClassLoaderService.class);
 
-	private Map sharedLibraryMap = new ConcurrentHashMap();
+	private Map<String, ClassLoader> sharedLibraryMap = new ConcurrentHashMap<String, ClassLoader>();
 
 	/**
 	 * Buld a Custom ClassLoader
@@ -52,7 +53,7 @@
 	 * @throws DeploymentException
 	 */
 	public InstallationClassLoader buildClassLoader(File dir,
-			String[] classPathNames, boolean parentFirst)
+			List<String> classPathNames, boolean parentFirst)
 			throws MalformedURLException, DeploymentException {
 		return buildClassLoader(dir, classPathNames, parentFirst, null);
 	}
@@ -70,17 +71,17 @@
 	 * @throws DeploymentException
 	 */
 	public InstallationClassLoader buildClassLoader(File dir,
-			String[] classPathNames, boolean parentFirst,
-			SharedLibraryList[] list) throws MalformedURLException,
+			List<String> classPathNames, boolean parentFirst,
+			List<Component.SharedLibrary> list) throws MalformedURLException,
 			DeploymentException {
 		InstallationClassLoader result = null;
 
 		// Make the current ClassLoader the parent
 		ClassLoader parent = getClass().getClassLoader();		
 		
-		URL[] urls = new URL[classPathNames.length];
-		for (int i = 0; i < classPathNames.length; i++) {
-			File file = new File(dir, classPathNames[i]);
+		URL[] urls = new URL[classPathNames.size()];
+		for (int i = 0; i < classPathNames.size(); i++) {
+			File file = new File(dir, classPathNames.get(i));
 			if (!file.exists()) {
 				throw new DeploymentException("Unable to add File " + file
 						+ " to class path as it doesn't exist: "
@@ -94,8 +95,8 @@
 			result = new SelfFirstClassLoader(urls, parent);
 		}
 		if (list != null) {
-			for (int i = 0; i < list.length; i++) {
-				String name = list[i].getName();
+			for (Component.SharedLibrary lib : list) {
+				String name = lib.getContent();
 				ClassLoader cl = (ClassLoader) sharedLibraryMap.get(name);
 				if (cl != null) {
 					result.addSharedLibraryLoader(cl);
@@ -114,20 +115,20 @@
 	 * @param sl
 	 * @throws MalformedURLException
 	 */
-    public void addSharedLibrary(File dir, SharedLibrary sl)
+    public void addSharedLibrary(File dir, Descriptor.SharedLibrary sl)
 			throws MalformedURLException {
 		if (sl != null) {
-			boolean parentFirst = sl.isParentFirstClassLoaderDelegation();
+			boolean parentFirst = DescriptorFactory.isSLParentFirst(sl);
 			String name = sl.getIdentification().getName();
 			
 			// Make the current ClassLoader the parent
 			ClassLoader parent = getClass().getClassLoader();		
 			
 			ClassPath cp = sl.getSharedLibraryClassPath();
-			String[] classPathNames = cp.getPathElements();
-			URL[] urls = new URL[classPathNames.length];
-			for (int i = 0; i < classPathNames.length; i++) {
-				File file = new File(dir, classPathNames[i]);
+			List<String> classPathNames = cp.getPathElement();
+			URL[] urls = new URL[classPathNames.size()];
+			for (int i = 0; i < classPathNames.size(); i++) {
+				File file = new File(dir, classPathNames.get(i));
 				urls[i] = file.toURL();
 			}
 			if (parentFirst) {

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlow.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlow.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlow.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlow.java Tue May 23 07:13:08 2006
@@ -18,6 +18,9 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.jbi.JBIException;
 import javax.jbi.messaging.MessageExchange;
@@ -58,10 +61,6 @@
 import org.apache.servicemix.jbi.nmr.flow.AbstractFlow;
 import org.apache.servicemix.jbi.servicedesc.EndpointSupport;
 import org.apache.servicemix.jbi.servicedesc.InternalEndpoint;
-
-import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
-import edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArraySet;
-import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * Use for message routing among a network of containers. All routing/registration happens automatically.

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/seda/SedaFlow.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/seda/SedaFlow.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/seda/SedaFlow.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/seda/SedaFlow.java Tue May 23 07:13:08 2006
@@ -17,6 +17,8 @@
 
 import java.util.Iterator;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.jbi.JBIException;
 import javax.jbi.management.LifeCycleMBean;
@@ -35,9 +37,6 @@
 import org.apache.servicemix.jbi.nmr.Broker;
 import org.apache.servicemix.jbi.nmr.flow.AbstractFlow;
 import org.apache.servicemix.jbi.servicedesc.AbstractServiceEndpoint;
-
-import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
-import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * The SedaFlow introduces a simple event staging between the internal processes 

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/seda/SedaQueue.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/seda/SedaQueue.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/seda/SedaQueue.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/seda/SedaQueue.java Tue May 23 07:13:08 2006
@@ -15,15 +15,7 @@
  */
 package org.apache.servicemix.jbi.nmr.flow.seda;
 
-import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jbi.framework.ComponentNameSpace;
-import org.apache.servicemix.jbi.management.AttributeInfoHelper;
-import org.apache.servicemix.jbi.management.BaseLifeCycle;
-import org.apache.servicemix.jbi.messaging.MessageExchangeImpl;
-import org.apache.servicemix.jbi.util.BoundedLinkedQueue;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.jbi.JBIException;
 import javax.jbi.messaging.MessageExchange;
@@ -32,6 +24,14 @@
 import javax.management.ObjectName;
 import javax.resource.spi.work.Work;
 import javax.resource.spi.work.WorkException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.jbi.framework.ComponentNameSpace;
+import org.apache.servicemix.jbi.management.AttributeInfoHelper;
+import org.apache.servicemix.jbi.management.BaseLifeCycle;
+import org.apache.servicemix.jbi.messaging.MessageExchangeImpl;
+import org.apache.servicemix.jbi.util.BoundedLinkedQueue;
 
 /**
  * A simple Straight through flow

Modified: incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/PropertiesLoginModule.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/PropertiesLoginModule.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/PropertiesLoginModule.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/PropertiesLoginModule.java Tue May 23 07:13:08 2006
@@ -17,6 +17,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.security.Principal;
 import java.util.Enumeration;
 import java.util.HashSet;
 import java.util.Map;
@@ -56,7 +57,7 @@
     private Properties users = new Properties();
     private Properties groups = new Properties();
     private String user;
-    private Set principals = new HashSet();
+    private Set<Principal> principals = new HashSet<Principal>();
     private File baseDir;
 
     public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) {

Modified: incubator/servicemix/branches/java5/servicemix-core/src/test/java/org/apache/servicemix/jbi/deployment/DeploymentTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/test/java/org/apache/servicemix/jbi/deployment/DeploymentTest.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/test/java/org/apache/servicemix/jbi/deployment/DeploymentTest.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/test/java/org/apache/servicemix/jbi/deployment/DeploymentTest.java Tue May 23 07:13:08 2006
@@ -15,36 +15,49 @@
  */
 package org.apache.servicemix.jbi.deployment;
 
-import org.apache.servicemix.jbi.config.DebugClassPathXmlApplicationContext;
-import org.apache.servicemix.jbi.config.spring.XBeanProcessor;
-import org.apache.servicemix.jbi.deployment.ClassPath;
-import org.apache.servicemix.jbi.deployment.Component;
-import org.apache.servicemix.jbi.deployment.Descriptor;
-import org.apache.servicemix.jbi.deployment.Identification;
-import org.apache.servicemix.jbi.deployment.InstallationDescriptorExtension;
-import org.apache.servicemix.jbi.deployment.SharedLibraryList;
-import org.apache.servicemix.jbi.jaxp.SourceTransformer;
-import org.springframework.context.support.AbstractXmlApplicationContext;
-import org.w3c.dom.DocumentFragment;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
 
 import javax.xml.transform.dom.DOMSource;
 
-import java.util.Arrays;
-
 import junit.framework.TestCase;
 
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.schemas.deployment.ClassPath;
+import org.apache.servicemix.schemas.deployment.Component;
+import org.apache.servicemix.schemas.deployment.Descriptor;
+import org.apache.servicemix.schemas.deployment.DescriptorFactory;
+import org.apache.servicemix.schemas.deployment.Identification;
+import org.apache.servicemix.schemas.deployment.Component.SharedLibrary;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Element;
+
 /**
  * @version $Revision$
  */
 public class DeploymentTest extends TestCase {
 
-    protected AbstractXmlApplicationContext context;
     protected SourceTransformer transformer = new SourceTransformer();
 
+    protected Descriptor root;
+    
+    protected ClassPath newClassPath(String[] jars) {
+    	ClassPath cp = new ClassPath();
+    	for (int i = 0; i < jars.length; i++) {
+        	cp.getPathElement().add(jars[i]);
+		}
+    	return cp;
+    }
+    
+    protected SharedLibrary newSharedLibrary(String name) {
+    	SharedLibrary sl = new SharedLibrary();
+    	sl.setContent(name);
+    	return sl;
+    }
+    
     public void testParse() throws Exception {
-
-        // lets force the JBI container to be constructed first
-        Descriptor root = (Descriptor) context.getBean("jbi");
         assertNotNull("JBI Container not found in spring!", root);
 
         // component stuff
@@ -52,22 +65,22 @@
         assertNotNull("component is null", component);
         assertEquals("getBootstrapClassName", "com.foo.Engine1Bootstrap", component.getBootstrapClassName());
         assertEquals("getComponentClassName", "com.foo.Engine1", component.getComponentClassName());
-        assertEquals("getComponentClassPath", new ClassPath(new String[] {"Engine1.jar"}), component.getComponentClassPath());
-        assertEquals("getBootstrapClassPath", new ClassPath(new String[] {"Engine2.jar"}), component.getBootstrapClassPath());
+        assertEquals("getComponentClassPath", newClassPath(new String[] {"Engine1.jar"}), component.getComponentClassPath());
+        assertEquals("getBootstrapClassPath", newClassPath(new String[] {"Engine2.jar"}), component.getBootstrapClassPath());
 
-        assertEquals("getDescription", "foo", component.getDescription());
+        assertEquals("getDescription", "foo", component.getIdentification().getDescription());
 
-        assertArrayEquals("getSharedLibraries", new SharedLibraryList[] {new SharedLibraryList("slib1")}, component.getSharedLibraries());
+        assertEquals("getSharedLibraries",  Collections.singletonList(newSharedLibrary("slib1")), component.getSharedLibraryList());
 
         Identification identification = component.getIdentification();
         assertNotNull("identification is null", identification);
         assertEquals("getName", "example-engine-1", identification.getName());
         assertEquals("getDescription", "An example service engine", identification.getDescription());
 
-        InstallationDescriptorExtension descriptorExtension = component.getDescriptorExtension();
+        List<Element> descriptorExtension = component.getAnyOrAny();
         assertNotNull("descriptorExtension is null", descriptorExtension);
 
-        DocumentFragment fragment = descriptorExtension.getDescriptorExtension();
+        DocumentFragment fragment = DescriptorFactory.getDescriptorExtension(component);
         assertNotNull("fragment is null", fragment);
 
         System.out.println("Created document fragment: " + fragment);
@@ -95,12 +108,11 @@
     }
 
     protected void setUp() throws Exception {
-        context = createBeanFactory();
+        root = DescriptorFactory.buildDescriptor(getDescriptorURL());
     }
 
-    protected AbstractXmlApplicationContext createBeanFactory() throws Exception {
-        return new DebugClassPathXmlApplicationContext("org/apache/servicemix/jbi/deployment/example.xml",
-                                                       Arrays.asList(new Object[] { new XBeanProcessor() }));
+    protected URL getDescriptorURL() throws Exception {
+        return getClass().getResource("example.xml");
     }
 
 }

Modified: incubator/servicemix/branches/java5/servicemix-core/src/test/java/org/apache/servicemix/jbi/deployment/ServiceAssemblyTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/test/java/org/apache/servicemix/jbi/deployment/ServiceAssemblyTest.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/test/java/org/apache/servicemix/jbi/deployment/ServiceAssemblyTest.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/test/java/org/apache/servicemix/jbi/deployment/ServiceAssemblyTest.java Tue May 23 07:13:08 2006
@@ -15,28 +15,23 @@
  */
 package org.apache.servicemix.jbi.deployment;
 
-import org.apache.servicemix.jbi.config.DebugClassPathXmlApplicationContext;
-import org.apache.servicemix.jbi.config.spring.XBeanProcessor;
-import org.apache.servicemix.jbi.deployment.Descriptor;
-import org.apache.servicemix.jbi.deployment.Identification;
-import org.apache.servicemix.jbi.deployment.ServiceAssembly;
-import org.apache.servicemix.jbi.deployment.ServiceUnit;
-import org.springframework.context.support.AbstractXmlApplicationContext;
-
-import java.util.Arrays;
+import java.net.URL;
+import java.util.List;
 
 import javax.xml.namespace.QName;
 
+import org.apache.servicemix.schemas.deployment.Connection;
+import org.apache.servicemix.schemas.deployment.Identification;
+import org.apache.servicemix.schemas.deployment.ServiceAssembly;
+import org.apache.servicemix.schemas.deployment.ServiceUnit;
+
 /**
  * @version $Revision$
  */
 public class ServiceAssemblyTest extends DeploymentTest {
 
     public void testParse() throws Exception {
-
-        // lets force the JBI container to be constructed first
-        Descriptor root = (Descriptor) context.getBean("jbi");
-        assertNotNull("JBI Container not found in spring!", root);
+        assertNotNull("JBI descriptor not found", root);
 
         ServiceAssembly serviceAssembly = root.getServiceAssembly();
         assertNotNull("serviceAssembly is null", serviceAssembly);
@@ -46,30 +41,29 @@
         assertEquals("getName", "ServiceAssembly_041207153211-0800_saId", identification.getName());
         assertEquals("getDescription", "Description of Service Assembly : ServiceAssembly", identification.getDescription());
 
-        ServiceUnit[] serviceUnits = serviceAssembly.getServiceUnits();
+        List<ServiceUnit> serviceUnits = serviceAssembly.getServiceUnit();
         assertNotNull("serviceUnits are null", serviceUnits);
-        assertEquals("serviceUnits size", 4, serviceUnits.length);
+        assertEquals("serviceUnits size", 4, serviceUnits.size());
 
-        assertEquals("getIdentification().getName() for 0", "TransformationSU_041207152821-0800_suId", serviceUnits[0].getIdentification().getName());
-        assertEquals("getIdentification().getDescription() for 0", "Description of Serviceunit: TransformationSU", serviceUnits[0].getIdentification().getDescription());
-        assertEquals("getTarget().getArtifactsZip() for 0", "TransformationSU.zip", serviceUnits[0].getTarget().getArtifactsZip());
-        assertEquals("getTarget().getComponentName() for 0", "SunTransformationEngine", serviceUnits[0].getTarget().getComponentName());
-
-        assertEquals("getIdentification().getName() for 3", "SequencingEngineSU_041207152507-0800_suId", serviceUnits[3].getIdentification().getName());
-        assertEquals("getIdentification().getDescription() for 3", "Description of Serviceunit: SequencingEngineSU", serviceUnits[3].getIdentification().getDescription());
-        assertEquals("getTarget().getArtifactsZip() for 3", "SequencingEngineSU.zip", serviceUnits[3].getTarget().getArtifactsZip());
-        assertEquals("getTarget().getComponentName() for 3", "SunSequencingEngine", serviceUnits[3].getTarget().getComponentName());
+        assertEquals("getIdentification().getName() for 0", "TransformationSU_041207152821-0800_suId", serviceUnits.get(0).getIdentification().getName());
+        assertEquals("getIdentification().getDescription() for 0", "Description of Serviceunit: TransformationSU", serviceUnits.get(0).getIdentification().getDescription());
+        assertEquals("getTarget().getArtifactsZip() for 0", "TransformationSU.zip", serviceUnits.get(0).getTarget().getArtifactsZip());
+        assertEquals("getTarget().getComponentName() for 0", "SunTransformationEngine", serviceUnits.get(0).getTarget().getComponentName());
+
+        assertEquals("getIdentification().getName() for 3", "SequencingEngineSU_041207152507-0800_suId", serviceUnits.get(3).getIdentification().getName());
+        assertEquals("getIdentification().getDescription() for 3", "Description of Serviceunit: SequencingEngineSU", serviceUnits.get(3).getIdentification().getDescription());
+        assertEquals("getTarget().getArtifactsZip() for 3", "SequencingEngineSU.zip", serviceUnits.get(3).getTarget().getArtifactsZip());
+        assertEquals("getTarget().getComponentName() for 3", "SunSequencingEngine", serviceUnits.get(3).getTarget().getComponentName());
         
-        Connection[] connections = serviceAssembly.getConnections().getConnections();
+        List<Connection> connections = serviceAssembly.getConnections().getConnection();
         assertNotNull("connections are null", connections);
-        assertEquals("connections size", 2, connections.length);
+        assertEquals("connections size", 2, connections.size());
         
-        assertEquals("getConsumer().getServiceName() for 0", new QName("http://www.gaiati.com/emee/ns/csi", "csi-service"), connections[0].getConsumer().getServiceName());
+        assertEquals("getConsumer().getServiceName() for 0", new QName("http://www.gaiati.com/emee/ns/csi", "csi-service"), connections.get(0).getConsumer().getServiceName());
     }
 
-    protected AbstractXmlApplicationContext createBeanFactory() throws Exception {
-        return new DebugClassPathXmlApplicationContext("org/apache/servicemix/jbi/deployment/serviceAssembly.xml",
-                                                       Arrays.asList(new Object[] { new XBeanProcessor() }));
+    protected URL getDescriptorURL() throws Exception {
+        return getClass().getResource("serviceAssembly.xml");
     }
 
 }

Modified: incubator/servicemix/branches/java5/servicemix-core/src/test/java/org/apache/servicemix/jbi/deployment/SharedLibraryTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-core/src/test/java/org/apache/servicemix/jbi/deployment/SharedLibraryTest.java?rev=408901&r1=408900&r2=408901&view=diff
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-core/src/test/java/org/apache/servicemix/jbi/deployment/SharedLibraryTest.java (original)
+++ incubator/servicemix/branches/java5/servicemix-core/src/test/java/org/apache/servicemix/jbi/deployment/SharedLibraryTest.java Tue May 23 07:13:08 2006
@@ -15,31 +15,23 @@
  */
 package org.apache.servicemix.jbi.deployment;
 
-import org.apache.servicemix.jbi.config.DebugClassPathXmlApplicationContext;
-import org.apache.servicemix.jbi.config.spring.XBeanProcessor;
-import org.apache.servicemix.jbi.deployment.Descriptor;
-import org.apache.servicemix.jbi.deployment.Identification;
-import org.apache.servicemix.jbi.deployment.SharedLibrary;
-import org.apache.servicemix.jbi.jaxp.SourceTransformer;
-import org.springframework.context.support.AbstractXmlApplicationContext;
-
-import java.util.Arrays;
+import java.net.URL;
 
-import junit.framework.TestCase;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.schemas.deployment.Identification;
+import org.apache.servicemix.schemas.deployment.Descriptor.SharedLibrary;
 
 /**
  * @version $Revision$
  */
-public class SharedLibraryTest extends TestCase {
+public class SharedLibraryTest extends DeploymentTest {
 
-    protected AbstractXmlApplicationContext context;
     protected SourceTransformer transformer = new SourceTransformer();
 
     public void testParse() throws Exception {
 
         // lets force the JBI container to be constructed first
-        Descriptor root = (Descriptor) context.getBeansOfType(Descriptor.class).values().iterator().next();
-        assertNotNull("JBI Container not found in spring!", root);
+        assertNotNull("JBI descriptor not found", root);
 
         SharedLibrary sl = root.getSharedLibrary();
         Identification identification = sl.getIdentification();
@@ -64,13 +56,8 @@
         return buffer.toString();
     }
 
-    protected void setUp() throws Exception {
-        context = createBeanFactory();
-    }
-
-    protected AbstractXmlApplicationContext createBeanFactory() throws Exception {
-        return new DebugClassPathXmlApplicationContext("org/apache/servicemix/jbi/deployment/SharedLibrary.xml",
-                                                       Arrays.asList(new Object[] { new XBeanProcessor() }));
+    protected URL getDescriptorURL() throws Exception {
+        return getClass().getResource("SharedLibrary.xml");
     }
 
 }

Propchange: incubator/servicemix/branches/java5/servicemix-schemas/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue May 23 07:13:08 2006
@@ -0,0 +1,4 @@
+.settings
+target
+.classpath
+.project