com.vaadin.osgi.resources.impl.
Class VaadinResourceServiceImpl
- java.lang.Object
-
- com.vaadin.osgi.resources.impl.VaadinResourceServiceImpl
-
All Implemented Interfaces:
public class VaadinResourceServiceImpl extends Object implements VaadinResourceService
Implementation of
VaadinResourceService
. 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 Modifier and Type Method Description String
getContextName()
Returns the http servlet context name of Vaadin
String
getResourcePathPrefix()
Returns the prefix of the versioned namespace for the resources.
void
publishResource(String resource, org.osgi.service.http.HttpService httpService)
Register the resource with the given name under the
VaadinResourceService
versioned namespace.void
publishTheme(String themeName, org.osgi.service.http.HttpService httpService)
Register the theme with the given name under the
VaadinResourceService
versioned namespace.void
publishWidgetset(String widgetset, org.osgi.service.http.HttpService httpService)
Register the widgetset with the given name under the
VaadinResourceService
versioned namespace.void
start(org.osgi.framework.BundleContext context)
void
stop()
-
-
-
Method Detail
-
start
public void start(org.osgi.framework.BundleContext context) throws Exception
Throws:
-
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:
VaadinResourceService
Register the theme with the given name under the
VaadinResourceService
versioned 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 bundleSpecified by:
publishTheme
in interfaceVaadinResourceService
Parameters:
themeName
- the name of the themehttpService
- theHttpService
instance for the calling bundleThrows:
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:
VaadinResourceService
Register the resource with the given name under the
VaadinResourceService
versioned 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 bundleSpecified by:
publishResource
in interfaceVaadinResourceService
Parameters:
resource
- the name of the resourcehttpService
- theHttpService
instance for the calling bundleThrows:
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:
VaadinResourceService
Register the widgetset with the given name under the
VaadinResourceService
versioned 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 bundleSpecified by:
publishWidgetset
in interfaceVaadinResourceService
Parameters:
widgetset
- the name of the resourcehttpService
- theHttpService
instance for the calling bundleThrows:
org.osgi.service.http.NamespaceException
- if there is a clash during the theme registration
-
getResourcePathPrefix
public String getResourcePathPrefix()
Description copied from interface:
VaadinResourceService
Returns 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:
getResourcePathPrefix
in interfaceVaadinResourceService
Returns:
the prefix of the resources folder managed by this service
-
getContextName
public String getContextName()
Description copied from interface:
VaadinResourceService
Returns the http servlet context name of Vaadin
Specified by:
getContextName
in interfaceVaadinResourceService
Returns:
the context name
-
-