Class SingletonVelocityManager
- java.lang.Object
-
- org.apache.struts2.views.velocity.VelocityManager
-
- com.atlassian.confluence.setup.struts.SingletonVelocityManager
-
public class SingletonVelocityManager extends org.apache.struts2.views.velocity.VelocityManager
Struts uses a Guice container to manage its beans, the VelocityManager being one of them. Currently, the container and Struts package configuration are coupled. That is, there is no way to reload the package configuration without also reloading the container.Confluence requires the Struts package configuration to be reloaded when plugins are installed and uninstalled. This is problematic as the VelocityManager and its configuration should remain constant during the Confluence application lifecycle. This delegating VelocityManager addresses this issue.
- Since:
- 8.8
-
-
Constructor Summary
Constructors Constructor Description SingletonVelocityManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.velocity.context.Context
createContext(com.opensymphony.xwork2.util.ValueStack stack, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
org.apache.velocity.tools.ToolManager
getToolboxManager()
org.apache.velocity.app.VelocityEngine
getVelocityEngine()
Properties
getVelocityProperties()
void
init(javax.servlet.ServletContext context)
Properties
loadConfiguration(javax.servlet.ServletContext context)
void
setChainedContexts(String contexts)
void
setContainer(com.opensymphony.xwork2.inject.Container container)
void
setCustomConfigFile(String val)
void
setObjectFactory(com.opensymphony.xwork2.ObjectFactory fac)
void
setToolBoxLocation(String toolboxLocation)
void
setVelocityProperties(Properties velocityProperties)
-
-
-
Method Detail
-
setObjectFactory
public void setObjectFactory(com.opensymphony.xwork2.ObjectFactory fac)
- Overrides:
setObjectFactory
in classorg.apache.struts2.views.velocity.VelocityManager
-
setContainer
public void setContainer(com.opensymphony.xwork2.inject.Container container)
- Overrides:
setContainer
in classorg.apache.struts2.views.velocity.VelocityManager
-
getVelocityEngine
public org.apache.velocity.app.VelocityEngine getVelocityEngine()
- Overrides:
getVelocityEngine
in classorg.apache.struts2.views.velocity.VelocityManager
-
createContext
public org.apache.velocity.context.Context createContext(com.opensymphony.xwork2.util.ValueStack stack, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
- Overrides:
createContext
in classorg.apache.struts2.views.velocity.VelocityManager
-
init
public void init(javax.servlet.ServletContext context)
- Overrides:
init
in classorg.apache.struts2.views.velocity.VelocityManager
-
loadConfiguration
public Properties loadConfiguration(javax.servlet.ServletContext context)
- Overrides:
loadConfiguration
in classorg.apache.struts2.views.velocity.VelocityManager
-
setCustomConfigFile
public void setCustomConfigFile(String val)
- Overrides:
setCustomConfigFile
in classorg.apache.struts2.views.velocity.VelocityManager
-
setToolBoxLocation
public void setToolBoxLocation(String toolboxLocation)
- Overrides:
setToolBoxLocation
in classorg.apache.struts2.views.velocity.VelocityManager
-
getToolboxManager
public org.apache.velocity.tools.ToolManager getToolboxManager()
- Overrides:
getToolboxManager
in classorg.apache.struts2.views.velocity.VelocityManager
-
setChainedContexts
public void setChainedContexts(String contexts)
- Overrides:
setChainedContexts
in classorg.apache.struts2.views.velocity.VelocityManager
-
getVelocityProperties
public Properties getVelocityProperties()
- Overrides:
getVelocityProperties
in classorg.apache.struts2.views.velocity.VelocityManager
-
setVelocityProperties
public void setVelocityProperties(Properties velocityProperties)
- Overrides:
setVelocityProperties
in classorg.apache.struts2.views.velocity.VelocityManager
-
-