Package org.eclipse.jetty.coreapp
Class CoreAppContext
- All Implemented Interfaces:
AliasCheck,Deployable,Handler,Handler.Container,Handler.Singleton,Request.Handler,Attributes,Container,Destroyable,Dumpable,Dumpable.DumpableContainer,LifeCycle,Invocable
A Core WebApp.
The Base Resource represents the metadata base that defines this CoreContextHandler.
The metadata base can be a directory on disk, or an archive file (supporting jar, zip, and war) with the following contents.
<metadata>/lib/*.jar- the jar files for the classloader of this webapp<metadata>/classes/- the raw class files for this webapp<metadata>/static/- the static content to serve for this webapp
Note: if using the archive file as your metadata base, the
existence of <metadata>/lib/*.jar files means the archive will be
unpacked into the temp directory defined by this core webapp.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.ContextHandler
ContextHandler.Availability, ContextHandler.ContextScopeListener, ContextHandler.ScopedContextNested classes/interfaces inherited from class org.eclipse.jetty.server.Handler.Abstract
Handler.Abstract.NonBlockingNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.Attributes
Attributes.Layer, Attributes.Lazy, Attributes.Mapped, Attributes.Synthetic, Attributes.WrapperNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer, Dumpable.DumpAppendableNested classes/interfaces inherited from interface org.eclipse.jetty.server.Handler
Handler.Abstract, Handler.AbstractContainer, Handler.Collection, Handler.Container, Handler.Sequence, Handler.Singleton, Handler.WrapperNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
Invocable.Callable, Invocable.InvocationType, Invocable.ReadyTask, Invocable.TaskNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.server.Request.Handler
Request.Handler.AbortException -
Field Summary
Fields inherited from class org.eclipse.jetty.server.handler.ContextHandler
CROSS_CONTEXT_ATTRIBUTE, MANAGED_ATTRIBUTESFields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.Attributes
NULLFields inherited from interface org.eclipse.jetty.server.Deployable
ATTRIBUTE_PREFIX, BASE_RESOURCE, CONFIGURATION_CLASSES, CONTAINER_SCAN_JARS, CONTEXT_HANDLER_CLASS, CONTEXT_PATH, DEFAULT_CONTEXT_PATH, DEFAULTS_DESCRIPTOR, DIR_ALLOWED, ENVIRONMENT, ENVIRONMENT_XML, EXTRACT_WARS, MAIN_PATH, OTHER_PATHS, PARENT_LOADER_PRIORITY, SCI_EXCLUSION_PATTERN, SCI_ORDER, TEMP_DIR, WAR, WEBINF_SCAN_JARSFields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking, NOOP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()Starts the managed lifecycle beans in the order they were added.protected voiddoStop()Stops the managed lifecycle beans in the reverse order they were added.protected voidinitializeDefault(String keyName, Object value) Called for each attribute key encountered during theDeployable.initializeDefaults(Attributes)processing.protected voidCalled after all attributes are processed viaDeployable.initializeDefaults(Attributes), to allow any kind of extra processing of the configuration.protected voidvoidsetBaseResource(Resource baseResource) Set the base resource to serve content from for this context, which must exist and be readable when the context is started.voidsetExtraClassPath(String extraClasspath) Set the Extra class path via delimited String.voidsetExtraClassPath(String... extraClasspath) Set Extra class path entries.voidsetExtraClassPath(List<Resource> extraClasspath) Set Extra class path entries.protected ResourceMethods inherited from class org.eclipse.jetty.server.handler.ContextHandler
addAliasCheck, addEncodings, addEventListener, addMimeTypes, addVirtualHosts, checkAlias, checkVirtualHost, cleanupAfterStop, clearAliasChecks, clearAttributes, createTempDirectory, destroy, dump, enterScope, exitScope, getAliasChecks, getAllowNullPathInContext, getAttribute, getAttributeNameSet, getBaseName, getBaseResource, getCanonicalNameForTmpDir, getClassLoader, getClassPath, getContext, getContextHandler, getContextPath, getCrossContextHandler, getCurrentContext, getCurrentContext, getCurrentContextHandler, getDisplayName, getErrorHandler, getMimeTypes, getProtectedTargets, getResourceForTempDirName, getTempDirectory, getVirtualHosts, handle, handleByContextHandler, handleMovedPermanently, handleUnavailable, initializeDefaults, isAvailable, isContextPathDefault, isCrossContextDispatchSupported, isProtectedTarget, isTempDirectoryPersistent, makeTempDirectory, newContext, notifyEnterScope, notifyExitScope, removeAttribute, removeEventListener, removeVirtualHosts, setAliasChecks, setAllowNullPathInContext, setAttribute, setAvailable, setBaseResourceAsPath, setBaseResourceAsString, setClassLoader, setContextPath, setCrossContextDispatchSupported, setDefaultContextPath, setDisplayName, setEncodings, setErrorHandler, setMimeTypes, setProtectedTargets, setServer, setTempDirectory, setTempDirectoryPersistent, setVirtualHosts, toString, wrapRequest, wrapResponseMethods inherited from class org.eclipse.jetty.server.Handler.Wrapper
getHandler, getInvocationType, setHandlerMethods inherited from class org.eclipse.jetty.server.Handler.AbstractContainer
findContainerOf, getDescendant, getDescendants, isDynamic, setDynamicMethods inherited from class org.eclipse.jetty.server.Handler.Abstract
getServerMethods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addManaged, contains, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.Attributes
asAttributeMap, equals, hashCodeMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.server.Deployable
initializeDefaultsMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.server.Handler.Container
getContainer, getDescendant, getDescendants, getDescendantsMethods inherited from interface org.eclipse.jetty.server.Handler.Singleton
getHandlers, getTail, insertHandler, setHandlerMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop
-
Constructor Details
-
CoreAppContext
public CoreAppContext() -
CoreAppContext
-
-
Method Details
-
getExtraClassPath
@ManagedAttribute(value="extra classpath for context classloader", readonly=true) public List<Resource> getExtraClassPath()- Returns:
- List of Resources that each will represent a new classpath entry
-
initializeDefault
Description copied from class:ContextHandlerCalled for each attribute key encountered during theDeployable.initializeDefaults(Attributes)processing.- Overrides:
initializeDefaultin classContextHandler- Parameters:
keyName- the key namevalue- the value
-
initializeDefaultsComplete
protected void initializeDefaultsComplete()Description copied from class:ContextHandlerCalled after all attributes are processed viaDeployable.initializeDefaults(Attributes), to allow any kind of extra processing of the configuration.- Overrides:
initializeDefaultsCompletein classContextHandler
-
setExtraClassPath
Set the Extra class path via delimited String.- Parameters:
extraClasspath- delimited path of filenames or URLs pointing to directories or jar files. (seeResourceFactory.split(String)for behavior.)- See Also:
-
setExtraClassPath
Set Extra class path entries.- Parameters:
extraClasspath- the entries to add- See Also:
-
setExtraClassPath
Set Extra class path entries.- Parameters:
extraClasspath- the entries to add- See Also:
-
getResourceFactory
-
setBaseResource
Description copied from class:ContextHandlerSet the base resource to serve content from for this context, which must exist and be readable when the context is started.
- Overrides:
setBaseResourcein classContextHandler- Parameters:
baseResource- The base resource for the context.
-
unpack
- Throws:
IOException
-
initWebApp
- Throws:
IOException
-
doStart
Description copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
doStartin classContextHandler- 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
-
doStop
Description copied from class:ContainerLifeCycleStops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStopin classContextHandler- Throws:
Exception- If there was a problem stopping. Will cause a transition to FAILED state
-