341006 move inner enums out into separate files
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2913 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
fdf199e254
commit
6e62a61af3
|
@ -22,6 +22,7 @@ import org.eclipse.jetty.annotations.AnnotationIntrospector.AbstractIntrospectab
|
||||||
import org.eclipse.jetty.plus.annotation.LifeCycleCallbackCollection;
|
import org.eclipse.jetty.plus.annotation.LifeCycleCallbackCollection;
|
||||||
import org.eclipse.jetty.plus.annotation.PostConstructCallback;
|
import org.eclipse.jetty.plus.annotation.PostConstructCallback;
|
||||||
import org.eclipse.jetty.webapp.MetaData;
|
import org.eclipse.jetty.webapp.MetaData;
|
||||||
|
import org.eclipse.jetty.webapp.Origin;
|
||||||
import org.eclipse.jetty.webapp.WebAppContext;
|
import org.eclipse.jetty.webapp.WebAppContext;
|
||||||
|
|
||||||
public class PostConstructAnnotationHandler extends AbstractIntrospectableAnnotationHandler
|
public class PostConstructAnnotationHandler extends AbstractIntrospectableAnnotationHandler
|
||||||
|
@ -58,11 +59,11 @@ public class PostConstructAnnotationHandler extends AbstractIntrospectableAnnota
|
||||||
//ServletSpec 3.0 p80 If web.xml declares even one post-construct then all post-constructs
|
//ServletSpec 3.0 p80 If web.xml declares even one post-construct then all post-constructs
|
||||||
//in fragments must be ignored. Otherwise, they are additive.
|
//in fragments must be ignored. Otherwise, they are additive.
|
||||||
MetaData metaData = _context.getMetaData();
|
MetaData metaData = _context.getMetaData();
|
||||||
MetaData.Origin origin = metaData.getOrigin("post-construct");
|
Origin origin = metaData.getOrigin("post-construct");
|
||||||
if (origin != null &&
|
if (origin != null &&
|
||||||
(origin == MetaData.Origin.WebXml ||
|
(origin == Origin.WebXml ||
|
||||||
origin == MetaData.Origin.WebDefaults ||
|
origin == Origin.WebDefaults ||
|
||||||
origin == MetaData.Origin.WebOverride))
|
origin == Origin.WebOverride))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PostConstructCallback callback = new PostConstructCallback();
|
PostConstructCallback callback = new PostConstructCallback();
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.eclipse.jetty.annotations.AnnotationIntrospector.AbstractIntrospectab
|
||||||
import org.eclipse.jetty.plus.annotation.LifeCycleCallbackCollection;
|
import org.eclipse.jetty.plus.annotation.LifeCycleCallbackCollection;
|
||||||
import org.eclipse.jetty.plus.annotation.PreDestroyCallback;
|
import org.eclipse.jetty.plus.annotation.PreDestroyCallback;
|
||||||
import org.eclipse.jetty.webapp.MetaData;
|
import org.eclipse.jetty.webapp.MetaData;
|
||||||
|
import org.eclipse.jetty.webapp.Origin;
|
||||||
import org.eclipse.jetty.webapp.WebAppContext;
|
import org.eclipse.jetty.webapp.WebAppContext;
|
||||||
|
|
||||||
public class PreDestroyAnnotationHandler extends AbstractIntrospectableAnnotationHandler
|
public class PreDestroyAnnotationHandler extends AbstractIntrospectableAnnotationHandler
|
||||||
|
@ -57,11 +58,11 @@ public class PreDestroyAnnotationHandler extends AbstractIntrospectableAnnotatio
|
||||||
//ServletSpec 3.0 p80 If web.xml declares even one predestroy then all predestroys
|
//ServletSpec 3.0 p80 If web.xml declares even one predestroy then all predestroys
|
||||||
//in fragments must be ignored. Otherwise, they are additive.
|
//in fragments must be ignored. Otherwise, they are additive.
|
||||||
MetaData metaData = _context.getMetaData();
|
MetaData metaData = _context.getMetaData();
|
||||||
MetaData.Origin origin = metaData.getOrigin("pre-destroy");
|
Origin origin = metaData.getOrigin("pre-destroy");
|
||||||
if (origin != null &&
|
if (origin != null &&
|
||||||
(origin == MetaData.Origin.WebXml ||
|
(origin == Origin.WebXml ||
|
||||||
origin == MetaData.Origin.WebDefaults ||
|
origin == Origin.WebDefaults ||
|
||||||
origin == MetaData.Origin.WebOverride))
|
origin == Origin.WebOverride))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PreDestroyCallback callback = new PreDestroyCallback();
|
PreDestroyCallback callback = new PreDestroyCallback();
|
||||||
|
|
|
@ -28,7 +28,6 @@ import org.eclipse.jetty.plus.annotation.InjectionCollection;
|
||||||
import org.eclipse.jetty.util.log.Log;
|
import org.eclipse.jetty.util.log.Log;
|
||||||
import org.eclipse.jetty.webapp.MetaData;
|
import org.eclipse.jetty.webapp.MetaData;
|
||||||
import org.eclipse.jetty.webapp.WebAppContext;
|
import org.eclipse.jetty.webapp.WebAppContext;
|
||||||
import org.eclipse.jetty.webapp.MetaData.Origin;
|
|
||||||
|
|
||||||
public class ResourceAnnotationHandler extends AbstractIntrospectableAnnotationHandler
|
public class ResourceAnnotationHandler extends AbstractIntrospectableAnnotationHandler
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,8 +36,8 @@ import org.eclipse.jetty.util.log.Log;
|
||||||
import org.eclipse.jetty.webapp.Descriptor;
|
import org.eclipse.jetty.webapp.Descriptor;
|
||||||
import org.eclipse.jetty.webapp.FragmentDescriptor;
|
import org.eclipse.jetty.webapp.FragmentDescriptor;
|
||||||
import org.eclipse.jetty.webapp.IterativeDescriptorProcessor;
|
import org.eclipse.jetty.webapp.IterativeDescriptorProcessor;
|
||||||
|
import org.eclipse.jetty.webapp.Origin;
|
||||||
import org.eclipse.jetty.webapp.WebAppContext;
|
import org.eclipse.jetty.webapp.WebAppContext;
|
||||||
import org.eclipse.jetty.webapp.MetaData.Origin;
|
|
||||||
import org.eclipse.jetty.xml.XmlParser;
|
import org.eclipse.jetty.xml.XmlParser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -35,8 +35,6 @@ public class MetaData
|
||||||
{
|
{
|
||||||
public static final String ORDERED_LIBS = "javax.servlet.context.orderedLibs";
|
public static final String ORDERED_LIBS = "javax.servlet.context.orderedLibs";
|
||||||
|
|
||||||
public enum Origin {NotSet, WebXml, WebDefaults, WebOverride, WebFragment, Annotation};
|
|
||||||
|
|
||||||
protected Map<String, OriginInfo> _origins =new HashMap<String,OriginInfo>();
|
protected Map<String, OriginInfo> _origins =new HashMap<String,OriginInfo>();
|
||||||
protected WebDescriptor _webDefaultsRoot;
|
protected WebDescriptor _webDefaultsRoot;
|
||||||
protected WebDescriptor _webXmlRoot;
|
protected WebDescriptor _webXmlRoot;
|
||||||
|
@ -161,7 +159,7 @@ public class MetaData
|
||||||
{
|
{
|
||||||
_webXmlRoot = new WebDescriptor(webXml);
|
_webXmlRoot = new WebDescriptor(webXml);
|
||||||
_webXmlRoot.parse();
|
_webXmlRoot.parse();
|
||||||
_metaDataComplete=_webXmlRoot.getMetaDataComplete() == WebDescriptor.MetaDataComplete.True;
|
_metaDataComplete=_webXmlRoot.getMetaDataComplete() == MetaDataComplete.True;
|
||||||
|
|
||||||
if (_webXmlRoot.isOrdered())
|
if (_webXmlRoot.isOrdered())
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
package org.eclipse.jetty.webapp;
|
||||||
|
|
||||||
|
public enum MetaDataComplete {NotSet, True, False}
|
|
@ -0,0 +1,3 @@
|
||||||
|
package org.eclipse.jetty.webapp;
|
||||||
|
|
||||||
|
public enum Origin {NotSet, WebXml, WebDefaults, WebOverride, WebFragment, Annotation}
|
|
@ -42,7 +42,6 @@ import org.eclipse.jetty.util.LazyList;
|
||||||
import org.eclipse.jetty.util.Loader;
|
import org.eclipse.jetty.util.Loader;
|
||||||
import org.eclipse.jetty.util.log.Log;
|
import org.eclipse.jetty.util.log.Log;
|
||||||
import org.eclipse.jetty.util.resource.Resource;
|
import org.eclipse.jetty.util.resource.Resource;
|
||||||
import org.eclipse.jetty.webapp.MetaData.Origin;
|
|
||||||
import org.eclipse.jetty.xml.XmlParser;
|
import org.eclipse.jetty.xml.XmlParser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -35,8 +35,6 @@ import org.eclipse.jetty.xml.XmlParser;
|
||||||
public class WebDescriptor extends Descriptor
|
public class WebDescriptor extends Descriptor
|
||||||
{
|
{
|
||||||
protected static XmlParser _parserSingleton;
|
protected static XmlParser _parserSingleton;
|
||||||
public enum MetaDataComplete {NotSet, True, False};
|
|
||||||
|
|
||||||
protected MetaDataComplete _metaDataComplete;
|
protected MetaDataComplete _metaDataComplete;
|
||||||
protected int _majorVersion = 3; //default to container version
|
protected int _majorVersion = 3; //default to container version
|
||||||
protected int _minorVersion = 0;
|
protected int _minorVersion = 0;
|
||||||
|
|
Loading…
Reference in New Issue