Configurationpublic 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 org.eclipse.jetty.util.resource.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<org.eclipse.jetty.util.resource.Resource> |
findClassDirs(WebAppContext context) |
|
protected java.util.List<org.eclipse.jetty.util.resource.Resource> |
findExtraClasspathDirs(WebAppContext context) |
Get class dirs from WebAppContext.getExtraClasspath as resources
|
protected java.util.List<org.eclipse.jetty.util.resource.Resource> |
findExtraClasspathJars(WebAppContext context) |
Get jars from WebAppContext.getExtraClasspath as resources
|
protected java.util.List<org.eclipse.jetty.util.resource.Resource> |
findJars(WebAppContext context) |
Look for jars that should be treated as if they are in WEB-INF/lib
|
protected org.eclipse.jetty.util.resource.Resource |
findWebInfClassesDir(WebAppContext context) |
Get
WEB-INF/classes dir |
protected java.util.List<org.eclipse.jetty.util.resource.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, postConfigurepublic 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 org.eclipse.jetty.util.resource.Resource _preUnpackBaseResource
public void preConfigure(WebAppContext context) throws java.lang.Exception
ConfigurationTypically this step discovers configuration resources
preConfigure in interface ConfigurationpreConfigure in class AbstractConfigurationcontext - 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 Configurationconfigure in class AbstractConfigurationcontext - The context to configurejava.lang.Exception - if unable to configurepublic void deconfigure(WebAppContext context) throws java.lang.Exception
Configurationdeconfigure in interface Configurationdeconfigure in class AbstractConfigurationcontext - The context to configurejava.lang.Exception - if unable to deconfigurepublic void cloneConfigure(WebAppContext template, WebAppContext context) throws java.lang.Exception
ConfigurationConfigure an instance of a WebAppContext, based on a template WebAppContext that has previously been configured by this Configuration.
cloneConfigure in interface ConfigurationcloneConfigure in class AbstractConfigurationtemplate - 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.Exceptionpublic void configureTempDirectory(java.io.File dir,
WebAppContext context)
public void unpack(WebAppContext context) throws java.io.IOException
java.io.IOExceptionpublic 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<org.eclipse.jetty.util.resource.Resource> findClassDirs(WebAppContext context) throws java.lang.Exception
java.lang.Exceptionprotected java.util.List<org.eclipse.jetty.util.resource.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<org.eclipse.jetty.util.resource.Resource> findWebInfLibJars(WebAppContext context) throws java.lang.Exception
WEB-INF/libcontext - the context to find the lib jars inResource, or nulljava.lang.Exception - if unable to scan for lib jarsprotected java.util.List<org.eclipse.jetty.util.resource.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 org.eclipse.jetty.util.resource.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<org.eclipse.jetty.util.resource.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.