Configuration
public class WebInfConfiguration extends AbstractConfiguration
Modifier and Type | Class | Description |
---|---|---|
class |
WebInfConfiguration.ContainerPathNameMatcher |
ContainerPathNameMatcher
Matches names of jars on the container classpath
against a pattern.
|
class |
WebInfConfiguration.WebAppPathNameMatcher |
WebAppPathNameMatcher
Matches names of jars or dirs on the webapp classpath
against a pattern.
|
Configuration.ClassList
Modifier and Type | Field | Description |
---|---|---|
protected Resource |
_preUnpackBaseResource |
|
static java.lang.String |
CONTAINER_JAR_PATTERN |
|
static java.lang.String |
RESOURCE_DIRS |
If set, to a list of URLs, these resources are added to the context
resource base as a resource collection.
|
static java.lang.String |
TEMPDIR_CONFIGURED |
|
static java.lang.String |
WEBINF_JAR_PATTERN |
ATTR
Constructor | Description |
---|---|
WebInfConfiguration() |
Modifier and Type | Method | Description |
---|---|---|
void |
cloneConfigure(WebAppContext template,
WebAppContext context) |
Clone configuration instance.
|
void |
configure(WebAppContext context) |
Configure WebApp.
|
void |
configureTempDirectory(java.io.File dir,
WebAppContext context) |
|
void |
deconfigure(WebAppContext context) |
DeConfigure WebApp.
|
void |
findAndFilterContainerPaths(WebAppContext context) |
Find jars and directories that are on the container's classpath
and apply an optional filter.
|
void |
findAndFilterWebAppPaths(WebAppContext context) |
Finds the jars that are either physically or virtually in
WEB-INF/lib, and applies an optional filter to their full
pathnames.
|
protected java.util.List<Resource> |
findClassDirs(WebAppContext context) |
|
protected java.util.List<Resource> |
findExtraClasspathDirs(WebAppContext context) |
Get class dirs from WebAppContext.getExtraClasspath as resources
|
protected java.util.List<Resource> |
findExtraClasspathJars(WebAppContext context) |
Get jars from WebAppContext.getExtraClasspath as resources
|
protected java.util.List<Resource> |
findJars(WebAppContext context) |
Look for jars that should be treated as if they are in WEB-INF/lib
|
protected Resource |
findWebInfClassesDir(WebAppContext context) |
Get
WEB-INF/classes dir |
protected java.util.List<Resource> |
findWebInfLibJars(WebAppContext context) |
Look for jars in
WEB-INF/lib |
static java.lang.String |
getCanonicalNameForWebAppTmpDir(WebAppContext context) |
Create a canonical name for a webapp temp directory.
|
void |
makeTempDirectory(java.io.File parent,
WebAppContext context) |
|
void |
preConfigure(WebAppContext context) |
Set up for configuration.
|
void |
resolveTempDirectory(WebAppContext context) |
Get a temporary directory in which to unpack the war etc etc.
|
void |
unpack(WebAppContext context) |
destroy, postConfigure
public static final java.lang.String TEMPDIR_CONFIGURED
public static final java.lang.String CONTAINER_JAR_PATTERN
public static final java.lang.String WEBINF_JAR_PATTERN
public static final java.lang.String RESOURCE_DIRS
protected Resource _preUnpackBaseResource
public void preConfigure(WebAppContext context) throws java.lang.Exception
Configuration
Typically this step discovers configuration resources
preConfigure
in interface Configuration
preConfigure
in class AbstractConfiguration
context
- The context to configurejava.lang.Exception
- if unable to pre configurepublic void findAndFilterContainerPaths(WebAppContext context) throws java.lang.Exception
context
- the WebAppContext being deployedjava.lang.Exception
- if unable to apply optional filtering on the container's classpathpublic void findAndFilterWebAppPaths(WebAppContext context) throws java.lang.Exception
context
- the WebAppContext being deployedjava.lang.Exception
- if unable to find the jars or apply filteringpublic void configure(WebAppContext context) throws java.lang.Exception
Configuration
Typically this step applies the discovered configuration resources to
either the WebAppContext
or the associated MetaData
.
configure
in interface Configuration
configure
in class AbstractConfiguration
context
- The context to configurejava.lang.Exception
- if unable to configurepublic void deconfigure(WebAppContext context) throws java.lang.Exception
Configuration
deconfigure
in interface Configuration
deconfigure
in class AbstractConfiguration
context
- The context to configurejava.lang.Exception
- if unable to deconfigurepublic void cloneConfigure(WebAppContext template, WebAppContext context) throws java.lang.Exception
Configuration
Configure an instance of a WebAppContext, based on a template WebAppContext that has previously been configured by this Configuration.
cloneConfigure
in interface Configuration
cloneConfigure
in class AbstractConfiguration
template
- The template contextcontext
- The context to configurejava.lang.Exception
- if unable to cloneAbstractConfiguration.cloneConfigure(org.eclipse.jetty.webapp.WebAppContext, org.eclipse.jetty.webapp.WebAppContext)
public void resolveTempDirectory(WebAppContext context) throws java.lang.Exception
A. Try to use an explicit directory specifically for this webapp:
B. Create a directory based on global settings. The new directory
will be called "Jetty-"+host+"-"+port+"__"+context+"-"+virtualhost+"-"+randomdigits+".dir"
If the user has specified the context attribute org.eclipse.jetty.webapp.basetempdir, the
directory specified by this attribute will be the parent of the temp dir created. Otherwise,
the parent dir is ${java.io.tmpdir}
. Set delete on exit depends on value of persistTempDirectory.
context
- the context to resolve the temp directory fromjava.lang.Exception
- if unable to resolve the temp directorypublic void makeTempDirectory(java.io.File parent, WebAppContext context) throws java.lang.Exception
java.lang.Exception
public void configureTempDirectory(java.io.File dir, WebAppContext context)
public void unpack(WebAppContext context) throws java.io.IOException
java.io.IOException
public static java.lang.String getCanonicalNameForWebAppTmpDir(WebAppContext context)
The form of the name is:
"jetty-"+host+"-"+port+"-"+resourceBase+"-_"+context+"-"+virtualhost+"-"+randomdigits+".dir"host and port uniquely identify the server context and virtual host uniquely identify the webapp randomdigits ensure every tmp directory is unique
context
- the context to get the canonical name fromprotected java.util.List<Resource> findClassDirs(WebAppContext context) throws java.lang.Exception
java.lang.Exception
protected java.util.List<Resource> findJars(WebAppContext context) throws java.lang.Exception
context
- the context to find the jars injava.lang.Exception
- if unable to find the jarsprotected java.util.List<Resource> findWebInfLibJars(WebAppContext context) throws java.lang.Exception
WEB-INF/lib
context
- the context to find the lib jars inResource
, or nulljava.lang.Exception
- if unable to scan for lib jarsprotected java.util.List<Resource> findExtraClasspathJars(WebAppContext context) throws java.lang.Exception
context
- the context to find extra classpath jars injava.lang.Exception
- if unable to find the extra classpath jarsprotected Resource findWebInfClassesDir(WebAppContext context) throws java.lang.Exception
WEB-INF/classes
dircontext
- the context to look for the WEB-INF/classes
directoryWEB-INF/classes
directoryjava.lang.Exception
- if unable to find the WEB-INF/classes
directoryprotected java.util.List<Resource> findExtraClasspathDirs(WebAppContext context) throws java.lang.Exception
context
- the context to look for extra classpaths injava.lang.Exception
- if unable to find the extra classpathsCopyright © 1995–2018 Webtide. All rights reserved.