Provides the resources implementation for a web application. The org. of this class
should be aligned with that of the associated Context.
This implementation assumes that the base attribute supplied to
StandardRoot#createWebResourceSet(org.
represents the absolute path to a file.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final List | |
| private WebResourceRoot. | |
| private final Cache | |
| private ObjectName | |
| private boolean | |
| private final List | |
| private Context | |
| private final List | |
| private static final Log | |
| private WebResourceSet | |
| private final List | |
| private final List | |
| private final List | |
| protected static final StringManager | |
| private final Set | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public void | addJarResources(WebResourceSet
the resource set to use webResourceSet)Implements org. Adds the provided WebResourceSet to this web application as a 'Jar' resource. |
| public void | addPostResources(WebResourceSet
the resource set to use webResourceSet)Implements org. Adds the provided WebResourceSet to this web application as a 'Post' resource. |
| public void | addPreResources(WebResourceSet
the resource set to use webResourceSet)Implements org. Adds the provided WebResourceSet to this web application as a 'Pre' resource. |
| public void | backgroundProcess()
Implements org. This method will be invoked by the context on a periodic basis and allows the implementation a method that executes periodic tasks, such as purging expired cache entries. |
| protected WebResourceSet | |
| public void | createWebResourceSet(WebResourceRoot.
The type of type,WebResourceSet to createThe path within the web application that the
resources should be published at. It must start
with '/'. webAppMount, URL The URL of the resource (must locate a JAR, file or
directory) url, String The path within the resource where the content is to
be found. It must start with '/'. internalPath)Implements org. Creates a new |
| public void | createWebResourceSet(WebResourceRoot.
The type of type,WebResourceSet to createThe path within the web application that the
resources should be published at. It must start
with '/'. webAppMount, String The location of the resources base, String The path within the resource to the archive where
the content is to be found. If there is no
archive then this should be archivePath, String null.The path within the archive (or the resource if the
archivePath is internalPath)null where the
content is to be found. It must start with '/'.Implements org. Creates a new |
| public void | deregisterTrackedResource(TrackedWebResource
the resource that was tracked trackedResource)Implements org. Stop tracking specified resource, once it no longer needs to free resources. |
| protected void | destroyInternal()
Overrides org. Sub-classes wishing to perform additional clean-up should override this method, ensuring that super.destroyInternal() is the last call in the overriding method. |
| public void | gc()
Implements org. Implementations may cache some information to improve performance. |
| public boolean | getAllowLinking()
Implements org. Determine if this resources allow the use of symbolic links. |
| public String | getArchiveIndexStrategy()
Implements org. Get the strategy to use for the resources archive lookup. |
| public WebResourceRoot. | getArchiveIndexStrategyEnum()
Implements org. Get the strategy to use for the resources archive lookup. |
| public List | |
| public long | getCacheMaxSize()
Implements org. Get the maximum permitted size for the cache. |
| public int | getCacheObjectMaxSize()
Implements org. Get the maximum permitted size for a single object in the cache. |
| public WebResourceRoot. | getCacheStrategy()
Overrides default org. Obtain the current caching strategy. |
| public long | getCacheTtl()
Implements org. Get the Time-To-Live (TTL) for cache entries. |
| public WebResource | getClassLoaderResource(String
The path of the class loader resource of interest relative
to the the root of class loader resources for this web
application. path)Implements org. Obtain the object that represents the class loader resource at the given path. |
| public WebResource[] | getClassLoaderResources(String
The path for the class loader resource of interest relative
to the root of the class loader resources for the web
application. It must start with '/'. path)Implements org. Obtain the objects that represent the class loader resource at the given path. |
| protected WebResourceSet[] | |
| public Context | |
| protected String | getDomainInternal()
Implements abstract org. Method implemented by sub-classes to identify the domain in which MBeans should be registered. |
| public WebResourceSet[] | |
| protected String | getObjectNameKeyProperties()
Implements abstract org. Allow sub-classes to specify the key properties component of the
|
| public WebResourceSet[] | |
| public WebResourceSet[] | |
| public WebResource | getResource(String
The path for the resource of interest relative to the root
of the web application. It must start with '/'. path)Implements org. Obtain the object that represents the resource at the given path. |
| protected WebResource | |
| protected final WebResource | |
| public WebResource[] | getResources(String
The path for the resource of interest relative to the root
of the web application. It must start with '/'. path)Implements org. Obtain the objects that represent the resource at the given path. |
| private WebResource[] | |
| protected WebResource[] | |
| public List | |
| public boolean | getTrackLockedFiles()
Implements org. Has the track locked files feature been enabled? |
| protected void | initInternal()
Overrides org. Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method. |
| public boolean | |
| protected boolean | |
| public String[] | list(String
The path for the resource of interest relative to the root
of the web application. It must start with '/'. path)Implements org. Obtain the list of the names of all of the files and directories located in the specified directory. |
| private String[] | |
| public WebResource[] | listResources(String
The path for the resource of interest relative to the root
of the web application. It must start with '/'. path)Implements org. Obtain the list of all of the WebResources in the specified directory. |
| protected WebResource[] | |
| public Set | listWebAppPaths(String
The path for the resource of interest relative to the root
of the web application. It must start with '/'. path)Implements org. Obtain the Set of the web applications pathnames of all of the files and directories located in the specified directory. |
| public boolean | mkdir(String
The path for the new resource to create relative to the root
of the web application. It must start with '/'. path)Implements org. Create a new directory at the given path. |
| private boolean | |
| protected void | processWebInfLib()
Class loader resources are handled by treating JARs in WEB-INF/lib as resource JARs (without the internal META-INF/resources/ prefix) mounted at WEB-INF/classes (rather than the web app root). |
| public void | registerTrackedResource(TrackedWebResource
the resource that will be tracked trackedResource)Implements org. Add a specified resource to track to be able to later release resources on stop. |
| protected void | |
| public void | setAllowLinking(boolean
true if symbolic links are allowed.Implements org. Configure if this resources allow the use of symbolic links. |
| public void | setArchiveIndexStrategy(String
The strategy to use for the resources archive lookup archiveIndexStrategy)Implements org. Set the strategy to use for the resources archive lookup. |
| public void | setCacheMaxSize(long
Maximum cache size in kilobytes cacheMaxSize)Implements org. Set the maximum permitted size for the cache. |
| public void | setCacheObjectMaxSize(int
Maximum size for a single cached object in
kilobytes cacheObjectMaxSize)Implements org. Set the maximum permitted size for a single object in the cache. |
| public void | setCacheStrategy(WebResourceRoot.
The new strategy to use or strategynull for no strategyOverrides default org. Set the current caching strategy. |
| public void | setCacheTtl(long
TTL in milliseconds cacheTtl)Implements org. Set the Time-To-Live (TTL) for cache entries. |
| public void | setCachingAllowed(boolean
true to enable caching, else
falseImplements org. Set whether or not caching is permitted for this web application. |
| public void | setContext(Context
the associated context context)Implements org. Set the web application this WebResourceRoot is associated with. |
| protected final void | |
| public void | setTrackLockedFiles(boolean
true to enable it, false to
disable itImplements org. Controls whether the track locked files feature is enabled. |
| protected void | startInternal()
Implements abstract org. Sub-classes must ensure that the state is changed to
|
| protected void | stopInternal()
Implements abstract org. Sub-classes must ensure that the state is changed to
|
| private String | |
| public boolean | write(String
The path to be used for the new Resource. It is relative
to the root of the web application and must start with
'/'. path, InputStream The InputStream that will provide the content for the
new Resource. is, boolean If overwrite)true and the resource already exists it
will be overwritten. If false and the
resource already exists the write will fail.Implements org. Create a new resource at the requested path using the provided InputStream. |