Package org.nuxeo.ecm.webengine.jaxrs
Class ApplicationHost
- java.lang.Object
-
- javax.ws.rs.core.Application
-
- org.nuxeo.ecm.webengine.jaxrs.ApplicationHost
-
public class ApplicationHost extends javax.ws.rs.core.Application
A composite JAX-RS application that can receive fragments from outside.- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected List<ApplicationFragment>
apps
protected HashMap<Class<?>,org.osgi.framework.Bundle>
class2Bundles
Root resource classes to owner bundles.protected Map<String,ResourceExtension>
extensions
Sub-Resources extensionsprotected Map<String,Boolean>
features
protected List<Reloadable>
listeners
protected String
name
protected RenderingEngine
rendering
-
Constructor Summary
Constructors Constructor Description ApplicationHost(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(ApplicationFragment app)
void
addExtension(ResourceExtension xt)
void
addReloadListener(Reloadable listener)
ApplicationFragment[]
getApplications()
org.osgi.framework.Bundle
getBundle(Class<?> clazz)
Get the bundle declaring the given root class.Set<Class<?>>
getClasses()
ResourceExtension
getExtension(String id)
BundleResource
getExtension(BundleResource target, String segment)
ResourceExtension[]
getExtensions(ResourceExtension xt)
Map<String,Boolean>
getFeatures()
String
getName()
RenderingEngine
getRendering()
Set<Object>
getSingletons()
void
reload()
void
remove(ApplicationFragment app)
void
removeExtension(ResourceExtension xt)
void
removeReloadListener(Reloadable listener)
void
setRendering(RenderingEngine rendering)
-
-
-
Field Detail
-
name
protected final String name
-
apps
protected final List<ApplicationFragment> apps
-
listeners
protected List<Reloadable> listeners
-
rendering
protected RenderingEngine rendering
-
extensions
protected Map<String,ResourceExtension> extensions
Sub-Resources extensions
-
-
Constructor Detail
-
ApplicationHost
public ApplicationHost(String name)
-
-
Method Detail
-
getExtension
public BundleResource getExtension(BundleResource target, String segment)
-
getRendering
public RenderingEngine getRendering()
-
setRendering
public void setRendering(RenderingEngine rendering)
-
addExtension
public void addExtension(ResourceExtension xt)
-
removeExtension
public void removeExtension(ResourceExtension xt)
-
getExtension
public ResourceExtension getExtension(String id)
-
getExtensions
public ResourceExtension[] getExtensions(ResourceExtension xt)
-
getName
public String getName()
-
add
public void add(ApplicationFragment app)
-
remove
public void remove(ApplicationFragment app)
-
getApplications
public ApplicationFragment[] getApplications()
-
addReloadListener
public void addReloadListener(Reloadable listener)
-
removeReloadListener
public void removeReloadListener(Reloadable listener)
-
reload
public void reload()
-
getBundle
public org.osgi.framework.Bundle getBundle(Class<?> clazz)
Get the bundle declaring the given root class. This method is not synchronized since it is assumed to be called after the application was created and before it was destroyed.
When a bundle is refreshing this method may throw exceptions but it is not usual to refresh bundles at runtime and making requests in same time.
-
getClasses
public Set<Class<?>> getClasses()
- Overrides:
getClasses
in classjavax.ws.rs.core.Application
-
-