Package org.eclipse.jetty.maven.plugin
Class JettyWebAppContext
- java.lang.Object
-
- All Implemented Interfaces:
Handler
,HandlerContainer
,Attributes
,ClassVisibilityChecker
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,Graceful
,LifeCycle
,WebAppClassLoader.Context
public class JettyWebAppContext extends WebAppContext
JettyWebAppContext 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.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 java.lang.String[]
DEFAULT_CONFIGURATION_CLASSES
static java.lang.String[]
MINIMUM_CONFIGURATION_CLASSES
static java.lang.String[]
QUICKSTART_CONFIGURATION_CLASSES
-
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, _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 JettyWebAppContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
addPattern(java.lang.String s, java.lang.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
getBaseAppFirst()
java.io.File
getClasses()
java.util.List<java.io.File>
getClassPathFiles()
java.lang.String
getContainerIncludeJarPattern()
java.lang.String
getJettyEnvXml()
java.lang.String
getOriginAttribute()
java.util.List<Overlay>
getOverlays()
Resource
getQuickStartWebDescriptor()
Resource
getResource(java.lang.String uriInContext)
java.util.Set<java.lang.String>
getResourcePaths(java.lang.String path)
java.io.File
getTestClasses()
java.util.List<java.io.File>
getWebInfClasses()
java.lang.String
getWebInfIncludeJarPattern()
java.util.List<java.io.File>
getWebInfLib()
void
initCDI()
boolean
isGenerateOrigin()
boolean
isGenerateQuickStart()
protected void
loadConfigurations()
void
setBaseAppFirst(boolean value)
void
setClasses(java.io.File dir)
void
setContainerIncludeJarPattern(java.lang.String pattern)
void
setGenerateOrigin(boolean generateOrigin)
void
setGenerateQuickStart(boolean quickStart)
void
setJettyEnvXml(java.lang.String jettyEnvXml)
void
setOriginAttribute(java.lang.String originAttribute)
void
setOverlays(java.util.List<Overlay> overlays)
Ordered list of wars to overlay on top of the current project.void
setQuickStartWebDescriptor(java.lang.String quickStartWebXml)
protected void
setQuickStartWebDescriptor(Resource quickStartWebXml)
void
setResourceBases(java.lang.String[] resourceBases)
This method is provided as a convenience for jetty maven plugin configurationvoid
setTestClasses(java.io.File dir)
void
setWebInfIncludeJarPattern(java.lang.String pattern)
void
setWebInfLib(java.util.List<java.io.File> jars)
protected void
startWebapp()
protected void
stopWebapp()
-
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, 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, 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, setWar, setWarResource, startContext, stopContext, 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, newServletHandler, 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, 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
-
MINIMUM_CONFIGURATION_CLASSES
public static final java.lang.String[] MINIMUM_CONFIGURATION_CLASSES
-
DEFAULT_CONFIGURATION_CLASSES
public static final java.lang.String[] DEFAULT_CONFIGURATION_CLASSES
-
QUICKSTART_CONFIGURATION_CLASSES
public static final java.lang.String[] QUICKSTART_CONFIGURATION_CLASSES
-
-
Method Detail
-
setContainerIncludeJarPattern
public void setContainerIncludeJarPattern(java.lang.String pattern)
-
getContainerIncludeJarPattern
public java.lang.String getContainerIncludeJarPattern()
-
getWebInfIncludeJarPattern
public java.lang.String getWebInfIncludeJarPattern()
-
setWebInfIncludeJarPattern
public void setWebInfIncludeJarPattern(java.lang.String pattern)
-
getClassPathFiles
public java.util.List<java.io.File> getClassPathFiles()
-
setJettyEnvXml
public void setJettyEnvXml(java.lang.String jettyEnvXml)
-
getJettyEnvXml
public java.lang.String getJettyEnvXml()
-
setClasses
public void setClasses(java.io.File dir)
-
getClasses
public java.io.File getClasses()
-
setWebInfLib
public void setWebInfLib(java.util.List<java.io.File> jars)
-
setTestClasses
public void setTestClasses(java.io.File dir)
-
getTestClasses
public java.io.File getTestClasses()
-
setOverlays
public void setOverlays(java.util.List<Overlay> overlays)
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
-
getOriginAttribute
public java.lang.String getOriginAttribute()
- Returns:
- the originAttribute
-
setOriginAttribute
public void setOriginAttribute(java.lang.String originAttribute)
- Parameters:
originAttribute
- the originAttribute to set
-
isGenerateOrigin
public boolean isGenerateOrigin()
- Returns:
- the generateOrigin
-
setGenerateOrigin
public void setGenerateOrigin(boolean generateOrigin)
- Parameters:
generateOrigin
- the generateOrigin to set
-
getOverlays
public java.util.List<Overlay> getOverlays()
-
setBaseAppFirst
public void setBaseAppFirst(boolean value)
-
getBaseAppFirst
public boolean getBaseAppFirst()
-
setQuickStartWebDescriptor
public void setQuickStartWebDescriptor(java.lang.String quickStartWebXml) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setQuickStartWebDescriptor
protected void setQuickStartWebDescriptor(Resource quickStartWebXml)
-
getQuickStartWebDescriptor
public Resource getQuickStartWebDescriptor()
-
setResourceBases
public void setResourceBases(java.lang.String[] resourceBases)
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- See Also:
Resource
-
getWebInfLib
public java.util.List<java.io.File> getWebInfLib()
-
getWebInfClasses
public java.util.List<java.io.File> getWebInfClasses()
-
setGenerateQuickStart
public void setGenerateQuickStart(boolean quickStart)
-
isGenerateQuickStart
public boolean isGenerateQuickStart()
-
startWebapp
protected void startWebapp() throws java.lang.Exception
- Overrides:
startWebapp
in classWebAppContext
- Throws:
java.lang.Exception
-
stopWebapp
protected void stopWebapp() throws java.lang.Exception
- Overrides:
stopWebapp
in classWebAppContext
- Throws:
java.lang.Exception
-
doStart
public void doStart() throws java.lang.Exception
Description copied from class:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in classWebAppContext
- Throws:
java.lang.Exception
- See Also:
AbstractHandler.doStart()
-
loadConfigurations
protected void loadConfigurations() throws java.lang.Exception
- Overrides:
loadConfigurations
in classWebAppContext
- Throws:
java.lang.Exception
-
doStop
public void doStop() throws java.lang.Exception
Description copied from class:ContainerLifeCycle
Stops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStop
in classWebAppContext
- Throws:
java.lang.Exception
- See Also:
ContextHandler.doStop()
-
getResource
public Resource getResource(java.lang.String uriInContext) throws java.net.MalformedURLException
- Overrides:
getResource
in classWebAppContext
- Throws:
java.net.MalformedURLException
-
getResourcePaths
public java.util.Set<java.lang.String> getResourcePaths(java.lang.String path)
- Overrides:
getResourcePaths
in classContextHandler
-
addPattern
public java.lang.String addPattern(java.lang.String s, java.lang.String pattern)
-
initCDI
public void initCDI()
-
-