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 AnnotationManagerannoMgrprotected HashMap<String,WebEngineModule>appsprotected booleandevModeprotected Map<String,Object>envprotected booleanisDirtyprotected static Map<Object,Object>mimeTypesprotected ModuleManagermoduleMgrmoduleMgr use double-check idiom and needs to be volatile.protected ResourceRegistryregistryprotected RenderingEnginerenderingprotected Filerootprotected Scriptingscriptingstatic StringSKIN_PATH_PREFIX_KEYprotected StringskinPathPrefixprotected WebLoaderwebLoader
-
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 voidaddApplication(WebEngineModule app)voidaddResourceBinding(ResourceBinding binding)Deprecated.resources are deprecated - you should use a jax-rs application to declare more resources.voidflushCache()static WebContextgetActiveContext()AnnotationManagergetAnnotationManager()WebEngineModule[]getApplications()ResourceBinding[]getBindings()Deprecated.resources are deprecated - you should use a jax-rs application to declare more resources.FilegetDeploymentDirectory()Map<String,Object>getEnvironment()StringgetMimeType(String ext)ModulegetModule(String name, WebContext context)protected ModuleConfigurationgetModuleFromPath(String rootPath, String path)ModuleManagergetModuleManager()FilegetModulesDirectory()ResourceRegistrygetRegistry()Deprecated.RenderingEnginegetRendering()FilegetResourceFile(String key)Get a file resource given a keyURLgetResourceURL(String key)Gets an URL resource given a keyFilegetRootDirectory()ScriptinggetScripting()StringgetSkinPathPrefix()WebLoadergetWebLoader()voidinitJspRequestSupport(javax.servlet.GenericServlet servlet, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)booleanisDirty()Class<?>loadClass(String className)voidloadJspTaglib(javax.servlet.GenericServlet servlet)JSP taglib supportvoidregisterRenderingExtension(String id, Object obj)voidreload()Reloads configuration.voidreloadModules()voidremoveResourceBinding(ResourceBinding binding)Deprecated.resources are deprecated - you should use a jax-rs application to declare more resources.voidsetDirty(boolean dirty)voidsetSkinPathPrefix(String skinPathPrefix)voidstart()voidstop()booleantryReload()voidunregisterRenderingExtension(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:ResourceLocatorGets an URL resource given a key- Specified by:
getResourceURLin 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:ResourceLocatorGet a file resource given a key- Specified by:
getResourceFilein interfaceResourceLocator
-
-