2010-09-20 14:51:10 +02:00
|
|
|
/*
|
|
|
|
|
* To change this template, choose Tools | Templates
|
|
|
|
|
* and open the template in the editor.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package sonia.scm.web;
|
|
|
|
|
|
|
|
|
|
//~--- non-JDK imports --------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
import com.google.inject.Module;
|
|
|
|
|
|
|
|
|
|
//~--- JDK imports ------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
2010-09-26 16:16:38 +02:00
|
|
|
import javax.servlet.ServletContext;
|
|
|
|
|
|
2010-09-20 14:51:10 +02:00
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @author Sebastian Sdorra
|
|
|
|
|
*/
|
|
|
|
|
public class ScmWebPluginContext
|
|
|
|
|
{
|
|
|
|
|
|
2010-09-26 16:16:38 +02:00
|
|
|
/**
|
|
|
|
|
* Constructs ...
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param servletContext
|
|
|
|
|
*/
|
|
|
|
|
public ScmWebPluginContext(ServletContext servletContext)
|
|
|
|
|
{
|
|
|
|
|
this.servletContext = servletContext;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//~--- methods --------------------------------------------------------------
|
|
|
|
|
|
2010-09-20 14:51:10 +02:00
|
|
|
/**
|
|
|
|
|
* Method description
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param module
|
|
|
|
|
*/
|
|
|
|
|
public void addInjectModule(Module module)
|
|
|
|
|
{
|
|
|
|
|
injectModules.add(module);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Method description
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param resource
|
|
|
|
|
*/
|
|
|
|
|
public void addScriptResource(WebResource resource)
|
|
|
|
|
{
|
|
|
|
|
scriptResources.add(resource);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Method description
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param module
|
|
|
|
|
*/
|
|
|
|
|
public void removeInjectModule(Module module)
|
|
|
|
|
{
|
|
|
|
|
injectModules.remove(module);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Method description
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param resource
|
|
|
|
|
*/
|
|
|
|
|
public void removeScriptResource(WebResource resource)
|
|
|
|
|
{
|
|
|
|
|
scriptResources.remove(resource);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//~--- get methods ----------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Method description
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public Collection<Module> getInjectModules()
|
|
|
|
|
{
|
|
|
|
|
return injectModules;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Method description
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public Collection<WebResource> getScriptResources()
|
|
|
|
|
{
|
|
|
|
|
return scriptResources;
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-26 16:16:38 +02:00
|
|
|
/**
|
|
|
|
|
* Method description
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public ServletContext getServletContext()
|
|
|
|
|
{
|
|
|
|
|
return servletContext;
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-20 14:51:10 +02:00
|
|
|
//~--- fields ---------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
/** Field description */
|
|
|
|
|
private Set<WebResource> scriptResources = new HashSet<WebResource>();
|
|
|
|
|
|
|
|
|
|
/** Field description */
|
|
|
|
|
private Set<Module> injectModules = new HashSet<Module>();
|
2010-09-26 16:16:38 +02:00
|
|
|
|
|
|
|
|
/** Field description */
|
|
|
|
|
private ServletContext servletContext;
|
2010-09-20 14:51:10 +02:00
|
|
|
}
|