You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2010/05/31 18:01:48 UTC

svn commit: r949780 - in /qpid/trunk/qpid/java/broker/src: main/java/org/apache/qpid/server/plugins/ test/java/org/apache/qpid/server/plugins/

Author: robbie
Date: Mon May 31 16:01:48 2010
New Revision: 949780

URL: http://svn.apache.org/viewvc?rev=949780&view=rev
Log:
QPID-2585: Upgrade Felix to 2.0.5

Applied patch from Andrew Kennedy <an...@gmail.com>

Added:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/Plugin.java
      - copied, changed from r949779, qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginFactory.java
Modified:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/Activator.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginFactory.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/plugins/MockPluginManager.java

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/Activator.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/Activator.java?rev=949780&r1=949779&r2=949780&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/Activator.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/Activator.java Mon May 31 16:01:48 2010
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 package org.apache.qpid.server.plugins;
 
+import org.apache.log4j.Logger;
 import org.apache.qpid.server.configuration.ServerConfiguration;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.osgi.framework.BundleActivator;
@@ -26,17 +26,21 @@ import org.osgi.framework.BundleContext;
 
 public class Activator implements BundleActivator
 {
+    private static final Logger _logger = Logger.getLogger(Activator.class);
     
-    BundleContext _context = null;
+    private BundleContext _context = null;
     
     public void start(BundleContext ctx) throws Exception
     {
         _context = ctx;
-         ctx.registerService(ServerConfiguration.class.getName(), ApplicationRegistry.getInstance().getConfiguration(), null);         
+        _logger.info("Registering bundle: " + _context.getBundle().getSymbolicName());
+         ctx.registerService(ServerConfiguration.class.getName(), ApplicationRegistry.getInstance().getConfiguration(), null);
     }
 
     public void stop(BundleContext ctx) throws Exception
-    {        
+    {
+        _logger.info("Stopping bundle: " + _context.getBundle().getSymbolicName());
+        _context = null;
     }
 
     public BundleContext getContext()

Copied: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/Plugin.java (from r949779, qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginFactory.java)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/Plugin.java?p2=qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/Plugin.java&p1=qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginFactory.java&r1=949779&r2=949780&rev=949780&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginFactory.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/Plugin.java Mon May 31 16:01:48 2010
@@ -1,5 +1,4 @@
 /*
- *
  * 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
@@ -16,11 +15,25 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.qpid.server.plugins;
 
-public interface PluginFactory
+import org.apache.commons.configuration.ConfigurationException;
+
+public interface Plugin
 {
-    public String getPluginName();
+    /**
+     * The name of this plugin.
+     */
+    String getPluginName();
+    
+    /**
+     * Is this plugin configured?.
+     */
+    boolean isConfigured();
+    
+    /**
+     * Configure this plugin
+     */
+    void configure() throws ConfigurationException;
 }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginFactory.java?rev=949780&r1=949779&r2=949780&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginFactory.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginFactory.java Mon May 31 16:01:48 2010
@@ -1,5 +1,4 @@
 /*
- *
  * 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
@@ -16,11 +15,17 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.qpid.server.plugins;
 
-public interface PluginFactory
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.qpid.server.configuration.plugins.ConfigurationPlugin;
+
+public interface PluginFactory<P extends Plugin>
 {
+    public Class<P> getPluginClass();
+
     public String getPluginName();
+
+    public P newInstance(ConfigurationPlugin config)  throws ConfigurationException;
 }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java?rev=949780&r1=949779&r2=949780&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java Mon May 31 16:01:48 2010
@@ -16,180 +16,222 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 package org.apache.qpid.server.plugins;
 
+import static org.apache.felix.framework.util.FelixConstants.*;
+import static org.apache.felix.main.AutoProcessor.*;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.IdentityHashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.felix.framework.Felix;
-import org.apache.felix.framework.util.FelixConstants;
 import org.apache.felix.framework.util.StringMap;
-import org.apache.felix.main.AutoProcessor;
+import org.apache.log4j.Logger;
 import org.apache.qpid.common.Closeable;
 import org.apache.qpid.server.configuration.plugins.ConfigurationPluginFactory;
 import org.apache.qpid.server.exchange.ExchangeType;
-import org.apache.qpid.server.security.access.ACLPlugin;
-import org.apache.qpid.server.security.access.ACLPluginFactory;
+import org.apache.qpid.server.security.SecurityPluginFactory;
 import org.apache.qpid.server.security.access.plugins.AllowAll;
 import org.apache.qpid.server.security.access.plugins.DenyAll;
-import org.apache.qpid.server.security.access.plugins.LegacyAccessPlugin;
-import org.apache.qpid.server.security.access.plugins.SimpleXML;
-import org.apache.qpid.server.security.access.plugins.network.FirewallPlugin;
+import org.apache.qpid.server.security.access.plugins.LegacyAccess;
 import org.apache.qpid.server.virtualhost.plugins.VirtualHostPluginFactory;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleException;
 import org.osgi.util.tracker.ServiceTracker;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 /**
- * @author aidan
- *
- *         Provides access to pluggable elements, such as exchanges
+ * Provides access to pluggable elements, such as exchanges
  */
-
+@SuppressWarnings("unchecked")
 public class PluginManager implements Closeable
 {
+    private static final Logger _logger = Logger.getLogger(PluginManager.class);
+
+    private static final int FELIX_STOP_TIMEOUT = 30000;
+    private static final String VERSION = "2.6.0.4";
+
+    private Felix _felix;
+
     private ServiceTracker _exchangeTracker = null;
     private ServiceTracker _securityTracker = null;
     private ServiceTracker _configTracker = null;
     private ServiceTracker _virtualHostTracker = null;
 
-    private Felix _felix;
-
-    Activator _activator;
+    private Activator _activator;
 
-    private Map<String, ACLPluginFactory> _securityPlugins;
-    private static final int FELIX_STOP_TIMEOUT = 30000;
+    private Map<String, SecurityPluginFactory> _securityPlugins = new HashMap<String, SecurityPluginFactory>();
+    private Map<List<String>, ConfigurationPluginFactory> _configPlugins = new IdentityHashMap<List<String>, ConfigurationPluginFactory>();
 
-    public PluginManager(String plugindir) throws Exception
+    public PluginManager(String pluginPath, String cachePath) throws Exception
     {
-        StringMap configMap = new StringMap(false);
-
-        // Add the bundle provided service interface package and the core OSGi
-        // packages to be exported from the class path via the system bundle.
-        configMap.put(FelixConstants.FRAMEWORK_SYSTEMPACKAGES,
-                      "org.osgi.framework; version=1.3.0," +
-                      "org.osgi.service.packageadmin; version=1.2.0," +
-                      "org.osgi.service.startlevel; version=1.0.0," +
-                      "org.osgi.service.url; version=1.0.0," +
-                      "org.osgi.util.tracker; version=1.0.0," +
-                      "org.apache.qpid.junit.extensions.util; version=0.7," +
-                      "org.apache.qpid; version=0.7," +
-                      "org.apache.qpid.framing; version=0.7," +
-                      "org.apache.qpid.protocol; version=0.7," +
-                      "org.apache.qpid.server.exchange; version=0.7," +
-                      "org.apache.qpid.server.management; version=0.7," +
-                      "org.apache.qpid.server.protocol; version=0.7," +
-                      "org.apache.qpid.server.virtualhost; version=0.7," +
-                      "org.apache.qpid.server.virtualhost.plugins; version=0.7," +
-                      "org.apache.qpid.server.registry; version=0.7," +
-                      "org.apache.qpid.server.queue; version=0.7," +
-                      "org.apache.qpid.server.binding; version=0.7," +
-                      "org.apache.qpid.server.configuration; version=0.7," +
-                      "org.apache.qpid.server.configuration.plugins; version=0.7," +
-                      "org.apache.qpid.server.configuration.management; version=0.7," +
-                      "org.apache.qpid.server.persistent; version=0.7," +
-                      "org.apache.qpid.server.plugins; version=0.7," +
-                      "org.apache.qpid.server.queue; version=0.7," +
-                      "org.apache.qpid.server.security; version=0.7," +
-                      "org.apache.qpid.framing.AMQShortString; version=0.7," +
-                      "org.apache.qpid.server.queue.AMQQueue; version=0.7," +
-                      "org.apache.qpid.server.security.access; version=0.7," +
-                      "org.apache.commons.configuration; version=0.7," +
-                      "org.apache.log4j; version=1.2.12," +
-                      "javax.management.openmbean; version=1.0.0," +
-                      "javax.management; version=1.0.0,"
-        );
-
-        if (plugindir == null)
+        // Store all non-OSGi plugins
+        // A little gross that we have to add them here, but not all the plugins are OSGIfied
+        for (SecurityPluginFactory<?> pluginFactory : Arrays.asList(
+                AllowAll.FACTORY, DenyAll.FACTORY, LegacyAccess.FACTORY))
         {
-            return;
+            _securityPlugins.put(pluginFactory.getPluginName(), pluginFactory);
         }
-
-        // Set the list of bundles to load
-        File dir = new File(plugindir);
-        if (!dir.exists())
+        for (ConfigurationPluginFactory configFactory : Arrays.asList(
+                AllowAll.AllowAllConfiguration.FACTORY,
+                DenyAll.DenyAllConfiguration.FACTORY,
+                LegacyAccess.LegacyAccessConfiguration.FACTORY))
         {
-            return;
+            _configPlugins.put(configFactory.getParentPaths(), configFactory);
         }
 
-        StringBuffer pluginJars = new StringBuffer();
-
-        if (dir.isDirectory())
+        // Check the plugin directory path is set and exist
+        if (pluginPath == null)
         {
-            for (File child : dir.listFiles())
-            {
-                if (child.getName().endsWith("jar"))
-                {
-                    pluginJars.append(String.format(" file:%s%s%s", plugindir, File.separator, child.getName()));
-                }
-            }
+            return;
         }
-
-        if (pluginJars.length() == 0)
+        File pluginDir = new File(pluginPath);
+        if (!pluginDir.exists())
         {
             return;
-        }
-
-//        configMap.put(FelixConstants.AUTO_START_PROP + ".1", pluginJars.toString());
-//        configMap.put(BundleCache.CACHE_PROFILE_DIR_PROP, plugindir);
-
-         configMap.put(AutoProcessor.AUTO_START_PROP + ".1", pluginJars.toString());
-
-        configMap.put(FelixConstants.FRAMEWORK_STORAGE, plugindir);
+        } 
 
+        // Setup OSGi configuration propery map
+        StringMap configMap = new StringMap(false);
 
+        // Add the bundle provided service interface package and the core OSGi
+        // packages to be exported from the class path via the system bundle.
+        configMap.put(FRAMEWORK_SYSTEMPACKAGES,
+                "org.osgi.framework; version=1.3.0," +
+                "org.osgi.service.packageadmin; version=1.2.0," +
+                "org.osgi.service.startlevel; version=1.0.0," +
+                "org.osgi.service.url; version=1.0.0," +
+                "org.osgi.util.tracker; version=1.0.0," +
+                "org.apache.qpid.junit.extensions.util; version=0.7," +
+                "org.apache.qpid; version=0.7," +
+                "org.apache.qpid.exchange; version=0.7," +
+                "org.apache.qpid.framing; version=0.7," +
+                "org.apache.qpid.protocol; version=0.7," +
+                "org.apache.qpid.server.binding; version=0.7," +
+                "org.apache.qpid.server.configuration; version=0.7," +
+                "org.apache.qpid.server.configuration.plugins; version=0.7," +
+                "org.apache.qpid.server.configuration.management; version=0.7," +
+                "org.apache.qpid.server.exchange; version=0.7," +
+                "org.apache.qpid.server.management; version=0.7," +
+                "org.apache.qpid.server.persistent; version=0.7," +
+                "org.apache.qpid.server.plugins; version=0.7," +
+                "org.apache.qpid.server.protocol; version=0.7," +
+                "org.apache.qpid.server.queue; version=0.7," +
+                "org.apache.qpid.server.registry; version=0.7," +
+                "org.apache.qpid.server.security; version=0.7," +
+                "org.apache.qpid.server.security.access; version=0.7," +
+                "org.apache.qpid.server.security.access.plugins; version=0.7," +
+                "org.apache.qpid.server.virtualhost; version=0.7," +
+                "org.apache.qpid.server.virtualhost.plugins; version=0.7," +
+                "org.apache.qpid.util; version=0.7," +
+                "org.apache.commons.configuration; version=1.0.0," +
+                "org.apache.commons.lang; version=1.0.0," +
+                "org.apache.commons.lang.builder; version=1.0.0," +
+                "org.apache.commons.logging; version=1.0.0," +
+                "org.apache.log4j; version=1.2.12," +
+                "javax.management.openmbean; version=1.0.0," +
+                "javax.management; version=1.0.0"
+            );
+        
+        // No automatic shutdown hook
+        configMap.put("felix.shutdown.hook", "false");
+        
+        // Add system activator
         List<BundleActivator> activators = new ArrayList<BundleActivator>();
         _activator = new Activator();
         activators.add(_activator);
-        configMap.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, activators);
+        configMap.put(SYSTEMBUNDLE_ACTIVATORS_PROP, activators);
+        
+        // Get the list of bundles to load
+        StringBuffer pluginJars = new StringBuffer();
+        if (pluginDir.isDirectory())
+        {
+            for (String file : pluginDir.list())            
+            {
+                if (file.endsWith(".jar"))
+                {
+                    pluginJars.append(String.format("file:%s%s%s ", pluginPath, File.separator, file));
+                }
+            }
+        }
 
+        if (cachePath != null)
+            {
+            File cacheDir = new File(cachePath);
+            if (!cacheDir.exists() && cacheDir.canWrite())
+            {
+                _logger.info("Creating plugin cache directory: " + cachePath);
+                cacheDir.mkdir();
+            }
+            
+            // Set plugin cache directory and empty it
+            _logger.info("Cache bundles in directory " + cachePath);
+            configMap.put("org.osgi.framework.storage", cachePath);
+        }
+        configMap.put("org.osgi.framework.storage.clean", "onFirstInit");
+        
+        // Set directory with plugins
+        _logger.info("Auto deploy bundles from directory " + pluginPath);
+
+        // Set list of auto-start plugin JAR files
+        configMap.put(AUTO_START_PROP + "." + FRAMEWORK_DEFAULT_STARTLEVEL, pluginJars.toString());
+        
+        // FIXME why does this not work?
+        configMap.put(AUTO_DEPLOY_DIR_PROPERY, pluginPath);
+        configMap.put(AUTO_DEPLOY_ACTION_PROPERY, AUTO_DEPLOY_START_VALUE);        
+        
+        // Start plugin manager and trackers
         _felix = new Felix(configMap);
         try
         {
-            System.out.println("Starting Plugin manager");
-
+            _logger.info("Starting plugin manager...");
+            _felix.init();
+	        process(configMap, _felix.getBundleContext());
             _felix.start();
-
-
-           AutoProcessor.process(configMap, _felix.getBundleContext());
-                                                         
-            System.out.println("Started Plugin manager");
-
-            _exchangeTracker = new ServiceTracker(_activator.getContext(), ExchangeType.class.getName(), null);
-            _exchangeTracker.open();
-
-            _securityTracker = new ServiceTracker(_activator.getContext(), ACLPlugin.class.getName(), null);
-            _securityTracker.open();
-
-            _configTracker = new ServiceTracker(_activator.getContext(), ConfigurationPluginFactory.class.getName(), null);
-            _configTracker.open();
-
-            _virtualHostTracker = new ServiceTracker(_activator.getContext(), VirtualHostPluginFactory.class.getName(), null);
-            _virtualHostTracker.open();
-
+            _logger.info("Started plugin manager");
         }
         catch (BundleException e)
         {
-            throw new ConfigurationException("Could not start PluginManager:" + e.getMessage(), e);
+            throw new ConfigurationException("Could not start plugin manager: " + e.getMessage(), e);
         }
+        
+        // TODO save trackers in a map, keyed by class name
+        
+        _exchangeTracker = new ServiceTracker(_activator.getContext(), ExchangeType.class.getName(), null);
+        _exchangeTracker.open();
+
+        _securityTracker = new ServiceTracker(_activator.getContext(), SecurityPluginFactory.class.getName(), null);
+        _securityTracker.open();
+
+        _configTracker = new ServiceTracker(_activator.getContext(), ConfigurationPluginFactory.class.getName(), null);
+        _configTracker.open();
+
+        _virtualHostTracker = new ServiceTracker(_activator.getContext(), VirtualHostPluginFactory.class.getName(), null);
+        _virtualHostTracker.open();
+
+        _logger.info("Opened service trackers");
+        
+        // Load security and configuration plugins from their trackers for access
+        _configPlugins.putAll(getConfigurationServices());
+        _securityPlugins.putAll(getPlugins(SecurityPluginFactory.class));
     }
 
-    private <T> Map<String, T> getServices(ServiceTracker tracker)
-    {
+    private static <T> Map<String, T> getServices(ServiceTracker tracker)
+    {   
         Map<String, T> services = new HashMap<String, T>();
-
+        
         if ((tracker != null) && (tracker.getServices() != null))
         {
             for (Object service : tracker.getServices())
             {
-                if (service instanceof PluginFactory)
+                if (service instanceof PluginFactory<?>)
                 {
-                    services.put(((PluginFactory) service).getPluginName(), (T) service);
+                    services.put(((PluginFactory<?>) service).getPluginName(), (T) service);
                 }
                 else
                 {
@@ -201,41 +243,25 @@ public class PluginManager implements Cl
         return services;
     }
 
-    public Map<String, ExchangeType<?>> getExchanges()
-    {
-        return getServices(_exchangeTracker);
-    }
-
-    public Map<String, ACLPluginFactory> getSecurityPlugins()
-    {
-        _securityPlugins = getServices(_securityTracker);
-        // A little gross that we have to add them here, but not all the plugins are OSGIfied
-        _securityPlugins.put(SimpleXML.class.getName(), SimpleXML.FACTORY);
-        _securityPlugins.put(AllowAll.class.getName(), AllowAll.FACTORY);
-        _securityPlugins.put(DenyAll.class.getName(), DenyAll.FACTORY);
-        _securityPlugins.put(LegacyAccessPlugin.class.getName(), LegacyAccessPlugin.FACTORY);
-        _securityPlugins.put(FirewallPlugin.class.getName(), FirewallPlugin.FACTORY);
-
-        return _securityPlugins;
-    }
-
-    public Map<String, ConfigurationPluginFactory> getConfigurationPlugins()
-    {
-        Map<String, ConfigurationPluginFactory> services = new HashMap<String, ConfigurationPluginFactory>();
-
-        if ((_configTracker != null) && (_configTracker.getServices() != null))
+    private Map<List<String>, ConfigurationPluginFactory> getConfigurationServices()
+    {   
+        Map<List<String>, ConfigurationPluginFactory> services = new IdentityHashMap<List<String>, ConfigurationPluginFactory>();
+        
+        if (_configTracker.getServices() != null)
         {
             for (Object service : _configTracker.getServices())
             {
-                for (String parent : ((ConfigurationPluginFactory) service).getParentPaths())
-                {
-                    services.put(parent, ((ConfigurationPluginFactory) service));
-                }
+                ConfigurationPluginFactory factory = (ConfigurationPluginFactory) service;
+                services.put(factory.getParentPaths(), factory);
             }
         }
 
         return services;
+    }
 
+    public Map<String, ExchangeType<?>> getExchanges()
+    {
+        return getServices(_exchangeTracker);
     }
 
     public Map<String, VirtualHostPluginFactory> getVirtualHostPlugins()
@@ -243,7 +269,7 @@ public class PluginManager implements Cl
         return getServices(_virtualHostTracker);
     }
 
-    public <P extends PluginFactory> Map<String, P> getPlugins(Class<P> plugin)
+    public <P extends PluginFactory<?>> Map<String, P> getPlugins(Class<P> plugin)
     {
         // If plugins are not configured then return an empty set
         if (_activator == null)
@@ -263,6 +289,16 @@ public class PluginManager implements Cl
             tracker.close();
         }
     }
+    
+    public Map<String, SecurityPluginFactory> getSecurityPlugins()
+    {
+        return _securityPlugins;
+    }
+    
+    public Map<List<String>, ConfigurationPluginFactory> getConfigurationPlugins()
+    {
+        return _configPlugins;
+    }
 
     public void close()
     {
@@ -270,25 +306,23 @@ public class PluginManager implements Cl
         {
             try
             {
+                // Close all bundle trackers
                 _exchangeTracker.close();
-
                 _securityTracker.close();
-
                 _configTracker.close();
-
                 _virtualHostTracker.close();
             }
             finally
             {
-                System.out.println("Stopping Plugin manager");
-                //fixme should be stopAndWait() but hangs VM, need upgrade in felix
+                _logger.info("Stopping plugin manager");
                 try
                 {
+                    // FIXME should be stopAndWait() but hangs VM, need upgrade in felix
                     _felix.stop();
                 }
                 catch (BundleException e)
                 {
-                    //ignore
+                    // Ignore
                 }
 
                 try
@@ -297,12 +331,10 @@ public class PluginManager implements Cl
                 }
                 catch (InterruptedException e)
                 {
-                    //ignore
+                    // Ignore
                 }
-
-                System.out.println("Stopped Plugin manager");
+                _logger.info("Stopped plugin manager");
             }
         }
     }
-
 }

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/plugins/MockPluginManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/plugins/MockPluginManager.java?rev=949780&r1=949779&r2=949780&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/plugins/MockPluginManager.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/plugins/MockPluginManager.java Mon May 31 16:01:48 2010
@@ -19,22 +19,21 @@
 package org.apache.qpid.server.plugins;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
+import org.apache.qpid.server.configuration.plugins.ConfigurationPluginFactory;
 import org.apache.qpid.server.exchange.ExchangeType;
-import org.apache.qpid.server.security.access.ACLPlugin;
-import org.apache.qpid.server.security.access.ACLPluginFactory;
-import org.apache.qpid.server.security.access.QueueDenier;
+import org.apache.qpid.server.security.SecurityPluginFactory;
 
 public class MockPluginManager extends PluginManager
 {
+    private Map<String, SecurityPluginFactory> _securityPlugins = new HashMap<String, SecurityPluginFactory>();
+    private Map<List<String>, ConfigurationPluginFactory> _configPlugins = new HashMap<List<String>, ConfigurationPluginFactory>();
 
-    private Map<String, ACLPluginFactory> _securityPlugins = new HashMap<String, ACLPluginFactory>();
-
-    public MockPluginManager(String plugindir) throws Exception
+    public MockPluginManager(String pluginPath, String cachePath) throws Exception
     {
-        super(plugindir);
-        _securityPlugins.put("org.apache.qpid.server.security.access.QueueDenier", QueueDenier.FACTORY);
+        super(pluginPath, cachePath);
     }
 
     @Override
@@ -44,8 +43,14 @@ public class MockPluginManager extends P
     }
 
     @Override
-    public Map<String, ACLPluginFactory> getSecurityPlugins()
+    public Map<String, SecurityPluginFactory> getSecurityPlugins()
     {
         return _securityPlugins;
     }
+
+    @Override
+    public Map<List<String>, ConfigurationPluginFactory> getConfigurationPlugins()
+    {
+        return _configPlugins;
+    }
 }



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org