class WebPublishingService extends Object
Modifier and Type | Class and Description |
---|---|
private class |
WebPublishingService.BundleResourcesHTTPContext |
private class |
WebPublishingService.FileSystemHTTPContext |
Modifier and Type | Field and Description |
---|---|
private int |
classCount |
private boolean |
isJerseyServletRegistered |
private com.sun.jersey.api.core.ResourceConfig |
jerseyApplication |
private com.sun.jersey.spi.container.servlet.ServletContainer |
jerseyServlet |
private Logger |
logger |
private PersistenceLayer |
pl |
private static String |
ROOT_APPLICATION_PATH |
private int |
singletonCount |
Constructor and Description |
---|
WebPublishingService(PersistenceLayer pl,
WebSocketsService ws) |
Modifier and Type | Method and Description |
---|---|
private void |
addToApplication(List<Object> singletons,
List<Class<?>> classes) |
private Set<Class<?>> |
getClasses() |
private org.osgi.service.http.HttpService |
getHttpService() |
private Set<Object> |
getSingletons() |
(package private) String |
getUriNamespace(Object object) |
private boolean |
hasRootResources() |
(package private) boolean |
isProviderClass(Class clazz) |
(package private) boolean |
isRootResource(Object object) |
private void |
logResourceInfo() |
(package private) StaticResourcesPublication |
publishFileSystem(String uriNamespace,
String path)
Publishes a directory of the server's file system.
|
(package private) RestResourcesPublication |
publishRestResources(List<Object> singletons,
List<Class<?>> classes)
Publishes REST resources.
|
(package private) StaticResourcesPublication |
publishWebResources(String uriNamespace,
org.osgi.framework.Bundle bundle)
Publishes the bundle's web resources.
|
private void |
registerJerseyServlet() |
private void |
reloadJerseyServlet() |
private void |
removeFromApplication(List<Object> singletons,
List<Class<?>> classes) |
private boolean |
staticResourceFilter(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
(package private) void |
unpublishRestResources(List<Object> singletons,
List<Class<?>> classes) |
(package private) void |
unpublishStaticResources(String uriNamespace) |
private void |
unregisterJerseyServlet() |
private static final String ROOT_APPLICATION_PATH
private com.sun.jersey.api.core.ResourceConfig jerseyApplication
private int classCount
private int singletonCount
private com.sun.jersey.spi.container.servlet.ServletContainer jerseyServlet
private boolean isJerseyServletRegistered
private PersistenceLayer pl
WebPublishingService(PersistenceLayer pl, WebSocketsService ws)
StaticResourcesPublication publishWebResources(String uriNamespace, org.osgi.framework.Bundle bundle) throws org.osgi.service.http.NamespaceException
org.osgi.service.http.NamespaceException
StaticResourcesPublication publishFileSystem(String uriNamespace, String path) throws org.osgi.service.http.NamespaceException
path
- An absolute path to the directory to be published.org.osgi.service.http.NamespaceException
void unpublishStaticResources(String uriNamespace)
RestResourcesPublication publishRestResources(List<Object> singletons, List<Class<?>> classes)
Note: synchronizing prevents creation of multiple Jersey servlet instances due to parallel plugin initialization.
singletons
- the set of root resource and provider singletons, may be empty.classes
- the set of root resource and provider classes, may be empty.void unpublishRestResources(List<Object> singletons, List<Class<?>> classes)
boolean isRootResource(Object object)
String getUriNamespace(Object object)
boolean isProviderClass(Class clazz)
private org.osgi.service.http.HttpService getHttpService()
private void addToApplication(List<Object> singletons, List<Class<?>> classes)
private void removeFromApplication(List<Object> singletons, List<Class<?>> classes)
private boolean hasRootResources()
private void logResourceInfo()
private Set<Class<?>> getClasses()
private Set<Object> getSingletons()
private void registerJerseyServlet()
private void unregisterJerseyServlet()
private void reloadJerseyServlet()
private boolean staticResourceFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
IOException
Copyright © 2018. All Rights Reserved.