Package org.eclipse.jetty.ant
Class AntWebAppContext
- java.lang.Object
-
- All Implemented Interfaces:
Handler
,HandlerContainer
,Attributes
,ClassVisibilityChecker
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,Graceful
,LifeCycle
,WebAppClassLoader.Context
public class AntWebAppContext extends WebAppContext
Extension of WebAppContext to allow configuration via Ant environment.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AntWebAppContext.AntServletHandler
AntServletHandlerstatic class
AntWebAppContext.AntServletHolder
AntServletHolderstatic class
AntWebAppContext.AntURLClassLoader
AntURLClassLoader Adapt the AntClassLoader which is not a URLClassLoader - this is needed for jsp to be able to search the classpath.-
Nested classes/interfaces inherited from class org.eclipse.jetty.webapp.WebAppContext
WebAppContext.Context
-
Nested classes/interfaces inherited from class org.eclipse.jetty.servlet.ServletContextHandler
ServletContextHandler.Decorator, ServletContextHandler.Initializer, ServletContextHandler.JspConfig, ServletContextHandler.JspPropertyGroup, ServletContextHandler.ServletContainerInitializerCaller, ServletContextHandler.TagLib
-
Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.ContextHandler
ContextHandler.AliasCheck, ContextHandler.ApproveAliases, ContextHandler.ApproveNonExistentDirectoryAliases, ContextHandler.Availability, ContextHandler.ContextScopeListener, ContextHandler.ContextStatus, ContextHandler.StaticContext
-
Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler
AbstractHandler.ErrorDispatchHandler
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Attributes
Attributes.Wrapper
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Graceful
Graceful.Shutdown
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Field Summary
Fields Modifier and Type Field Description static AnnotationConfiguration
ANNOTATION_CONFIGURATION
static AntWebInfConfiguration
ANT_WEB_INF_CONFIGURATION
static Configuration[]
DEFAULT_CONFIGURATIONS
static java.lang.String
DEFAULT_CONTAINER_INCLUDE_JAR_PATTERN
static EnvConfiguration
ENV_CONFIGURATION
static FragmentConfiguration
FRAGMENT_CONFIGURATION
static JettyWebXmlConfiguration
JETTY_WEB_XML_CONFIGURATION
static MetaInfConfiguration
META_INF_CONFIGURATION
static PlusConfiguration
PLUS_CONFIGURATION
static WebXmlConfiguration
WEB_XML_CONFIGURATION
-
Fields inherited from class org.eclipse.jetty.webapp.WebAppContext
__dftServerClasses, __dftSystemClasses, BASETEMPDIR, DEFAULT_CONFIGURATION_CLASSES, ERROR_PAGE, SERVER_SRV_CLASSES, SERVER_SYS_CLASSES, TEMPDIR, WEB_DEFAULTS_XML
-
Fields inherited from class org.eclipse.jetty.servlet.ServletContextHandler
_defaultSecurityHandlerClass, _gzipHandler, _jspConfig, _objFactory, _options, _securityHandler, _servletHandler, _sessionHandler, GZIP, NO_SECURITY, NO_SESSIONS, SECURITY, SESSIONS
-
Fields inherited from class org.eclipse.jetty.server.handler.ContextHandler
_contextStatus, _scontext, DEFAULT_LISTENER_TYPE_INDEX, DEFAULT_MAX_FORM_CONTENT_SIZE, DEFAULT_MAX_FORM_KEYS, EXTENDED_LISTENER_TYPE_INDEX, MANAGED_ATTRIBUTES, MAX_FORM_CONTENT_SIZE_KEY, MAX_FORM_KEYS_KEY, SERVLET_LISTENER_TYPES, SERVLET_MAJOR_VERSION, SERVLET_MINOR_VERSION
-
Fields inherited from class org.eclipse.jetty.server.handler.ScopedHandler
_nextScope, _outerScope
-
Fields inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
_handler
-
-
Constructor Summary
Constructors Constructor Description AntWebAppContext(org.apache.tools.ant.Project project)
Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttributes(Attributes atts)
Adds a new Ant's attributes tag object if it have not been created yet.void
addClasses(org.apache.tools.ant.types.FileSet classes)
void
addLib(org.apache.tools.ant.types.FileSet lib)
void
addScanTargets(org.apache.tools.ant.types.FileSet scanTargets)
void
doStart()
Starts the managed lifecycle beans in the order they were added.void
doStop()
Stops the managed lifecycle beans in the reverse order they were added.static void
dump(java.lang.ClassLoader loader)
java.util.List<java.io.File>
getClassPathFiles()
java.io.File
getContextXml()
java.io.File
getJettyEnvXml()
java.util.List
getLibraries()
FileMatchingConfiguration
getLibrariesConfiguration()
java.util.List<java.io.File>
getScanFiles()
java.util.List
getScanTargetFiles()
java.util.List<java.io.File>
initScanFiles()
boolean
isScanned(java.io.File file)
protected ServletHandler
newServletHandler()
void
setContextXml(java.io.File contextXml)
void
setJettyEnvXml(java.io.File jettyEnvXml)
void
setWar(java.lang.String path)
Set the war of the webapp.-
Methods inherited from class org.eclipse.jetty.webapp.WebAppContext
addOverrideDescriptor, addServerClass, addServerClasses, addSystemClass, addSystemClasses, configure, destroy, dump, getConfigurationClasses, getConfigurations, getCurrentWebAppContext, getDefaultConfigurationClasses, getDefaultsDescriptor, getDefaultServerClasses, getDefaultSystemClasses, getDescriptor, getExtraClasspath, getMetaData, getOverrideDescriptor, getOverrideDescriptors, getPermissions, getResource, getResourceAlias, getResourceAliases, getServerClasses, getServerClasspathPattern, getSystemClasses, getSystemClasspathPattern, getTempDirectory, getUnavailableException, getWar, getWebInf, isAllowDuplicateFragmentNames, isConfigurationDiscovered, isCopyWebDir, isCopyWebInf, isDistributable, isExtractWAR, isLogUrlOnStart, isParentLoaderPriority, isPersistTempDirectory, isServerClass, isServerClass, isServerResource, isSystemClass, isSystemClass, isSystemResource, isThrowUnavailableOnStartupException, loadConfigurations, loadServerClasses, loadSystemClasses, postConfigure, preConfigure, prependServerClass, prependSystemClass, removeEventListener, removeResourceAlias, setAllowDuplicateFragmentNames, setClassLoader, setConfigurationClasses, setConfigurationClasses, setConfigurationDiscovered, setConfigurations, setContextWhiteList, setCopyWebDir, setCopyWebInf, setDefaultsDescriptor, setDescriptor, setDisplayName, setDistributable, setEventListeners, setExtraClasspath, setExtractWAR, setLogUrlOnStart, setOverrideDescriptor, setOverrideDescriptors, setParentLoaderPriority, setPermissions, setPersistTempDirectory, setResourceAlias, setResourceAliases, setServer, setServerClasses, setServletSecurity, setSystemClasses, setTempDirectory, setThrowUnavailableOnStartupException, setWarResource, startContext, startWebapp, stopContext, stopWebapp, toString
-
Methods inherited from class org.eclipse.jetty.servlet.ServletContextHandler
addDecorator, addEventListener, addFilter, addFilter, addFilter, addRoles, addServlet, addServlet, addServlet, callContextDestroyed, callContextInitialized, dynamicHolderAdded, getDecorators, getDefaultSecurityHandlerClass, getGzipHandler, getObjectFactory, getSecurityHandler, getServletContextHandler, getServletHandler, getSessionHandler, insertHandler, newSecurityHandler, newSessionHandler, setDecorators, setDefaultSecurityHandlerClass, setGzipHandler, setHandler, setSecurityHandler, setServletHandler, setSessionHandler
-
Methods inherited from class org.eclipse.jetty.server.handler.ContextHandler
addAliasCheck, addLocaleEncoding, addProgrammaticListener, addVirtualHosts, checkAlias, checkContext, checkContextPath, checkVirtualHost, clearAliasChecks, clearAttributes, contextDestroyed, contextInitialized, doHandle, doScope, enterScope, exitScope, getAliasChecks, getAllowNullPathInfo, getAttribute, getAttributeNames, getAttributeNameSet, getAttributes, getBaseResource, getClassLoader, getClassPath, getContextHandler, getContextPath, getContextPathEncoded, getCurrentContext, getDisplayName, getErrorHandler, getEventListeners, getInitParameter, getInitParameterNames, getInitParams, getLocaleEncoding, getLocaleEncoding, getLocaleEncodings, getLogger, getMaxFormContentSize, getMaxFormKeys, getMimeTypes, getProtectedTargets, getRequestContextPath, getResourceBase, getResourcePaths, getServerInfo, getServletContext, getVirtualHosts, getWelcomeFiles, handle, handle, isAvailable, isCompactPath, isDurableListener, isProgrammaticListener, isProtectedTarget, isShutdown, isUsingSecurityManager, loadClass, newResource, newResource, newResource, removeAttribute, removeVirtualHosts, requestDestroyed, requestInitialized, setAliasChecks, setAllowNullPathInfo, setAttribute, setAttributes, setAvailable, setBaseResource, setCompactPath, setContextPath, setErrorHandler, setInitParameter, setLogger, setManagedAttribute, setMaxFormContentSize, setMaxFormKeys, setMimeTypes, setProtectedTargets, setResourceBase, setServerInfo, setUsingSecurityManager, setVirtualHosts, setWelcomeFiles, shutdown
-
Methods inherited from class org.eclipse.jetty.server.handler.ScopedHandler
handle, nextHandle, nextScope
-
Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
expandChildren, getHandler, getHandlers
-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer
doShutdown, expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass
-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
doError, getServer
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Methods inherited from interface org.eclipse.jetty.webapp.WebAppClassLoader.Context
newResource
-
-
-
-
Field Detail
-
ANT_WEB_INF_CONFIGURATION
public static final AntWebInfConfiguration ANT_WEB_INF_CONFIGURATION
-
WEB_XML_CONFIGURATION
public static final WebXmlConfiguration WEB_XML_CONFIGURATION
-
META_INF_CONFIGURATION
public static final MetaInfConfiguration META_INF_CONFIGURATION
-
FRAGMENT_CONFIGURATION
public static final FragmentConfiguration FRAGMENT_CONFIGURATION
-
ENV_CONFIGURATION
public static final EnvConfiguration ENV_CONFIGURATION
-
PLUS_CONFIGURATION
public static final PlusConfiguration PLUS_CONFIGURATION
-
ANNOTATION_CONFIGURATION
public static final AnnotationConfiguration ANNOTATION_CONFIGURATION
-
JETTY_WEB_XML_CONFIGURATION
public static final JettyWebXmlConfiguration JETTY_WEB_XML_CONFIGURATION
-
DEFAULT_CONFIGURATIONS
public static final Configuration[] DEFAULT_CONFIGURATIONS
-
DEFAULT_CONTAINER_INCLUDE_JAR_PATTERN
public static final java.lang.String DEFAULT_CONTAINER_INCLUDE_JAR_PATTERN
- See Also:
- Constant Field Values
-
-
Method Detail
-
dump
public static void dump(java.lang.ClassLoader loader)
-
addAttributes
public void addAttributes(Attributes atts)
Adds a new Ant's attributes tag object if it have not been created yet.- Parameters:
atts
- the attributes
-
addLib
public void addLib(org.apache.tools.ant.types.FileSet lib)
-
addClasses
public void addClasses(org.apache.tools.ant.types.FileSet classes)
-
newServletHandler
protected ServletHandler newServletHandler()
- Overrides:
newServletHandler
in classServletContextHandler
-
setJettyEnvXml
public void setJettyEnvXml(java.io.File jettyEnvXml)
-
getJettyEnvXml
public java.io.File getJettyEnvXml()
-
getLibraries
public java.util.List getLibraries()
-
addScanTargets
public void addScanTargets(org.apache.tools.ant.types.FileSet scanTargets)
-
getScanTargetFiles
public java.util.List getScanTargetFiles()
-
getScanFiles
public java.util.List<java.io.File> getScanFiles()
-
isScanned
public boolean isScanned(java.io.File file)
-
initScanFiles
public java.util.List<java.io.File> initScanFiles()
-
setWar
public void setWar(java.lang.String path)
Description copied from class:WebAppContext
Set the war of the webapp. From this value aContextHandler.setResourceBase(String)
value is computed byWebInfConfiguration
, which may be changed from the war URI by unpacking and/or copying.- Overrides:
setWar
in classWebAppContext
- Parameters:
path
- The war to set as a file name or URL.
-
doStart
public void doStart()
Description copied from class:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in classWebAppContext
- See Also:
AbstractHandler.doStart()
-
doStop
public void doStop()
Description copied from class:ContainerLifeCycle
Stops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStop
in classWebAppContext
- See Also:
ContextHandler.doStop()
-
getClassPathFiles
public java.util.List<java.io.File> getClassPathFiles()
- Returns:
- a list of classpath files (libraries and class directories).
-
getLibrariesConfiguration
public FileMatchingConfiguration getLibrariesConfiguration()
- Returns:
- a
FileMatchingConfiguration
object describing the configuration of all libraries added to this particular web app (both classes and libraries).
-
getContextXml
public java.io.File getContextXml()
-
setContextXml
public void setContextXml(java.io.File contextXml)
-
-