Package org.nuxeo.ecm.webengine
Class WebEngine
- java.lang.Object
-
- org.nuxeo.ecm.webengine.WebEngine
-
- All Implemented Interfaces:
ResourceLocator
public class WebEngine extends Object implements ResourceLocator
- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected AnnotationManager
annoMgr
protected HashMap<String,WebEngineModule>
apps
protected boolean
devMode
protected Map<String,Object>
env
protected boolean
isDirty
protected static Map<Object,Object>
mimeTypes
protected ModuleManager
moduleMgr
moduleMgr use double-check idiom and needs to be volatile.protected ResourceRegistry
registry
protected RenderingEngine
rendering
protected File
root
protected Scripting
scripting
static String
SKIN_PATH_PREFIX_KEY
protected String
skinPathPrefix
protected WebLoader
webLoader
-
Constructor Summary
Constructors Constructor Description WebEngine(File root)
WebEngine(ResourceRegistry registry, File root)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addApplication(WebEngineModule app)
void
addResourceBinding(ResourceBinding binding)
Deprecated.resources are deprecated - you should use a jax-rs application to declare more resources.void
flushCache()
static WebContext
getActiveContext()
AnnotationManager
getAnnotationManager()
WebEngineModule[]
getApplications()
ResourceBinding[]
getBindings()
Deprecated.resources are deprecated - you should use a jax-rs application to declare more resources.File
getDeploymentDirectory()
Map<String,Object>
getEnvironment()
String
getMimeType(String ext)
Module
getModule(String name, WebContext context)
protected ModuleConfiguration
getModuleFromPath(String rootPath, String path)
ModuleManager
getModuleManager()
File
getModulesDirectory()
ResourceRegistry
getRegistry()
Deprecated.RenderingEngine
getRendering()
File
getResourceFile(String key)
Get a file resource given a keyURL
getResourceURL(String key)
Gets an URL resource given a keyFile
getRootDirectory()
Scripting
getScripting()
String
getSkinPathPrefix()
WebLoader
getWebLoader()
void
initJspRequestSupport(javax.servlet.GenericServlet servlet, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
boolean
isDirty()
Class<?>
loadClass(String className)
void
loadJspTaglib(javax.servlet.GenericServlet servlet)
JSP taglib supportvoid
registerRenderingExtension(String id, Object obj)
void
reload()
Reloads configuration.void
reloadModules()
void
removeResourceBinding(ResourceBinding binding)
Deprecated.resources are deprecated - you should use a jax-rs application to declare more resources.void
setDirty(boolean dirty)
void
setSkinPathPrefix(String skinPathPrefix)
void
start()
void
stop()
boolean
tryReload()
void
unregisterRenderingExtension(String id)
-
-
-
Field Detail
-
SKIN_PATH_PREFIX_KEY
public static final String SKIN_PATH_PREFIX_KEY
- See Also:
- Constant Field Values
-
root
protected final File root
-
apps
protected HashMap<String,WebEngineModule> apps
-
moduleMgr
protected volatile ModuleManager moduleMgr
moduleMgr use double-check idiom and needs to be volatile. See http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
-
scripting
protected final Scripting scripting
-
rendering
protected final RenderingEngine rendering
-
devMode
protected boolean devMode
-
annoMgr
protected final AnnotationManager annoMgr
-
registry
protected final ResourceRegistry registry
-
skinPathPrefix
protected String skinPathPrefix
-
webLoader
protected final WebLoader webLoader
-
isDirty
protected volatile boolean isDirty
-
-
Constructor Detail
-
WebEngine
public WebEngine(File root)
-
WebEngine
public WebEngine(ResourceRegistry registry, File root)
-
-
Method Detail
-
getActiveContext
public static WebContext getActiveContext()
-
loadJspTaglib
public void loadJspTaglib(javax.servlet.GenericServlet servlet)
JSP taglib support
-
initJspRequestSupport
public void initJspRequestSupport(javax.servlet.GenericServlet servlet, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
getWebLoader
public WebLoader getWebLoader()
-
setSkinPathPrefix
public void setSkinPathPrefix(String skinPathPrefix)
-
getSkinPathPrefix
public String getSkinPathPrefix()
-
getRegistry
@Deprecated public ResourceRegistry getRegistry()
Deprecated.
-
loadClass
public Class<?> loadClass(String className) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
getAnnotationManager
public AnnotationManager getAnnotationManager()
-
unregisterRenderingExtension
public void unregisterRenderingExtension(String id)
-
getScripting
public Scripting getScripting()
-
getApplications
public WebEngineModule[] getApplications()
-
addApplication
public void addApplication(WebEngineModule app)
-
getModuleManager
public ModuleManager getModuleManager()
-
getModule
public Module getModule(String name, WebContext context)
-
getRootDirectory
public File getRootDirectory()
-
getDeploymentDirectory
public File getDeploymentDirectory()
-
getModulesDirectory
public File getModulesDirectory()
-
getRendering
public RenderingEngine getRendering()
-
addResourceBinding
@Deprecated public void addResourceBinding(ResourceBinding binding)
Deprecated.resources are deprecated - you should use a jax-rs application to declare more resources.Manage jax-rs root resource bindings
-
removeResourceBinding
@Deprecated public void removeResourceBinding(ResourceBinding binding)
Deprecated.resources are deprecated - you should use a jax-rs application to declare more resources.
-
getBindings
@Deprecated public ResourceBinding[] getBindings()
Deprecated.resources are deprecated - you should use a jax-rs application to declare more resources.
-
setDirty
public void setDirty(boolean dirty)
-
tryReload
public boolean tryReload()
-
isDirty
public boolean isDirty()
-
flushCache
public void flushCache()
-
reload
public void reload()
Reloads configuration.
-
reloadModules
public void reloadModules()
-
start
public void start()
-
stop
public void stop()
-
getModuleFromPath
protected ModuleConfiguration getModuleFromPath(String rootPath, String path)
-
getResourceURL
public URL getResourceURL(String key)
Description copied from interface:ResourceLocator
Gets an URL resource given a key- Specified by:
getResourceURL
in interfaceResourceLocator
- Parameters:
key
- the resource key- Returns:
- the resource URL or null if no such result was found
-
getResourceFile
public File getResourceFile(String key)
Description copied from interface:ResourceLocator
Get a file resource given a key- Specified by:
getResourceFile
in interfaceResourceLocator
-
-