mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 05:55:44 +01:00
remove unused services and fix double plugin loading
This commit is contained in:
@@ -18,7 +18,6 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sonia.scm.repository.RepositoryManager;
|
||||
import sonia.scm.util.ServiceUtil;
|
||||
import sonia.scm.util.Util;
|
||||
import sonia.scm.web.plugin.SCMPlugin;
|
||||
import sonia.scm.web.plugin.SCMPluginManager;
|
||||
@@ -127,7 +126,7 @@ public class ContextListener extends GuiceServletContextListener
|
||||
{
|
||||
List<Module> modules = new ArrayList<Module>();
|
||||
|
||||
modules.add(new ScmServletModule(webPluginContext));
|
||||
modules.add(new ScmServletModule(pluginManager, webPluginContext));
|
||||
|
||||
Collection<Module> pluginModules = webPluginContext.getInjectModules();
|
||||
|
||||
|
||||
@@ -99,10 +99,14 @@ public class ScmServletModule extends ServletModule
|
||||
* Constructs ...
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param pluginManager
|
||||
* @param webPluginContext
|
||||
*/
|
||||
ScmServletModule(ScmWebPluginContext webPluginContext)
|
||||
ScmServletModule(SCMPluginManager pluginManager,
|
||||
ScmWebPluginContext webPluginContext)
|
||||
{
|
||||
this.pluginManager = pluginManager;
|
||||
this.webPluginContext = webPluginContext;
|
||||
}
|
||||
|
||||
@@ -121,18 +125,6 @@ public class ScmServletModule extends ServletModule
|
||||
bind(EncryptionHandler.class).to(MessageDigestEncryptionHandler.class);
|
||||
bind(Authenticator.class).to(XmlAuthenticator.class);
|
||||
bind(SecurityContext.class).to(BasicSecurityContext.class);
|
||||
|
||||
SCMPluginManager pluginManager = new SCMPluginManager();
|
||||
|
||||
try
|
||||
{
|
||||
pluginManager.load();
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
logger.error(ex.getMessage(), ex);
|
||||
}
|
||||
|
||||
loadPlugins(pluginManager);
|
||||
bind(CacheManager.class).to(EhCacheManager.class);
|
||||
bind(RepositoryManager.class).annotatedWith(Undecorated.class).to(
|
||||
@@ -229,6 +221,9 @@ public class ScmServletModule extends ServletModule
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
private SCMPluginManager pluginManager;
|
||||
|
||||
/** Field description */
|
||||
private ScmWebPluginContext webPluginContext;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user