Module org.eclipse.jetty.quickstart
Package org.eclipse.jetty.quickstart
Class QuickStartGeneratorConfiguration
- java.lang.Object
-
- org.eclipse.jetty.webapp.AbstractConfiguration
-
- org.eclipse.jetty.quickstart.QuickStartGeneratorConfiguration
-
- All Implemented Interfaces:
Configuration
public class QuickStartGeneratorConfiguration extends AbstractConfiguration
QuickStartGeneratorConfigurationGenerate an effective web.xml from a WebAppContext, including all components from web.xml, web-fragment.xmls annotations etc.
If generating quickstart for a different java platform than the current running platform, then the org.eclipse.jetty.annotations.javaTargetPlatform attribute should be set on the Context with the platform number of the target JVM (eg 8).
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean_abortprotected int_countprotected java.lang.String_originAttributeprotected Resource_quickStartWebXmlstatic java.lang.StringDEFAULT_ORIGIN_ATTRIBUTE_NAMEstatic java.lang.StringORIGIN-
Fields inherited from interface org.eclipse.jetty.webapp.Configuration
ATTR
-
-
Constructor Summary
Constructors Constructor Description QuickStartGeneratorConfiguration()QuickStartGeneratorConfiguration(boolean abort)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanabort(WebAppContext context)voidconfigure(WebAppContext context)Configure WebApp.voiddeconfigure(WebAppContext context)DeConfigure WebApp.voidgenerateQuickStartWebXml(WebAppContext context, java.io.OutputStream stream)Perform the generation of the xml filejava.lang.StringgetOriginAttribute()ResourcegetQuickStartWebXml()java.util.Map<java.lang.String,java.lang.String>origin(MetaData md, java.lang.String name)Find the origin (web.xml, fragment, annotation etc) of a web artifact from MetaData.voidpreConfigure(WebAppContext context)Set up for configuration.voidsetOriginAttribute(java.lang.String name)voidsetQuickStartWebXml(Resource quickStartWebXml)-
Methods inherited from class org.eclipse.jetty.webapp.AbstractConfiguration
addDependencies, addDependencies, addDependents, addDependents, cloneConfigure, destroy, expose, getDependencies, getDependents, getServerClasses, getSystemClasses, hide, isEnabledByDefault, postConfigure, protect, protectAndExpose
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.webapp.Configuration
isAvailable, replaces
-
-
-
-
Field Detail
-
ORIGIN
public static final java.lang.String ORIGIN
- See Also:
- Constant Field Values
-
DEFAULT_ORIGIN_ATTRIBUTE_NAME
public static final java.lang.String DEFAULT_ORIGIN_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
_abort
protected final boolean _abort
-
_originAttribute
protected java.lang.String _originAttribute
-
_count
protected int _count
-
_quickStartWebXml
protected Resource _quickStartWebXml
-
-
Method Detail
-
abort
public boolean abort(WebAppContext context)
- Specified by:
abortin interfaceConfiguration- Overrides:
abortin classAbstractConfiguration- Returns:
- true if configuration should be aborted
-
setOriginAttribute
public void setOriginAttribute(java.lang.String name)
-
getOriginAttribute
public java.lang.String getOriginAttribute()
- Returns:
- the originAttribute
-
getQuickStartWebXml
public Resource getQuickStartWebXml()
-
setQuickStartWebXml
public void setQuickStartWebXml(Resource quickStartWebXml)
-
generateQuickStartWebXml
public void generateQuickStartWebXml(WebAppContext context, java.io.OutputStream stream) throws java.io.FileNotFoundException, java.io.IOException
Perform the generation of the xml file- Parameters:
stream- the stream to generate the quickstart-web.xml to- Throws:
java.io.IOException- if unable to generate the quickstart-web.xmljava.io.FileNotFoundException- if unable to find the file
-
origin
public java.util.Map<java.lang.String,java.lang.String> origin(MetaData md, java.lang.String name)
Find the origin (web.xml, fragment, annotation etc) of a web artifact from MetaData.- Parameters:
md- the metadataname- the name- Returns:
- the origin map
-
preConfigure
public void preConfigure(WebAppContext context) throws java.lang.Exception
Description copied from interface:ConfigurationSet up for configuration.Typically this step discovers configuration resources. Calls to preConfigure may alter the Configurations configured on the WebAppContext, so long as configurations prior to this configuration are not altered.
- Specified by:
preConfigurein interfaceConfiguration- Overrides:
preConfigurein classAbstractConfiguration- Parameters:
context- The context to configure- Throws:
java.lang.Exception- if unable to pre configure
-
configure
public void configure(WebAppContext context) throws java.lang.Exception
Description copied from interface:ConfigurationConfigure WebApp.Typically this step applies the discovered configuration resources to either the
WebAppContextor the associatedMetaData.- Specified by:
configurein interfaceConfiguration- Overrides:
configurein classAbstractConfiguration- Parameters:
context- The context to configure- Throws:
java.lang.Exception- if unable to configure
-
deconfigure
public void deconfigure(WebAppContext context) throws java.lang.Exception
Description copied from interface:ConfigurationDeConfigure WebApp. This method is called to undo all configuration done. This is called to allow the context to work correctly over a stop/start cycle- Specified by:
deconfigurein interfaceConfiguration- Overrides:
deconfigurein classAbstractConfiguration- Parameters:
context- The context to configure- Throws:
java.lang.Exception- if unable to deconfigure
-
-