Package org.wicketstuff.offline.mode
Class ServiceWorker
- java.lang.Object
-
- org.apache.wicket.request.resource.ResourceReference
-
- org.apache.wicket.request.resource.PackageResourceReference
-
- org.apache.wicket.request.resource.JavaScriptResourceReference
-
- org.wicketstuff.offline.mode.ServiceWorker
-
- All Implemented Interfaces:
Serializable,IClusterable
public class ServiceWorker extends JavaScriptResourceReference
The actual service worker which applies the URLs of the offline cache entries to the client side cache with the given name.- Author:
- Tobias Soloschenko.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.ResourceReference
ResourceReference.Key, ResourceReference.LambdaResourceReference, ResourceReference.UrlAttributes
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedServiceWorker(String cacheName, List<OfflineCacheEntry> offlineCacheEntries)Creates the service worker
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<HeaderItem>getDependencies()static ServiceWorkergetInstance()Gets the current service worker instanceJavaScriptPackageResourcegetResource()If the service worker resource is shipped the first time the script is filled with the URLs of the resources to be cached.-
Methods inherited from class org.apache.wicket.request.resource.PackageResourceReference
getMinifiedName, getUrlAttributes, readBuffered, removeCompressFlagIfUnnecessary
-
Methods inherited from class org.apache.wicket.request.resource.ResourceReference
canBeRegistered, equals, getExtension, getKey, getLocale, getName, getScope, getStyle, getVariation, hashCode, of, of, toString
-
-
-
-
Constructor Detail
-
ServiceWorker
protected ServiceWorker(String cacheName, List<OfflineCacheEntry> offlineCacheEntries)
Creates the service worker- Parameters:
cacheName- the name of the cacheofflineCacheEntries- the entries to be cached
-
-
Method Detail
-
getInstance
public static ServiceWorker getInstance()
Gets the current service worker instance- Returns:
- the service worker instance
-
getResource
public JavaScriptPackageResource getResource()
If the service worker resource is shipped the first time the script is filled with the URLs of the resources to be cached.- Overrides:
getResourcein classJavaScriptResourceReference- Returns:
- the java script package resource to provide the script with the URLs to be cached
-
getDependencies
public List<HeaderItem> getDependencies()
- Overrides:
getDependenciesin classResourceReference
-
-