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 2007/08/09 22:33:52 UTC

svn commit: r564374 [4/7] - in /incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix: ./ client/ components/util/ components/util/xstream/ components/varscheduler/ expression/ jbi/ jbi/container/ jbi/deployment/ jbi/event...

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/DescriptorFactory.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/DescriptorFactory.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/DescriptorFactory.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/DescriptorFactory.java Thu Aug  9 13:33:26 2007
@@ -34,31 +34,36 @@
 import javax.xml.validation.SchemaFactory;
 import javax.xml.validation.Validator;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jbi.util.DOMUtil;
-import org.apache.servicemix.jbi.util.FileUtil;
 import org.w3c.dom.Document;
 import org.w3c.dom.DocumentFragment;
 import org.w3c.dom.Element;
+
 import org.xml.sax.ErrorHandler;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.jbi.util.DOMUtil;
+import org.apache.servicemix.jbi.util.FileUtil;
+
 /**
  * @version $Revision: 359151 $
  */
-public class DescriptorFactory {
+public final class DescriptorFactory {
+
+    public static final String DESCRIPTOR_FILE = "META-INF/jbi.xml";
 
     /**
      * JAXP attribute value indicating the XSD schema language.
      */
     private static final String XSD_SCHEMA_LANGUAGE = "http://www.w3.org/2001/XMLSchema";
 
-    public static final String DESCRIPTOR_FILE = "META-INF/jbi.xml";
-
-    private static Log log = LogFactory.getLog(DescriptorFactory.class);
+    private static final Log LOG = LogFactory.getLog(DescriptorFactory.class);
 
+    private DescriptorFactory() {
+    }
+    
     /**
      * Build a jbi descriptor from a file archive
      * 
@@ -98,10 +103,10 @@
             Validator validator = schema.newValidator();
             validator.setErrorHandler(new ErrorHandler() {
                 public void warning(SAXParseException exception) throws SAXException {
-                    log.debug("Validation warning on " + url + ": " + exception);
+                    LOG.debug("Validation warning on " + url + ": " + exception);
                 }
                 public void error(SAXParseException exception) throws SAXException {
-                    log.info("Validation error on " + url + ": " + exception);
+                    LOG.info("Validation error on " + url + ": " + exception);
                 }
                 public void fatalError(SAXParseException exception) throws SAXException {
                     throw exception;
@@ -118,162 +123,182 @@
             desc.setVersion(Double.parseDouble(getAttribute(jbi, "version")));
             Element child = DOMUtil.getFirstChildElement(jbi);
             if ("component".equals(child.getLocalName())) {
-                Component component = new Component();
-                component.setType(child.getAttribute("type"));
-                component.setComponentClassLoaderDelegation(getAttribute(child, "component-class-loader-delegation"));
-                component.setBootstrapClassLoaderDelegation(getAttribute(child, "bootstrap-class-loader-delegation"));
-                ArrayList sls = new ArrayList();
-                DocumentFragment ext = null;
-                for (Element e = DOMUtil.getFirstChildElement(child); e != null; e = DOMUtil.getNextSiblingElement(e)) {
-                    if ("identification".equals(e.getLocalName())) {
-                        component.setIdentification(readIdentification(e));
-                    } else if ("component-class-name".equals(e.getLocalName())) {
-                        component.setComponentClassName(getText(e));
-                        component.setDescription(getAttribute(e, "description"));
-                    } else if ("component-class-path".equals(e.getLocalName())) {
-                        ClassPath componentClassPath = new ClassPath();
-                        ArrayList l = new ArrayList();
-                        for (Element e2 = DOMUtil.getFirstChildElement(e); e2 != null; e2 = DOMUtil.getNextSiblingElement(e2)) {
-                            if ("path-element".equals(e2.getLocalName())) {
-                                l.add(getText(e2));
-                            }
-                        }
-                        componentClassPath.setPathList(l);
-                        component.setComponentClassPath(componentClassPath);
-                    } else if ("bootstrap-class-name".equals(e.getLocalName())) {
-                        component.setBootstrapClassName(getText(e));
-                    } else if ("bootstrap-class-path".equals(e.getLocalName())) {
-                        ClassPath bootstrapClassPath = new ClassPath();
-                        ArrayList l = new ArrayList();
-                        for (Element e2 = DOMUtil.getFirstChildElement(e); e2 != null; e2 = DOMUtil.getNextSiblingElement(e2)) {
-                            if ("path-element".equals(e2.getLocalName())) {
-                                l.add(getText(e2));
-                            }
-                        }
-                        bootstrapClassPath.setPathList(l);
-                        component.setBootstrapClassPath(bootstrapClassPath);
-                    } else if ("shared-library".equals(e.getLocalName())) {
-                        SharedLibraryList sl = new SharedLibraryList();
-                        sl.setName(getText(e));
-                        sl.setVersion(getAttribute(e, "version"));
-                        sls.add(sl);
-                    } else {
-                        if (ext == null) {
-                            ext = doc.createDocumentFragment();
-                        }
-                        ext.appendChild(e);
-                    }
-                }
-                component.setSharedLibraries((SharedLibraryList[]) sls.toArray(new SharedLibraryList[sls.size()]));
-                if (ext != null) {
-                    InstallationDescriptorExtension descriptorExtension = new InstallationDescriptorExtension();
-                    descriptorExtension.setDescriptorExtension(ext);
-                    component.setDescriptorExtension(descriptorExtension);
-                }
+                Component component = parseComponent(child);
                 desc.setComponent(component);
             } else if ("shared-library".equals(child.getLocalName())) {
-                SharedLibrary sharedLibrary = new SharedLibrary();
-                sharedLibrary.setClassLoaderDelegation(getAttribute(child, "class-loader-delegation"));
-                sharedLibrary.setVersion(getAttribute(child, "version"));
-                for (Element e = DOMUtil.getFirstChildElement(child); e != null; e = DOMUtil.getNextSiblingElement(e)) {
-                    if ("identification".equals(e.getLocalName())) {
-                        sharedLibrary.setIdentification(readIdentification(e));
-                    } else if ("shared-library-class-path".equals(e.getLocalName())) {
-                        ClassPath sharedLibraryClassPath = new ClassPath();
-                        ArrayList l = new ArrayList();
-                        for (Element e2 = DOMUtil.getFirstChildElement(e); e2 != null; e2 = DOMUtil.getNextSiblingElement(e2)) {
-                            if ("path-element".equals(e2.getLocalName())) {
-                                l.add(getText(e2));
-                            }
-                        }
-                        sharedLibraryClassPath.setPathList(l);
-                        sharedLibrary.setSharedLibraryClassPath(sharedLibraryClassPath);
-                    }
-                }
+                SharedLibrary sharedLibrary = parseSharedLibrary(child);
                 desc.setSharedLibrary(sharedLibrary);
             } else if ("service-assembly".equals(child.getLocalName())) {
-                ServiceAssembly serviceAssembly = new ServiceAssembly();
-                ArrayList sus = new ArrayList();
-                for (Element e = DOMUtil.getFirstChildElement(child); e != null; e = DOMUtil.getNextSiblingElement(e)) {
-                    if ("identification".equals(e.getLocalName())) {
-                        serviceAssembly.setIdentification(readIdentification(e));
-                    } else if ("service-unit".equals(e.getLocalName())) {
-                        ServiceUnit su = new ServiceUnit();
-                        for (Element e2 = DOMUtil.getFirstChildElement(e); e2 != null; e2 = DOMUtil.getNextSiblingElement(e2)) {
-                            if ("identification".equals(e2.getLocalName())) {
-                                su.setIdentification(readIdentification(e2));
-                            } else if ("target".equals(e2.getLocalName())) {
-                                Target target = new Target();
-                                for (Element e3 = DOMUtil.getFirstChildElement(e2); e3 != null; e3 = DOMUtil.getNextSiblingElement(e3)) {
-                                    if ("artifacts-zip".equals(e3.getLocalName())) {
-                                        target.setArtifactsZip(getText(e3));
-                                    } else if ("component-name".equals(e3.getLocalName())) {
-                                        target.setComponentName(getText(e3));
-                                    }
-                                }
-                                su.setTarget(target);
+                ServiceAssembly serviceAssembly = parseServiceAssembly(child);
+                desc.setServiceAssembly(serviceAssembly);
+            } else if ("services".equals(child.getLocalName())) {
+                Services services = parseServiceUnit(child);
+                desc.setServices(services);
+            }
+            checkDescriptor(desc);
+            return desc;
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    private static Services parseServiceUnit(Element child) {
+        Services services = new Services();
+        services.setBindingComponent(Boolean.valueOf(getAttribute(child, "binding-component")).booleanValue());
+        List<Provides> provides = new ArrayList<Provides>();
+        List<Consumes> consumes = new ArrayList<Consumes>();
+        for (Element e = DOMUtil.getFirstChildElement(child); e != null; e = DOMUtil.getNextSiblingElement(e)) {
+            if ("provides".equals(e.getLocalName())) {
+                Provides p = new Provides();
+                p.setInterfaceName(readAttributeQName(e, "interface-name"));
+                p.setServiceName(readAttributeQName(e, "service-name"));
+                p.setEndpointName(getAttribute(e, "endpoint-name"));
+                provides.add(p);
+            } else if ("consumes".equals(e.getLocalName())) {
+                Consumes c = new Consumes();
+                c.setInterfaceName(readAttributeQName(e, "interface-name"));
+                c.setServiceName(readAttributeQName(e, "service-name"));
+                c.setEndpointName(getAttribute(e, "endpoint-name"));
+                c.setLinkType(getAttribute(e, "link-type"));
+                consumes.add(c);
+            }
+        }
+        services.setProvides(provides.toArray(new Provides[provides.size()]));
+        services.setConsumes(consumes.toArray(new Consumes[consumes.size()]));
+        return services;
+    }
+
+    private static ServiceAssembly parseServiceAssembly(Element child) {
+        ServiceAssembly serviceAssembly = new ServiceAssembly();
+        List<ServiceUnit> sus = new ArrayList<ServiceUnit>();
+        for (Element e = DOMUtil.getFirstChildElement(child); e != null; e = DOMUtil.getNextSiblingElement(e)) {
+            if ("identification".equals(e.getLocalName())) {
+                serviceAssembly.setIdentification(readIdentification(e));
+            } else if ("service-unit".equals(e.getLocalName())) {
+                ServiceUnit su = new ServiceUnit();
+                for (Element e2 = DOMUtil.getFirstChildElement(e); e2 != null; e2 = DOMUtil.getNextSiblingElement(e2)) {
+                    if ("identification".equals(e2.getLocalName())) {
+                        su.setIdentification(readIdentification(e2));
+                    } else if ("target".equals(e2.getLocalName())) {
+                        Target target = new Target();
+                        for (Element e3 = DOMUtil.getFirstChildElement(e2); e3 != null; e3 = DOMUtil.getNextSiblingElement(e3)) {
+                            if ("artifacts-zip".equals(e3.getLocalName())) {
+                                target.setArtifactsZip(getText(e3));
+                            } else if ("component-name".equals(e3.getLocalName())) {
+                                target.setComponentName(getText(e3));
                             }
                         }
-                        sus.add(su);
-                    } else if ("connections".equals(e.getLocalName())) {
-                        Connections connections = new Connections();
-                        ArrayList cns = new ArrayList();
-                        for (Element e2 = DOMUtil.getFirstChildElement(e); e2 != null; e2 = DOMUtil.getNextSiblingElement(e2)) {
-                            if ("connection".equals(e2.getLocalName())) {
-                                Connection cn = new Connection();
-                                for (Element e3 = DOMUtil.getFirstChildElement(e2); e3 != null; e3 = DOMUtil.getNextSiblingElement(e3)) {
-                                    if ("consumer".equals(e3.getLocalName())) {
-                                        Consumer consumer = new Consumer();
-                                        consumer.setInterfaceName(readAttributeQName(e3, "interface-name"));
-                                        consumer.setServiceName(readAttributeQName(e3, "service-name"));
-                                        consumer.setEndpointName(getAttribute(e3, "endpoint-name"));
-                                        cn.setConsumer(consumer);
-                                    } else if ("provider".equals(e3.getLocalName())) {
-                                        Provider provider = new Provider();
-                                        provider.setServiceName(readAttributeQName(e3, "service-name"));
-                                        provider.setEndpointName(getAttribute(e3, "endpoint-name"));
-                                        cn.setProvider(provider);
-                                    }
-                                }
-                                cns.add(cn);
+                        su.setTarget(target);
+                    }
+                }
+                sus.add(su);
+            } else if ("connections".equals(e.getLocalName())) {
+                Connections connections = new Connections();
+                List<Connection> cns = new ArrayList<Connection>();
+                for (Element e2 = DOMUtil.getFirstChildElement(e); e2 != null; e2 = DOMUtil.getNextSiblingElement(e2)) {
+                    if ("connection".equals(e2.getLocalName())) {
+                        Connection cn = new Connection();
+                        for (Element e3 = DOMUtil.getFirstChildElement(e2); e3 != null; e3 = DOMUtil.getNextSiblingElement(e3)) {
+                            if ("consumer".equals(e3.getLocalName())) {
+                                Consumer consumer = new Consumer();
+                                consumer.setInterfaceName(readAttributeQName(e3, "interface-name"));
+                                consumer.setServiceName(readAttributeQName(e3, "service-name"));
+                                consumer.setEndpointName(getAttribute(e3, "endpoint-name"));
+                                cn.setConsumer(consumer);
+                            } else if ("provider".equals(e3.getLocalName())) {
+                                Provider provider = new Provider();
+                                provider.setServiceName(readAttributeQName(e3, "service-name"));
+                                provider.setEndpointName(getAttribute(e3, "endpoint-name"));
+                                cn.setProvider(provider);
                             }
                         }
-                        connections.setConnections(((Connection[]) cns.toArray(new Connection[cns.size()])));
-                        serviceAssembly.setConnections(connections);
+                        cns.add(cn);
                     }
                 }
-                serviceAssembly.setServiceUnits(((ServiceUnit[]) sus.toArray(new ServiceUnit[sus.size()])));
-                desc.setServiceAssembly(serviceAssembly);
-            } else if ("services".equals(child.getLocalName())) {
-                Services services = new Services();
-                services.setBindingComponent(Boolean.valueOf(getAttribute(child, "binding-component")).booleanValue());
-                ArrayList provides = new ArrayList();
-                ArrayList consumes = new ArrayList();
-                for (Element e = DOMUtil.getFirstChildElement(child); e != null; e = DOMUtil.getNextSiblingElement(e)) {
-                    if ("provides".equals(e.getLocalName())) {
-                        Provides p = new Provides();
-                        p.setInterfaceName(readAttributeQName(e, "interface-name"));
-                        p.setServiceName(readAttributeQName(e, "service-name"));
-                        p.setEndpointName(getAttribute(e, "endpoint-name"));
-                        provides.add(p);
-                    } else if ("consumes".equals(e.getLocalName())) {
-                        Consumes c = new Consumes();
-                        c.setInterfaceName(readAttributeQName(e, "interface-name"));
-                        c.setServiceName(readAttributeQName(e, "service-name"));
-                        c.setEndpointName(getAttribute(e, "endpoint-name"));
-                        c.setLinkType(getAttribute(e, "link-type"));
-                        consumes.add(c);
+                connections.setConnections(cns.toArray(new Connection[cns.size()]));
+                serviceAssembly.setConnections(connections);
+            }
+        }
+        serviceAssembly.setServiceUnits(sus.toArray(new ServiceUnit[sus.size()]));
+        return serviceAssembly;
+    }
+
+    private static SharedLibrary parseSharedLibrary(Element child) {
+        SharedLibrary sharedLibrary = new SharedLibrary();
+        sharedLibrary.setClassLoaderDelegation(getAttribute(child, "class-loader-delegation"));
+        sharedLibrary.setVersion(getAttribute(child, "version"));
+        for (Element e = DOMUtil.getFirstChildElement(child); e != null; e = DOMUtil.getNextSiblingElement(e)) {
+            if ("identification".equals(e.getLocalName())) {
+                sharedLibrary.setIdentification(readIdentification(e));
+            } else if ("shared-library-class-path".equals(e.getLocalName())) {
+                ClassPath sharedLibraryClassPath = new ClassPath();
+                List<String> l = new ArrayList<String>();
+                for (Element e2 = DOMUtil.getFirstChildElement(e); e2 != null; e2 = DOMUtil.getNextSiblingElement(e2)) {
+                    if ("path-element".equals(e2.getLocalName())) {
+                        l.add(getText(e2));
                     }
                 }
-                services.setProvides((Provides[]) provides.toArray(new Provides[provides.size()]));
-                services.setConsumes((Consumes[]) consumes.toArray(new Consumes[consumes.size()]));
-                desc.setServices(services);
+                sharedLibraryClassPath.setPathList(l);
+                sharedLibrary.setSharedLibraryClassPath(sharedLibraryClassPath);
             }
-            checkDescriptor(desc);
-            return desc;
-        } catch (Exception e) {
-            throw new RuntimeException(e);
         }
+        return sharedLibrary;
+    }
+
+    private static Component parseComponent(Element child) {
+        Component component = new Component();
+        component.setType(child.getAttribute("type"));
+        component.setComponentClassLoaderDelegation(getAttribute(child, "component-class-loader-delegation"));
+        component.setBootstrapClassLoaderDelegation(getAttribute(child, "bootstrap-class-loader-delegation"));
+        List<SharedLibraryList> sls = new ArrayList<SharedLibraryList>();
+        DocumentFragment ext = null;
+        for (Element e = DOMUtil.getFirstChildElement(child); e != null; e = DOMUtil.getNextSiblingElement(e)) {
+            if ("identification".equals(e.getLocalName())) {
+                component.setIdentification(readIdentification(e));
+            } else if ("component-class-name".equals(e.getLocalName())) {
+                component.setComponentClassName(getText(e));
+                component.setDescription(getAttribute(e, "description"));
+            } else if ("component-class-path".equals(e.getLocalName())) {
+                ClassPath componentClassPath = new ClassPath();
+                List<String> l = new ArrayList<String>();
+                for (Element e2 = DOMUtil.getFirstChildElement(e); e2 != null; e2 = DOMUtil.getNextSiblingElement(e2)) {
+                    if ("path-element".equals(e2.getLocalName())) {
+                        l.add(getText(e2));
+                    }
+                }
+                componentClassPath.setPathList(l);
+                component.setComponentClassPath(componentClassPath);
+            } else if ("bootstrap-class-name".equals(e.getLocalName())) {
+                component.setBootstrapClassName(getText(e));
+            } else if ("bootstrap-class-path".equals(e.getLocalName())) {
+                ClassPath bootstrapClassPath = new ClassPath();
+                List<String> l = new ArrayList<String>();
+                for (Element e2 = DOMUtil.getFirstChildElement(e); e2 != null; e2 = DOMUtil.getNextSiblingElement(e2)) {
+                    if ("path-element".equals(e2.getLocalName())) {
+                        l.add(getText(e2));
+                    }
+                }
+                bootstrapClassPath.setPathList(l);
+                component.setBootstrapClassPath(bootstrapClassPath);
+            } else if ("shared-library".equals(e.getLocalName())) {
+                SharedLibraryList sl = new SharedLibraryList();
+                sl.setName(getText(e));
+                sl.setVersion(getAttribute(e, "version"));
+                sls.add(sl);
+            } else {
+                if (ext == null) {
+                    ext = child.getOwnerDocument().createDocumentFragment();
+                }
+                ext.appendChild(e);
+            }
+        }
+        component.setSharedLibraries(sls.toArray(new SharedLibraryList[sls.size()]));
+        if (ext != null) {
+            InstallationDescriptorExtension descriptorExtension = new InstallationDescriptorExtension();
+            descriptorExtension.setDescriptorExtension(ext);
+            component.setDescriptorExtension(descriptorExtension);
+        }
+        return component;
     }
     
     private static String getAttribute(Element e, String name) {
@@ -318,7 +343,7 @@
      *             if the descriptor is not valid
      */
     public static void checkDescriptor(Descriptor descriptor) {
-        List violations = new ArrayList();
+        List<String> violations = new ArrayList<String>();
 
         if (descriptor.getVersion() != 1.0) {
             violations.add("JBI descriptor version should be set to '1.0' but is " + descriptor.getVersion());
@@ -351,7 +376,7 @@
      * @param component
      *            The component descriptor that is being checked
      */
-    private static void checkComponent(List violations, Component component) {
+    private static void checkComponent(List<String> violations, Component component) {
         if (component.getIdentification() == null) {
             violations.add("The component has not identification");
         } else {
@@ -376,12 +401,12 @@
      * @param serviceAssembly
      *            The service assembly descriptor that is being checked
      */
-    private static void checkServiceAssembly(List violations, ServiceAssembly serviceAssembly) {
+    private static void checkServiceAssembly(List<String> violations, ServiceAssembly serviceAssembly) {
         if (serviceAssembly.getIdentification() == null) {
             violations.add("The service assembly has not identification");
         } else {
             if (isBlank(serviceAssembly.getIdentification().getName())) {
-               violations.add("The service assembly name is not set"); 
+                violations.add("The service assembly name is not set"); 
             }
         }
     }
@@ -395,7 +420,7 @@
      * @param services
      *            The service unit descriptor that is being checked
      */
-    private static void checkServiceUnit(List violations, Services services) {
+    private static void checkServiceUnit(List<String> violations, Services services) {
         // TODO Auto-generated method stub
         
     }
@@ -409,12 +434,12 @@
      * @param sharedLibrary
      *            The shared library descriptor that is being checked
      */
-    private static void checkSharedLibrary(List violations, SharedLibrary sharedLibrary) {
+    private static void checkSharedLibrary(List<String> violations, SharedLibrary sharedLibrary) {
         if (sharedLibrary.getIdentification() == null) {
             violations.add("The shared library has not identification");
         } else {
             if (isBlank(sharedLibrary.getIdentification().getName())) {
-               violations.add("The shared library name is not set"); 
+                violations.add("The shared library name is not set"); 
             }
         }
     }
@@ -437,7 +462,7 @@
                 FileUtil.copyInputStream(is, os);
                 return os.toString();
             } catch (Exception e) {
-                log.debug("Error reading jbi descritor: " + descriptorFile, e);
+                LOG.debug("Error reading jbi descritor: " + descriptorFile, e);
             }
         }
         return null;
@@ -460,12 +485,15 @@
      * Copied from org.apache.commons.lang.StringUtils#isBlanck
      */
     private static boolean isBlank(String str) {
-        int strLen;
-        if (str == null || (strLen = str.length()) == 0) {
+        if (str == null) {
+            return true;
+        }
+        int strLen = str.length();
+        if (strLen == 0) {
             return true;
         }
         for (int i = 0; i < strLen; i++) {
-            if ((Character.isWhitespace(str.charAt(i)) == false)) {
+            if (!(Character.isWhitespace(str.charAt(i)))) {
                 return false;
             }
         }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/Provides.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/Provides.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/Provides.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/Provides.java Thu Aug  9 13:33:26 2007
@@ -22,19 +22,20 @@
  * @version $Revision$
  */
 public class Provides {
+    
     private QName serviceName;
     private String endpointName;
     private QName interfaceName;
 
     public QName getInterfaceName() {
-		return interfaceName;
-	}
+        return interfaceName;
+    }
 
-	public void setInterfaceName(QName interfaceName) {
-		this.interfaceName = interfaceName;
-	}
+    public void setInterfaceName(QName interfaceName) {
+        this.interfaceName = interfaceName;
+    }
 
-	public QName getServiceName() {
+    public QName getServiceName() {
         return serviceName;
     }
 

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/ServiceAssembly.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/ServiceAssembly.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/ServiceAssembly.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/ServiceAssembly.java Thu Aug  9 13:33:26 2007
@@ -19,52 +19,49 @@
 /**
  * @version $Revision$
  */
-public class ServiceAssembly {	
+public class ServiceAssembly {
 
-	private Connections connections = new Connections();
-
-	private Identification identification;
-
-	private ServiceUnit[] serviceUnits;
-	
-	private String state = "";
-
-	public Connections getConnections() {
-		return connections;
-	}
-
-	public Identification getIdentification() {
-		return identification;
-	}
-
-	public ServiceUnit[] getServiceUnits() {
-		return serviceUnits;
-	}
-
-	/**
-	 * @return Returns the state.
-	 */
-	public String getState() {
-		return state;
-	}
-
-	public void setConnections(Connections connections) {
-		this.connections = connections;
-	}
-
-	public void setIdentification(Identification identification) {
-		this.identification = identification;
-	}
-
-	public void setServiceUnits(ServiceUnit[] serviceUnits) {
-		this.serviceUnits = serviceUnits;
-	}
-
-	/**
-	 * @param state
-	 *            The state to set.
-	 */
-	public void setState(String state) {
-		this.state = state;
-	}
+    private Connections connections = new Connections();
+    private Identification identification;
+    private ServiceUnit[] serviceUnits;
+    private String state = "";
+
+    public Connections getConnections() {
+        return connections;
+    }
+
+    public Identification getIdentification() {
+        return identification;
+    }
+
+    public ServiceUnit[] getServiceUnits() {
+        return serviceUnits;
+    }
+
+    /**
+     * @return Returns the state.
+     */
+    public String getState() {
+        return state;
+    }
+
+    public void setConnections(Connections connections) {
+        this.connections = connections;
+    }
+
+    public void setIdentification(Identification identification) {
+        this.identification = identification;
+    }
+
+    public void setServiceUnits(ServiceUnit[] serviceUnits) {
+        this.serviceUnits = serviceUnits;
+    }
+
+    /**
+     * @param state
+     *            The state to set.
+     */
+    public void setState(String state) {
+        this.state = state;
+    }
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/SharedLibraryList.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/SharedLibraryList.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/SharedLibraryList.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/deployment/SharedLibraryList.java Thu Aug  9 13:33:26 2007
@@ -68,8 +68,8 @@
 
     public int hashCode() {
         int result;
-        result = (version != null ? version.hashCode() : 0);
-        result = 29 * result + (name != null ? name.hashCode() : 0);
+        result = version != null ? version.hashCode() : 0;
+        result = 29 * result + name != null ? name.hashCode() : 0;
         return result;
     }
 

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ComponentEvent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ComponentEvent.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ComponentEvent.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ComponentEvent.java Thu Aug  9 13:33:26 2007
@@ -27,14 +27,14 @@
  */
 public class ComponentEvent extends EventObject {
 
-    private static final long serialVersionUID = -4075242868959881673L;
-    
     public static final int COMPONENT_INSTALLED = 0;
     public static final int COMPONENT_INITIALIZED = 1;
     public static final int COMPONENT_STARTED = 2;
     public static final int COMPONENT_STOPPED = 3;
     public static final int COMPONENT_SHUTDOWN = 4;
     public static final int COMPONENT_UNINSTALLED = 5;
+    
+    private static final long serialVersionUID = -4075242868959881673L;
     
     private ComponentMBeanImpl component;
     private int type;

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ComponentListener.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ComponentListener.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ComponentListener.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ComponentListener.java Thu Aug  9 13:33:26 2007
@@ -16,20 +16,19 @@
  */
 package org.apache.servicemix.jbi.event;
 
-import java.util.EventListener;
 
 public interface ComponentListener extends ServiceMixListener {
     
-    public void componentInstalled(ComponentEvent event);
+    void componentInstalled(ComponentEvent event);
     
-    public void componentInitialized(ComponentEvent event);
+    void componentInitialized(ComponentEvent event);
 
-    public void componentStarted(ComponentEvent event);
+    void componentStarted(ComponentEvent event);
 
-    public void componentStopped(ComponentEvent event);
+    void componentStopped(ComponentEvent event);
 
-    public void componentShutDown(ComponentEvent event);
+    void componentShutDown(ComponentEvent event);
     
-    public void componentUninstalled(ComponentEvent event);
+    void componentUninstalled(ComponentEvent event);
 
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ContainerAware.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ContainerAware.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ContainerAware.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ContainerAware.java Thu Aug  9 13:33:26 2007
@@ -31,6 +31,6 @@
      * 
      * @param container the container where this listener is registered
      */
-    public void setContainer(JBIContainer container);
+    void setContainer(JBIContainer container);
 
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/DeploymentEvent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/DeploymentEvent.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/DeploymentEvent.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/DeploymentEvent.java Thu Aug  9 13:33:26 2007
@@ -21,14 +21,15 @@
 
 public class DeploymentEvent extends EventObject {
 
-    private static final long serialVersionUID = 1330139373403204421L;
-
     public static final int FILE_ADDED = 0;
     public static final int FILE_CHANGED = 1;
     public static final int FILE_REMOVED = 2;
     
+    private static final long serialVersionUID = 1330139373403204421L;
+
     private final File file;
     private final int type;
+
     public DeploymentEvent(File file, int type) {
         super(file);
         this.file = file;

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/DeploymentListener.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/DeploymentListener.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/DeploymentListener.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/DeploymentListener.java Thu Aug  9 13:33:26 2007
@@ -17,13 +17,12 @@
 package org.apache.servicemix.jbi.event;
 
 import java.io.IOException;
-import java.util.EventListener;
 
 public interface DeploymentListener extends ServiceMixListener {
 
-    public boolean fileAdded(DeploymentEvent event) throws IOException;
+    boolean fileAdded(DeploymentEvent event) throws IOException;
     
-    public boolean fileChanged(DeploymentEvent event) throws IOException;
+    boolean fileChanged(DeploymentEvent event) throws IOException;
     
-    public boolean fileRemoved(DeploymentEvent event) throws IOException;
+    boolean fileRemoved(DeploymentEvent event) throws IOException;
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/EndpointEvent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/EndpointEvent.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/EndpointEvent.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/EndpointEvent.java Thu Aug  9 13:33:26 2007
@@ -27,8 +27,6 @@
  */
 public class EndpointEvent extends EventObject {
 
-    private static final long serialVersionUID = -4480619483039133388L;
-    
     public static final int INTERNAL_ENDPOINT_REGISTERED = 0;
     public static final int INTERNAL_ENDPOINT_UNREGISTERED = 1;
     public static final int EXTERNAL_ENDPOINT_REGISTERED = 2;
@@ -37,6 +35,8 @@
     public static final int LINKED_ENDPOINT_UNREGISTERED = 5;
     public static final int REMOTE_ENDPOINT_REGISTERED = 6;
     public static final int REMOTE_ENDPOINT_UNREGISTERED = 7;
+    
+    private static final long serialVersionUID = -4480619483039133388L;
     
     private ServiceEndpoint endpoint;
     private int type;

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/EndpointListener.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/EndpointListener.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/EndpointListener.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/EndpointListener.java Thu Aug  9 13:33:26 2007
@@ -16,24 +16,23 @@
  */
 package org.apache.servicemix.jbi.event;
 
-import java.util.EventListener;
 
 public interface EndpointListener extends ServiceMixListener {
 
-    public void internalEndpointRegistered(EndpointEvent event);
+    void internalEndpointRegistered(EndpointEvent event);
     
-    public void internalEndpointUnregistered(EndpointEvent event);
+    void internalEndpointUnregistered(EndpointEvent event);
     
-    public void externalEndpointRegistered(EndpointEvent event);
+    void externalEndpointRegistered(EndpointEvent event);
     
-    public void externalEndpointUnregistered(EndpointEvent event);
+    void externalEndpointUnregistered(EndpointEvent event);
     
-    public void linkedEndpointRegistered(EndpointEvent event);
+    void linkedEndpointRegistered(EndpointEvent event);
     
-    public void linkedEndpointUnregistered(EndpointEvent event);
+    void linkedEndpointUnregistered(EndpointEvent event);
     
-    public void remoteEndpointRegistered(EndpointEvent event);
+    void remoteEndpointRegistered(EndpointEvent event);
     
-    public void remoteEndpointUnregistered(EndpointEvent event);
+    void remoteEndpointUnregistered(EndpointEvent event);
     
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ExchangeEvent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ExchangeEvent.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ExchangeEvent.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ExchangeEvent.java Thu Aug  9 13:33:26 2007
@@ -16,13 +16,13 @@
  */
 package org.apache.servicemix.jbi.event;
 
-import org.apache.servicemix.jbi.framework.ComponentContextImpl;
-import org.apache.servicemix.jbi.messaging.MessageExchangeImpl;
-
 import java.util.EventObject;
 
 import javax.jbi.messaging.MessageExchange;
 
+import org.apache.servicemix.jbi.framework.ComponentContextImpl;
+import org.apache.servicemix.jbi.messaging.MessageExchangeImpl;
+
 /**
  * Event sent when an exchange is received or accepted by a component.
  * 
@@ -30,11 +30,11 @@
  */
 public class ExchangeEvent extends EventObject {
 
-    private static final long serialVersionUID = -8349785806912334977L;
-
     public static final int EXCHANGE_SENT = 0;
     public static final int EXCHANGE_ACCEPTED = 1;
     
+    private static final long serialVersionUID = -8349785806912334977L;
+
     private MessageExchange exchange;
     private int type;
     

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ExchangeListener.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ExchangeListener.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ExchangeListener.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ExchangeListener.java Thu Aug  9 13:33:26 2007
@@ -16,12 +16,11 @@
  */
 package org.apache.servicemix.jbi.event;
 
-import java.util.EventListener;
 
 public interface ExchangeListener extends ServiceMixListener {
 
-    public void exchangeSent(ExchangeEvent event);
+    void exchangeSent(ExchangeEvent event);
     
-    public void exchangeAccepted(ExchangeEvent event);
+    void exchangeAccepted(ExchangeEvent event);
     
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceAssemblyEvent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceAssemblyEvent.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceAssemblyEvent.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceAssemblyEvent.java Thu Aug  9 13:33:26 2007
@@ -27,13 +27,13 @@
  */
 public class ServiceAssemblyEvent extends EventObject {
 
-    private static final long serialVersionUID = 8441830155548563543L;
-    
     public static final int ASSEMBLY_DEPLOYED = 0;
     public static final int ASSEMBLY_STARTED = 1;
     public static final int ASSEMBLY_STOPPED = 2;
     public static final int ASSEMBLY_SHUTDOWN = 3;
     public static final int ASSEMBLY_UNDEPLOYED = 4;
+    
+    private static final long serialVersionUID = 8441830155548563543L;
     
     private ServiceAssemblyLifeCycle assembly;
     private int type;

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceAssemblyListener.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceAssemblyListener.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceAssemblyListener.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceAssemblyListener.java Thu Aug  9 13:33:26 2007
@@ -16,18 +16,17 @@
  */
 package org.apache.servicemix.jbi.event;
 
-import java.util.EventListener;
 
 public interface ServiceAssemblyListener extends ServiceMixListener {
 
-    public void assemblyDeployed(ServiceAssemblyEvent event);
+    void assemblyDeployed(ServiceAssemblyEvent event);
 
-    public void assemblyStarted(ServiceAssemblyEvent event);
+    void assemblyStarted(ServiceAssemblyEvent event);
 
-    public void assemblyStopped(ServiceAssemblyEvent event);
+    void assemblyStopped(ServiceAssemblyEvent event);
 
-    public void assemblyShutDown(ServiceAssemblyEvent event);
+    void assemblyShutDown(ServiceAssemblyEvent event);
 
-    public void assemblyUndeployed(ServiceAssemblyEvent event);
+    void assemblyUndeployed(ServiceAssemblyEvent event);
 
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceMixListener.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceMixListener.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceMixListener.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceMixListener.java Thu Aug  9 13:33:26 2007
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.servicemix.jbi.event;
 
 import java.util.EventListener;

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceUnitEvent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceUnitEvent.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceUnitEvent.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceUnitEvent.java Thu Aug  9 13:33:26 2007
@@ -27,13 +27,13 @@
  */
 public class ServiceUnitEvent extends EventObject {
 
-    private static final long serialVersionUID = 7825652001472392923L;
-    
     public static final int UNIT_DEPLOYED = 0;
     public static final int UNIT_STARTED = 1;
     public static final int UNIT_STOPPED = 2;
     public static final int UNIT_SHUTDOWN = 3;
     public static final int UNIT_UNDEPLOYED = 4;
+    
+    private static final long serialVersionUID = 7825652001472392923L;
     
     private ServiceUnitLifeCycle unit;
     private int type;

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceUnitListener.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceUnitListener.java?view=diff&rev=564374&r1=564373&r2=564374
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceUnitListener.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/event/ServiceUnitListener.java Thu Aug  9 13:33:26 2007
@@ -16,18 +16,17 @@
  */
 package org.apache.servicemix.jbi.event;
 
-import java.util.EventListener;
 
 public interface ServiceUnitListener extends ServiceMixListener {
 
-    public void unitDeployed(ServiceUnitEvent event);
+    void unitDeployed(ServiceUnitEvent event);
 
-    public void unitStarted(ServiceUnitEvent event);
+    void unitStarted(ServiceUnitEvent event);
 
-    public void unitStopped(ServiceUnitEvent event);
+    void unitStopped(ServiceUnitEvent event);
 
-    public void unitShutDown(ServiceUnitEvent event);
+    void unitShutDown(ServiceUnitEvent event);
 
-    public void unitUndeployed(ServiceUnitEvent event);
+    void unitUndeployed(ServiceUnitEvent event);
 
 }