Class AntWebAppContext

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.server.handler.AbstractHandler
org.eclipse.jetty.server.handler.AbstractHandlerContainer
org.eclipse.jetty.server.handler.HandlerWrapper
org.eclipse.jetty.server.handler.ScopedHandler
org.eclipse.jetty.server.handler.ContextHandler
org.eclipse.jetty.servlet.ServletContextHandler
org.eclipse.jetty.webapp.WebAppContext
org.eclipse.jetty.ant.AntWebAppContext
All Implemented Interfaces:
org.eclipse.jetty.server.Handler, org.eclipse.jetty.server.HandlerContainer, org.eclipse.jetty.util.Attributes, org.eclipse.jetty.util.ClassVisibilityChecker, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.Graceful, org.eclipse.jetty.util.component.LifeCycle, org.eclipse.jetty.webapp.WebAppClassLoader.Context

public class AntWebAppContext extends org.eclipse.jetty.webapp.WebAppContext
Extension of WebAppContext to allow configuration via Ant environment.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    AntServletHandler
    static class 
    AntServletHolder
    static class 
    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

    org.eclipse.jetty.webapp.WebAppContext.Context

    Nested classes/interfaces inherited from class org.eclipse.jetty.servlet.ServletContextHandler

    org.eclipse.jetty.servlet.ServletContextHandler.Initializer, org.eclipse.jetty.servlet.ServletContextHandler.JspConfig, org.eclipse.jetty.servlet.ServletContextHandler.JspPropertyGroup, org.eclipse.jetty.servlet.ServletContextHandler.ServletContainerInitializerCaller, org.eclipse.jetty.servlet.ServletContextHandler.ServletContainerInitializerStarter, org.eclipse.jetty.servlet.ServletContextHandler.TagLib

    Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.ContextHandler

    org.eclipse.jetty.server.handler.ContextHandler.AliasCheck, org.eclipse.jetty.server.handler.ContextHandler.ApproveAliases, org.eclipse.jetty.server.handler.ContextHandler.ApproveNonExistentDirectoryAliases, org.eclipse.jetty.server.handler.ContextHandler.Availability, org.eclipse.jetty.server.handler.ContextHandler.ContextScopeListener, org.eclipse.jetty.server.handler.ContextHandler.ContextStatus, org.eclipse.jetty.server.handler.ContextHandler.StaticContext

    Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler

    org.eclipse.jetty.server.handler.AbstractHandler.ErrorDispatchHandler

    Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Attributes

    org.eclipse.jetty.util.Attributes.Wrapper

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

    org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

    org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Graceful

    org.eclipse.jetty.util.component.Graceful.Shutdown, org.eclipse.jetty.util.component.Graceful.ThrowingRunnable

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class org.eclipse.jetty.webapp.WebAppContext

    __dftServerClasses, __dftSystemClasses, BASETEMPDIR, ERROR_PAGE, SERVER_SRV_CLASSES, SERVER_SYS_CLASSES, TEMPDIR, WEB_DEFAULTS_XML

    Fields inherited from class org.eclipse.jetty.servlet.ServletContextHandler

    _defaultSecurityHandlerClass, _jspConfig, _objFactory, _options, _securityHandler, _servletHandler, _sessionHandler, 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

    Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    FAILED, STARTED, STARTING, STOPPED, STOPPING

    Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

    KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
    AntWebAppContext(org.apache.tools.ant.Project project)
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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
     
    void
     
    static void
    dump(ClassLoader loader)
     
     
     
     
     
     
     
     
     
    boolean
     
    protected org.eclipse.jetty.servlet.ServletHandler
     
    void
    setContextXml(File contextXml)
     
    void
    setJettyEnvXml(File jettyEnvXml)
     
    void
    setWar(String path)
     

    Methods inherited from class org.eclipse.jetty.webapp.WebAppContext

    addConfiguration, addOverrideDescriptor, addServerClasses, addServerClassMatcher, addSystemClasses, addSystemClassMatcher, configure, destroy, dump, getConfiguration, getConfigurationClasses, getConfigurations, getCurrentWebAppContext, getDefaultsDescriptor, getDescriptor, getExtraClasspath, getMetaData, getOverrideDescriptor, getOverrideDescriptors, getPermissions, getResource, getResourceAlias, getResourceAliases, getServerClasses, getServerClassMatcher, getSystemClasses, getSystemClassMatcher, getTempDirectory, getUnavailableException, getWar, getWebInf, isAllowDuplicateFragmentNames, isConfigurationDiscovered, isCopyWebDir, isCopyWebInf, isDistributable, isExtractWAR, isLogUrlOnStart, isParentLoaderPriority, isPersistTempDirectory, isServerClass, isServerResource, isSystemClass, isSystemResource, isThrowUnavailableOnStartupException, loadConfigurations, newConfigurations, postConfigure, preConfigure, removeConfiguration, removeConfiguration, removeEventListener, removeResourceAlias, setAllowDuplicateFragmentNames, setClassLoader, setConfigurationClasses, setConfigurationClasses, setConfigurationDiscovered, setConfigurations, setContextWhiteList, setCopyWebDir, setCopyWebInf, setDefaultsDescriptor, setDescriptor, setDisplayName, setDistributable, setExtraClasspath, setExtraClasspath, setExtractWAR, setLogUrlOnStart, setOverrideDescriptor, setOverrideDescriptors, setParentLoaderPriority, setPermissions, setPersistTempDirectory, setResourceAlias, setResourceAliases, setServer, setServerClassMatcher, setServletSecurity, setSystemClassMatcher, setTempDirectory, setThrowUnavailableOnStartupException, setWarResource, startContext, stopContext, toString

    Methods inherited from class org.eclipse.jetty.servlet.ServletContextHandler

    addEventListener, addFilter, addFilter, addFilter, addRoles, addServlet, addServlet, addServlet, addServletContainerInitializer, addServletContainerInitializer, addServletContainerInitializer, callContextDestroyed, callContextInitialized, dynamicHolderAdded, getDefaultSecurityHandlerClass, getObjectFactory, getSecurityHandler, getServletContextHandler, getServletContextHandler, getServletHandler, getSessionHandler, insertHandler, newSecurityHandler, newSessionHandler, setDefaultSecurityHandlerClass, setGzipHandler, setHandler, setParent, 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, getDefaultRequestCharacterEncoding, getDefaultResponseCharacterEncoding, getDisplayName, getErrorHandler, getInitParameter, getInitParameterNames, getInitParams, getLocaleEncoding, getLocaleEncoding, getLocaleEncodings, getLogger, getMaxFormContentSize, getMaxFormKeys, getMimeTypes, getProtectedTargets, getRequestContextPath, getResourceBase, getResourcePaths, getServerInfo, getServletContext, getVirtualHosts, getWelcomeFiles, handle, handle, isAvailable, isCompactPath, isContextPathDefault, isDurableListener, isProgrammaticListener, isProtectedTarget, isShutdown, isUsingSecurityManager, loadClass, newResource, newResource, newResource, removeAttribute, removeVirtualHosts, requestDestroyed, requestInitialized, setAliasChecks, setAllowNullPathInfo, setAttribute, setAttributes, setAvailable, setBaseResource, setCompactPath, setContextPath, setDefaultContextPath, setDefaultRequestCharacterEncoding, setDefaultResponseCharacterEncoding, setErrorHandler, setInitParameter, setLogger, 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

    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, addManaged, contains, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans

    Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, 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.Container

    getCachedBeans, getEventListeners

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

    dumpSelf

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    isDumpable

    Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

    isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop

    Methods inherited from interface org.eclipse.jetty.webapp.WebAppClassLoader.Context

    newResource
  • Field Details

    • DEFAULT_CONTAINER_INCLUDE_JAR_PATTERN

      public static final String DEFAULT_CONTAINER_INCLUDE_JAR_PATTERN
      See Also:
  • Constructor Details

    • AntWebAppContext

      public AntWebAppContext(org.apache.tools.ant.Project project) throws Exception
      Default constructor. Takes project as an argument
      Parameters:
      project - the project.
      Throws:
      Exception - if unable to create webapp context
  • Method Details

    • dump

      public static void dump(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 org.eclipse.jetty.servlet.ServletHandler newServletHandler()
      Overrides:
      newServletHandler in class org.eclipse.jetty.servlet.ServletContextHandler
    • setJettyEnvXml

      public void setJettyEnvXml(File jettyEnvXml)
    • getJettyEnvXml

      public File getJettyEnvXml()
    • getLibraries

      public List<File> getLibraries()
    • addScanTargets

      public void addScanTargets(org.apache.tools.ant.types.FileSet scanTargets)
    • getScanTargetFiles

      public List<File> getScanTargetFiles()
    • getScanFiles

      public List<File> getScanFiles()
    • isScanned

      public boolean isScanned(File file)
    • initScanFiles

      public List<File> initScanFiles()
    • setWar

      public void setWar(String path)
      Overrides:
      setWar in class org.eclipse.jetty.webapp.WebAppContext
    • doStart

      public void doStart()
      Overrides:
      doStart in class org.eclipse.jetty.webapp.WebAppContext
    • doStop

      public void doStop()
      Overrides:
      doStop in class org.eclipse.jetty.servlet.ServletContextHandler
    • getClassPathFiles

      public List<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 File getContextXml()
    • setContextXml

      public void setContextXml(File contextXml)