Package org.eclipse.jetty.maven.plugin
Class MavenWebAppContext
java.lang.Object
- All Implemented Interfaces:
Handler
,HandlerContainer
,Attributes
,ClassVisibilityChecker
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,Graceful
,LifeCycle
,WebAppClassLoader.Context
MavenWebAppContext
Extends the WebAppContext to specialize for the maven environment. We pass in
the list of files that should form the classpath for the webapp when
executing in the plugin, and any jetty-env.xml file that may have been
configured.
-
Nested Class Summary
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.Initializer, ServletContextHandler.JspConfig, ServletContextHandler.JspPropertyGroup, ServletContextHandler.ServletContainerInitializerCaller, ServletContextHandler.ServletContainerInitializerStarter, 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, AbstractLifeCycle.StopException
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, Graceful.ThrowingRunnable
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddPattern
(String s, String pattern) 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.boolean
getResource
(String pathInContext) Attempt to get a Resource from the Context.getResourcePaths
(String path) void
initCDI()
protected Configurations
void
setBaseAppFirst
(boolean value) void
setClasses
(File dir) void
setContainerIncludeJarPattern
(String pattern) void
setExtraClasspath
(String extraClasspath) Set the Extra ClassPath via delimited String.void
setJettyEnvXml
(String jettyEnvXml) void
setOriginAttribute
(String name) Set the name of the attribute that is used in each generated xml element to indicate the source of the xml element (eg annotation, web.xml etc).void
setOverlays
(List<Overlay> overlays) Ordered list of wars to overlay on top of the current project.void
setResourceBases
(String[] resourceBases) This method is provided as a convenience for jetty maven plugin configurationvoid
setTestClasses
(File dir) void
setWebInfIncludeJarPattern
(String pattern) void
setWebInfLib
(List<File> jars) 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, 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, postConfigure, preConfigure, removeConfiguration, removeConfiguration, removeEventListener, removeResourceAlias, setAllowDuplicateFragmentNames, setClassLoader, setConfigurationClasses, setConfigurationClasses, setConfigurationDiscovered, setConfigurations, setContextWhiteList, setCopyWebDir, setCopyWebInf, setDefaultsDescriptor, setDescriptor, setDisplayName, setDistributable, setExtraClasspath, setExtractWAR, setLogUrlOnStart, setOverrideDescriptor, setOverrideDescriptors, setParentLoaderPriority, setPermissions, setPersistTempDirectory, setResourceAlias, setResourceAliases, setServer, setServerClassMatcher, setServletSecurity, setSystemClassMatcher, setTempDirectory, setThrowUnavailableOnStartupException, setWar, 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, newServletHandler, 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, 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.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
-
Constructor Details
-
MavenWebAppContext
- Throws:
Exception
-
-
Method Details
-
setContainerIncludeJarPattern
-
getContainerIncludeJarPattern
-
getWebInfIncludeJarPattern
-
setWebInfIncludeJarPattern
-
getClassPathFiles
-
setJettyEnvXml
-
getJettyEnvXml
-
setClasses
-
getClasses
-
setWebInfLib
-
setTestClasses
-
getTestClasses
-
setOverlays
Ordered list of wars to overlay on top of the current project. The list may contain an overlay that represents the current project.- Parameters:
overlays
- the list of overlays
-
setOriginAttribute
Set the name of the attribute that is used in each generated xml element to indicate the source of the xml element (eg annotation, web.xml etc).- Parameters:
name
- the name of the attribute to use.
-
getOriginAttribute
- Returns:
- the originAttribute
-
getOverlays
-
setBaseAppFirst
public void setBaseAppFirst(boolean value) -
getBaseAppFirst
public boolean getBaseAppFirst() -
setResourceBases
This method is provided as a convenience for jetty maven plugin configuration- Parameters:
resourceBases
- Array of resources strings to set as aResourceCollection
. Each resource string may be a comma separated list of resources
-
getWebInfLib
-
getWebInfClasses
-
doStart
Description copied from class:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in classWebAppContext
- Throws:
AbstractLifeCycle.StopException
- If thrown, the lifecycle will immediately be stopped.Exception
- If there was a problem starting. Will cause a transition to FAILED state
-
newConfigurations
- Overrides:
newConfigurations
in classWebAppContext
-
doStop
Description copied from class:ContainerLifeCycle
Stops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStop
in classServletContextHandler
- Throws:
Exception
- If there was a problem stopping. Will cause a transition to FAILED state
-
getResource
Description copied from class:ContextHandler
Attempt to get a Resource from the Context.- Overrides:
getResource
in classWebAppContext
- Parameters:
pathInContext
- the path within the base resource to attempt to get- Returns:
- the resource, or null if not available.
- Throws:
MalformedURLException
- if unable to form a Resource from the provided path
-
getResourcePaths
- Overrides:
getResourcePaths
in classContextHandler
-
addPattern
-
initCDI
public void initCDI() -
setExtraClasspath
Description copied from class:WebAppContext
Set the Extra ClassPath via delimited String.This is a convenience method for
WebAppContext.setExtraClasspath(List)
- Overrides:
setExtraClasspath
in classWebAppContext
- Parameters:
extraClasspath
- Comma or semicolon separated path of filenames or URLs pointing to directories or jar files. Directories should end with '/'.- Throws:
IOException
- if unable to resolve the resources referenced- See Also:
-