You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2012/10/12 23:13:43 UTC

svn commit: r1397725 - /openejb/trunk/openejb/osgi/openejb-core-osgi/src/main/java/org/apache/openejb/core/osgi/impl/Deployer.java

Author: rmannibucau
Date: Fri Oct 12 21:13:43 2012
New Revision: 1397725

URL: http://svn.apache.org/viewvc?rev=1397725&view=rev
Log:
OPENEJB-1922 minor clean up

Modified:
    openejb/trunk/openejb/osgi/openejb-core-osgi/src/main/java/org/apache/openejb/core/osgi/impl/Deployer.java

Modified: openejb/trunk/openejb/osgi/openejb-core-osgi/src/main/java/org/apache/openejb/core/osgi/impl/Deployer.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/osgi/openejb-core-osgi/src/main/java/org/apache/openejb/core/osgi/impl/Deployer.java?rev=1397725&r1=1397724&r2=1397725&view=diff
==============================================================================
--- openejb/trunk/openejb/osgi/openejb-core-osgi/src/main/java/org/apache/openejb/core/osgi/impl/Deployer.java (original)
+++ openejb/trunk/openejb/osgi/openejb-core-osgi/src/main/java/org/apache/openejb/core/osgi/impl/Deployer.java Fri Oct 12 21:13:43 2012
@@ -60,7 +60,6 @@ import java.util.Enumeration;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.NoSuchElementException;
 import java.util.Properties;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
@@ -166,21 +165,6 @@ public class Deployer implements BundleL
 
                     LOGGER.info("looking bundle {} in {}", bundle.getBundleId(), bundleDump);
                     final AppModule appModule = new OSGiDeploymentLoader(bundle).load(bundleDump);
-                    /*
-                    if (libs.size() > 0) {
-                        for (EjbModule ejbModule : appModule.getEjbModules()) {
-                            if (ejbModule.getJarLocation() != null) {
-                                final Set<URL> cp = new HashSet<URL>(libs);
-                                cp.add(new File(ejbModule.getJarLocation()).toURI().toURL());
-
-                                final AnnotationFinder annotationFinder = new AnnotationFinder(new ConfigurableClasspathArchive(ejbModule, cp));
-                                FinderFactory.enableFinderOptions(annotationFinder);
-                                ejbModule.setFinder(annotationFinder.link());
-                            }
-                        }
-                        // libByBundle.put(bundle, libs);
-                    }
-                    */
                     LOGGER.info("deploying bundle #" + bundle.getBundleId() + " as an EJBModule");
 
                     final ConfigurationFactory configurationFactory = new ConfigurationFactory();
@@ -348,7 +332,7 @@ public class Deployer implements BundleL
         LOGGER.info("[Deployer] Bundle {} has been stopped", bundle.getSymbolicName());
     }
 
-    private void clean(final Bundle bundle, final Map<Bundle, Collection<String>> lists) {
+    private static void clean(final Bundle bundle, final Map<Bundle, Collection<String>> lists) {
         final Collection<String> list = lists.remove(bundle);
         if (list != null) {
             list.clear();
@@ -515,18 +499,6 @@ public class Deployer implements BundleL
         }
     }
 
-    private static class EmptyEnumeration<T> implements Enumeration<T> {
-        @Override
-        public boolean hasMoreElements() {
-            return false;
-        }
-
-        @Override
-        public T nextElement() {
-            throw new NoSuchElementException();
-        }
-    }
-
     public class OSGiDeploymentLoader extends DeploymentLoader {
         private final Bundle bundle;
 
@@ -544,10 +516,12 @@ public class Deployer implements BundleL
         private final String[] exclusions;
 
         public OSGiPrefixFilter(final String[] exclusions) {
-            this.exclusions = exclusions;
+            this.exclusions = new String[exclusions.length];
             for (int i = 0; i < exclusions.length; i++) {
                 if (exclusions[i].endsWith("-")) {
                     this.exclusions[i] = exclusions[i].substring(0, exclusions[i].length() - 1);
+                } else {
+                    this.exclusions[i] = exclusions[i];
                 }
             }
         }