Package com.vaadin.osgi.resources.impl
Class VaadinResourceServiceImpl
- java.lang.Object
-
- com.vaadin.osgi.resources.impl.VaadinResourceServiceImpl
-
- All Implemented Interfaces:
VaadinResourceService
public class VaadinResourceServiceImpl extends Object implements VaadinResourceService
Implementation ofVaadinResourceService. Uses bundle version as a prefix for the /VAADIN/ folder.- Since:
- 8.1
- Author:
- Vaadin Ltd.
-
-
Constructor Summary
Constructors Constructor Description VaadinResourceServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetContextName()Returns the http servlet context name of VaadinStringgetResourcePathPrefix()Returns the prefix of the versioned namespace for the resources.voidpublishResource(String resource, org.osgi.service.http.HttpService httpService)Register the resource with the given name under theVaadinResourceServiceversioned namespace.voidpublishTheme(String themeName, org.osgi.service.http.HttpService httpService)Register the theme with the given name under theVaadinResourceServiceversioned namespace.voidpublishWidgetset(String widgetset, org.osgi.service.http.HttpService httpService)Register the widgetset with the given name under theVaadinResourceServiceversioned namespace.voidstart(org.osgi.framework.BundleContext context)voidstop()
-
-
-
Method Detail
-
start
public void start(org.osgi.framework.BundleContext context) throws Exception- Throws:
Exception
-
stop
public void stop()
-
publishTheme
public void publishTheme(String themeName, org.osgi.service.http.HttpService httpService) throws org.osgi.service.http.NamespaceException
Description copied from interface:VaadinResourceServiceRegister the theme with the given name under theVaadinResourceServiceversioned namespace. The theme folder is expected to be compiled and under "/VAADIN/themes/" in the calling bundle. The theme will become accessible under the url "/vaadin-x.x.x/VAADIN/themes/themeName" where x.x.x is the version of the Vaadin Shared bundle- Specified by:
publishThemein interfaceVaadinResourceService- Parameters:
themeName- the name of the themehttpService- theHttpServiceinstance for the calling bundle- Throws:
org.osgi.service.http.NamespaceException- if there is a clash during the theme registration
-
publishResource
public void publishResource(String resource, org.osgi.service.http.HttpService httpService) throws org.osgi.service.http.NamespaceException
Description copied from interface:VaadinResourceServiceRegister the resource with the given name under theVaadinResourceServiceversioned namespace. The resource is expected to be under "/VAADIN/" in the calling bundle. The resource will become accessible under the url "/vaadin-x.x.x/VAADIN/" where x.x.x is the version of the Vaadin Shared bundle- Specified by:
publishResourcein interfaceVaadinResourceService- Parameters:
resource- the name of the resourcehttpService- theHttpServiceinstance for the calling bundle- Throws:
org.osgi.service.http.NamespaceException- if there is a clash during the theme registration
-
publishWidgetset
public void publishWidgetset(String widgetset, org.osgi.service.http.HttpService httpService) throws org.osgi.service.http.NamespaceException
Description copied from interface:VaadinResourceServiceRegister the widgetset with the given name under theVaadinResourceServiceversioned namespace. The resource is expected to be under "/VAADIN/widgetsets" in the calling bundle. The resource will become accessible under the url "/vaadin-x.x.x/VAADIN/widgetsets" where x.x.x is the version of the Vaadin Shared bundle- Specified by:
publishWidgetsetin interfaceVaadinResourceService- Parameters:
widgetset- the name of the resourcehttpService- theHttpServiceinstance for the calling bundle- Throws:
org.osgi.service.http.NamespaceException- if there is a clash during the theme registration
-
getResourcePathPrefix
public String getResourcePathPrefix()
Description copied from interface:VaadinResourceServiceReturns the prefix of the versioned namespace for the resources. The result can't be null and is of the format "vaadin-x.x.x" where x.x.x the version of the Vaadin Shared bundle.- Specified by:
getResourcePathPrefixin interfaceVaadinResourceService- Returns:
- the prefix of the resources folder managed by this service
-
getContextName
public String getContextName()
Description copied from interface:VaadinResourceServiceReturns the http servlet context name of Vaadin- Specified by:
getContextNamein interfaceVaadinResourceService- Returns:
- the context name
-
-