464727 - Update Javadoc for Java 8 DocLint
+ Fixing javadoc in jetty-webapp
This commit is contained in:
parent
baede130c0
commit
360c3f2e00
|
@ -41,7 +41,7 @@ public interface Configuration
|
|||
* <p>
|
||||
* Typically this step discovers configuration resources
|
||||
* @param context The context to configure
|
||||
* @throws Exception
|
||||
* @throws Exception if unable to pre configure
|
||||
*/
|
||||
public void preConfigure (WebAppContext context) throws Exception;
|
||||
|
||||
|
@ -52,7 +52,7 @@ public interface Configuration
|
|||
* Typically this step applies the discovered configuration resources to
|
||||
* either the {@link WebAppContext} or the associated {@link MetaData}.
|
||||
* @param context The context to configure
|
||||
* @throws Exception
|
||||
* @throws Exception if unable to configure
|
||||
*/
|
||||
public void configure (WebAppContext context) throws Exception;
|
||||
|
||||
|
@ -60,7 +60,7 @@ public interface Configuration
|
|||
/* ------------------------------------------------------------------------------- */
|
||||
/** Clear down after configuration.
|
||||
* @param context The context to configure
|
||||
* @throws Exception
|
||||
* @throws Exception if unable to post configure
|
||||
*/
|
||||
public void postConfigure (WebAppContext context) throws Exception;
|
||||
|
||||
|
@ -69,7 +69,7 @@ public interface Configuration
|
|||
* This method is called to undo all configuration done. This is
|
||||
* called to allow the context to work correctly over a stop/start cycle
|
||||
* @param context The context to configure
|
||||
* @throws Exception
|
||||
* @throws Exception if unable to deconfigure
|
||||
*/
|
||||
public void deconfigure (WebAppContext context) throws Exception;
|
||||
|
||||
|
@ -78,7 +78,7 @@ public interface Configuration
|
|||
* This method is called to destroy a webappcontext. It is typically called when a context
|
||||
* is removed from a server handler hierarchy by the deployer.
|
||||
* @param context The context to configure
|
||||
* @throws Exception
|
||||
* @throws Exception if unable to destroy
|
||||
*/
|
||||
public void destroy (WebAppContext context) throws Exception;
|
||||
|
||||
|
@ -90,7 +90,7 @@ public interface Configuration
|
|||
* has previously been configured by this Configuration.
|
||||
* @param template The template context
|
||||
* @param context The context to configure
|
||||
* @throws Exception
|
||||
* @throws Exception if unable to clone
|
||||
*/
|
||||
public void cloneConfigure (WebAppContext template, WebAppContext context) throws Exception;
|
||||
|
||||
|
|
|
@ -25,9 +25,7 @@ import org.eclipse.jetty.util.resource.Resource;
|
|||
|
||||
/**
|
||||
* FragmentConfiguration
|
||||
*
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Process web-fragments in jars
|
||||
*/
|
||||
public class FragmentConfiguration extends AbstractConfiguration
|
||||
|
@ -55,8 +53,10 @@ public class FragmentConfiguration extends AbstractConfiguration
|
|||
/* ------------------------------------------------------------------------------- */
|
||||
/**
|
||||
* Look for any web-fragment.xml fragments in META-INF of jars in WEB-INF/lib
|
||||
* @param context the web app context to look in
|
||||
* @param metaData the metadata to populate with fragments
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if unable to find web fragments
|
||||
*/
|
||||
public void findWebFragments (final WebAppContext context, final MetaData metaData) throws Exception
|
||||
{
|
||||
|
|
|
@ -27,8 +27,6 @@ import org.eclipse.jetty.xml.XmlParser;
|
|||
|
||||
/**
|
||||
* IterativeDescriptorProcessor
|
||||
*
|
||||
*
|
||||
*/
|
||||
public abstract class IterativeDescriptorProcessor implements DescriptorProcessor
|
||||
{
|
||||
|
@ -41,8 +39,8 @@ public abstract class IterativeDescriptorProcessor implements DescriptorProcesso
|
|||
* Register a method to be called back when visiting the node with the given name.
|
||||
* The method must exist on a subclass of this class, and must have the signature:
|
||||
* public void method (Descriptor descriptor, XmlParser.Node node)
|
||||
* @param nodeName
|
||||
* @param m
|
||||
* @param nodeName the node name
|
||||
* @param m the method name
|
||||
*/
|
||||
public void registerVisitor(String nodeName, Method m)
|
||||
{
|
||||
|
|
|
@ -48,7 +48,6 @@ public abstract class JarScanner extends org.eclipse.jetty.util.PatternMatcher
|
|||
{
|
||||
private static final Logger LOG = Log.getLogger(JarScanner.class);
|
||||
|
||||
|
||||
public abstract void processEntry (URI jarUri, JarEntry entry);
|
||||
|
||||
/**
|
||||
|
@ -73,10 +72,10 @@ public abstract class JarScanner extends org.eclipse.jetty.util.PatternMatcher
|
|||
* Will iterate over the jar names, matching
|
||||
* all those starting with "aaa-" first, then "bbb-".
|
||||
*
|
||||
* @param pattern
|
||||
* @param uris
|
||||
* @param pattern the pattern to use for jar matching
|
||||
* @param uris the uris of the jars to scan
|
||||
* @param isNullInclusive if true, an empty pattern means all names match, if false, none match
|
||||
* @throws Exception
|
||||
* @throws Exception if unable to scan
|
||||
*/
|
||||
public void scan (Pattern pattern, URI[] uris, boolean isNullInclusive)
|
||||
throws Exception
|
||||
|
@ -110,11 +109,11 @@ public abstract class JarScanner extends org.eclipse.jetty.util.PatternMatcher
|
|||
* parent loader hierarchy. If false, it is only applied to the
|
||||
* classloader passed in.
|
||||
*
|
||||
* @param pattern
|
||||
* @param loader
|
||||
* @param isNullInclusive
|
||||
* @param visitParent
|
||||
* @throws Exception
|
||||
* @param pattern the pattern to use for jar matching
|
||||
* @param loader the class loader to look for jars in
|
||||
* @param isNullInclusive if true, an empty pattern means all names match, if false, none match
|
||||
* @param visitParent if true, visit parent classloaders too
|
||||
* @throws Exception if unable to scan
|
||||
*/
|
||||
public void scan (Pattern pattern, ClassLoader loader, boolean isNullInclusive, boolean visitParent)
|
||||
throws Exception
|
||||
|
|
|
@ -32,9 +32,6 @@ import org.eclipse.jetty.util.log.Logger;
|
|||
import org.eclipse.jetty.util.resource.EmptyResource;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* MetaData
|
||||
*
|
||||
|
@ -64,10 +61,6 @@ public class MetaData
|
|||
protected Ordering _ordering;//can be set to RelativeOrdering by web-default.xml, web.xml, web-override.xml
|
||||
protected boolean allowDuplicateFragmentNames = false;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static class OriginInfo
|
||||
{
|
||||
private final String name;
|
||||
|
@ -263,7 +256,7 @@ public class MetaData
|
|||
*
|
||||
* @param jarResource the jar the fragment is contained in
|
||||
* @param xmlResource the resource representing the xml file
|
||||
* @throws Exception
|
||||
* @throws Exception if unable to add fragment
|
||||
*/
|
||||
public void addFragment (Resource jarResource, Resource xmlResource)
|
||||
throws Exception
|
||||
|
@ -304,7 +297,7 @@ public class MetaData
|
|||
/**
|
||||
* Annotations not associated with a WEB-INF/lib fragment jar.
|
||||
* These are from WEB-INF/classes or the ??container path??
|
||||
* @param annotations
|
||||
* @param annotations the list of discovered annotations to add
|
||||
*/
|
||||
public void addDiscoveredAnnotations(List<DiscoveredAnnotation> annotations)
|
||||
{
|
||||
|
@ -324,7 +317,7 @@ public class MetaData
|
|||
* This method is synchronized as it is anticipated that it may be called by many threads
|
||||
* during the annotation scanning phase.
|
||||
*
|
||||
* @param annotation
|
||||
* @param annotation the discovered annotation
|
||||
*/
|
||||
public synchronized void addDiscoveredAnnotation (DiscoveredAnnotation annotation)
|
||||
{
|
||||
|
@ -369,6 +362,8 @@ public class MetaData
|
|||
/**
|
||||
* Resolve all servlet/filter/listener metadata from all sources: descriptors and annotations.
|
||||
*
|
||||
* @param context the context to resolve servlets / filters / listeners metadata from
|
||||
* @throws Exception if unable to resolve metadata
|
||||
*/
|
||||
public void resolve (WebAppContext context)
|
||||
throws Exception
|
||||
|
|
|
@ -35,12 +35,13 @@ import org.eclipse.jetty.util.resource.Resource;
|
|||
|
||||
/**
|
||||
* MetaInfConfiguration
|
||||
* <p>
|
||||
*
|
||||
* Scan META-INF of jars to find:
|
||||
* <ul>
|
||||
* <li>tlds
|
||||
* <li>web-fragment.xml
|
||||
* <li>resources
|
||||
* <li>tlds</li>
|
||||
* <li>web-fragment.xml</li>
|
||||
* <li>resources</li>
|
||||
* </ul>
|
||||
*
|
||||
* The jars which are scanned are:
|
||||
|
@ -91,10 +92,10 @@ public class MetaInfConfiguration extends AbstractConfiguration
|
|||
* cache the info discovered indexed by the jar in which it was discovered: this speeds
|
||||
* up subsequent context deployments.
|
||||
*
|
||||
* @param context
|
||||
* @param jars
|
||||
* @param useCaches
|
||||
* @throws Exception
|
||||
* @param context the context for the scan
|
||||
* @param jars the jars resources to scan
|
||||
* @param useCaches if true, cache the info discovered
|
||||
* @throws Exception if unable to scan the jars
|
||||
*/
|
||||
public void scanJars (final WebAppContext context, Collection<Resource> jars, boolean useCaches)
|
||||
throws Exception
|
||||
|
@ -140,10 +141,10 @@ public class MetaInfConfiguration extends AbstractConfiguration
|
|||
/**
|
||||
* Scan for META-INF/resources dir in the given jar.
|
||||
*
|
||||
* @param context
|
||||
* @param target
|
||||
* @param cache
|
||||
* @throws Exception
|
||||
* @param context the context for the scan
|
||||
* @param target the target resource to scan for
|
||||
* @param cache the resource cache
|
||||
* @throws Exception if unable to scan for resources
|
||||
*/
|
||||
public void scanForResources (WebAppContext context, Resource target, ConcurrentHashMap<Resource,Resource> cache)
|
||||
throws Exception
|
||||
|
@ -205,10 +206,10 @@ public class MetaInfConfiguration extends AbstractConfiguration
|
|||
/**
|
||||
* Scan for META-INF/web-fragment.xml file in the given jar.
|
||||
*
|
||||
* @param context
|
||||
* @param jar
|
||||
* @param cache
|
||||
* @throws Exception
|
||||
* @param context the context for the scan
|
||||
* @param jar the jar resource to scan for fragements in
|
||||
* @param cache the resource cache
|
||||
* @throws Exception if unable to scan for fragments
|
||||
*/
|
||||
public void scanForFragment (WebAppContext context, Resource jar, ConcurrentHashMap<Resource,Resource> cache)
|
||||
throws Exception
|
||||
|
@ -270,10 +271,10 @@ public class MetaInfConfiguration extends AbstractConfiguration
|
|||
/**
|
||||
* Discover META-INF/*.tld files in the given jar
|
||||
*
|
||||
* @param context
|
||||
* @param jar
|
||||
* @param cache
|
||||
* @throws Exception
|
||||
* @param context the context for the scan
|
||||
* @param jar the jar resources to scan tlds for
|
||||
* @param cache the resource cache
|
||||
* @throws Exception if unable to scan for tlds
|
||||
*/
|
||||
public void scanForTlds (WebAppContext context, Resource jar, ConcurrentHashMap<Resource, Collection<URL>> cache)
|
||||
throws Exception
|
||||
|
|
|
@ -29,18 +29,14 @@ import org.eclipse.jetty.util.resource.Resource;
|
|||
|
||||
|
||||
/**
|
||||
* Ordering
|
||||
*
|
||||
* Ordering options for jars in WEB-INF lib.
|
||||
*/
|
||||
public interface Ordering
|
||||
{
|
||||
|
||||
public List<Resource> order(List<Resource> fragments);
|
||||
public boolean isAbsolute ();
|
||||
public boolean hasOther();
|
||||
|
||||
|
||||
/**
|
||||
* AbsoluteOrdering
|
||||
*
|
||||
|
@ -350,9 +346,10 @@ public interface Ordering
|
|||
|
||||
/**
|
||||
* Is fragment with name a before fragment with name b?
|
||||
* @param list
|
||||
* @param fragNameA
|
||||
* @param fragNameB
|
||||
*
|
||||
* @param list the list of resources
|
||||
* @param fragNameA the first fragment
|
||||
* @param fragNameB the second fragment
|
||||
* @return true if fragment name A is before fragment name B
|
||||
*/
|
||||
protected boolean isBefore (List<Resource> list, String fragNameA, String fragNameB)
|
||||
|
@ -397,9 +394,10 @@ public interface Ordering
|
|||
|
||||
/**
|
||||
* Is fragment name "a" after fragment name "b"?
|
||||
* @param list
|
||||
* @param fragNameA
|
||||
* @param fragNameB
|
||||
*
|
||||
* @param list the list of resources
|
||||
* @param fragNameA the first fragment
|
||||
* @param fragNameB the second fragment
|
||||
* @return true if fragment name A is after fragment name B
|
||||
*/
|
||||
protected boolean isAfter(List<Resource> list, String fragNameA, String fragNameB)
|
||||
|
@ -441,9 +439,9 @@ public interface Ordering
|
|||
* Insert the resource matching the fragName into the list of resources
|
||||
* at the location indicated by index.
|
||||
*
|
||||
* @param list
|
||||
* @param index
|
||||
* @param fragName
|
||||
* @param list the list of resources
|
||||
* @param index the index to insert into
|
||||
* @param fragName the fragment name to insert
|
||||
*/
|
||||
protected void insert(List<Resource> list, int index, String fragName)
|
||||
{
|
||||
|
|
|
@ -58,9 +58,9 @@ import org.eclipse.jetty.xml.XmlParser;
|
|||
import org.eclipse.jetty.xml.XmlParser.Node;
|
||||
|
||||
/**
|
||||
* StandardDescriptorProcessor
|
||||
*
|
||||
* Process a web.xml, web-defaults.xml, web-overrides.xml, web-fragment.xml.
|
||||
* StandardDescriptorProcessor.
|
||||
* <p>
|
||||
* Process the web.xml, web-defaults.xml, web-overrides.xml, and web-fragment.xml descriptors.
|
||||
*/
|
||||
public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
||||
{
|
||||
|
@ -148,11 +148,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
_servletMappings.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitContextParam (WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
String name = node.getString("param-name", false, true);
|
||||
|
@ -196,13 +191,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitDisplayName(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
//Servlet Spec 3.0 p. 74 Ignore from web-fragments
|
||||
|
@ -213,12 +201,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitServlet(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
String id = node.getAttribute("id");
|
||||
|
@ -621,13 +603,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitServletMapping(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
//Servlet Spec 3.0, p74
|
||||
|
@ -669,12 +644,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitSessionConfig(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
XmlParser.Node tNode = node.get("session-timeout");
|
||||
|
@ -997,13 +966,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitMimeMapping(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
String extension = node.getString("extension", false, true);
|
||||
|
@ -1046,11 +1008,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitWelcomeFileList(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
switch (context.getMetaData().getOrigin("welcome-file-list"))
|
||||
|
@ -1095,11 +1052,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitLocaleEncodingList(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
Iterator<XmlParser.Node> iter = node.iterator("locale-encoding-mapping");
|
||||
|
@ -1146,11 +1098,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitErrorPage(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
String error = node.getString("error-code", false, true);
|
||||
|
@ -1212,10 +1159,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param node
|
||||
*/
|
||||
public void addWelcomeFiles(WebAppContext context, XmlParser.Node node)
|
||||
{
|
||||
Iterator<XmlParser.Node> iter = node.iterator("welcome-file");
|
||||
|
@ -1230,12 +1173,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param servletName
|
||||
* @param node
|
||||
* @param context
|
||||
*/
|
||||
public ServletMapping addServletMapping (String servletName, XmlParser.Node node, WebAppContext context, Descriptor descriptor)
|
||||
{
|
||||
ServletMapping mapping = new ServletMapping();
|
||||
|
@ -1295,11 +1232,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
return mapping;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param filterName
|
||||
* @param node
|
||||
* @param context
|
||||
*/
|
||||
public void addFilterMapping (String filterName, XmlParser.Node node, WebAppContext context, Descriptor descriptor)
|
||||
{
|
||||
FilterMapping mapping = new FilterMapping();
|
||||
|
@ -1340,12 +1272,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
_filterMappings.add(mapping);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitTagLib(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
//Additive across web.xml and web-fragment.xml
|
||||
|
@ -1367,11 +1293,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
config.addTaglibDescriptor(tl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitJspConfig(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
//Additive across web.xml and web-fragment.xml
|
||||
|
@ -1448,11 +1369,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitSecurityConstraint(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
Constraint scBase = new Constraint();
|
||||
|
@ -1562,12 +1478,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
* @throws Exception
|
||||
*/
|
||||
public void visitLoginConfig(WebAppContext context, Descriptor descriptor, XmlParser.Node node) throws Exception
|
||||
{
|
||||
//ServletSpec 3.0 p74 says elements present 0/1 time if specified in web.xml take
|
||||
|
@ -1732,11 +1642,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitSecurityRole(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
//ServletSpec 3.0, p74 elements with multiplicity >1 are additive when merged
|
||||
|
@ -1745,12 +1650,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
((ConstraintAware)context.getSecurityHandler()).addRole(role);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitFilter(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
String name = node.getString("filter-name", false, true);
|
||||
|
@ -1882,11 +1781,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitFilterMapping(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
//Servlet Spec 3.0, p74
|
||||
|
@ -1925,12 +1819,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitListener(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
String className = node.getString("listener-class", false, true);
|
||||
|
@ -1972,11 +1860,6 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
public void visitDistributable(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
// the element has no content, so its simple presence
|
||||
|
@ -1989,25 +1872,18 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
/**
|
||||
* Servlet spec 3.1. When present in web.xml, this means that http methods that are
|
||||
* not covered by security constraints should have access denied.
|
||||
*
|
||||
* <p>
|
||||
* See section 13.8.4, pg 145
|
||||
* @param context
|
||||
* @param descriptor
|
||||
* @param node
|
||||
*
|
||||
* @param context the of the processing
|
||||
* @param descriptor the descriptor
|
||||
* @param node the xml node
|
||||
*/
|
||||
public void visitDenyUncoveredHttpMethods(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
((ConstraintAware)context.getSecurityHandler()).setDenyUncoveredHttpMethods(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param clazz
|
||||
* @return the new event listener
|
||||
* @throws ServletException
|
||||
* @throws InstantiationException
|
||||
* @throws IllegalAccessException
|
||||
*/
|
||||
public EventListener newListenerInstance(WebAppContext context,Class<? extends EventListener> clazz) throws Exception
|
||||
{
|
||||
ListenerHolder h = context.getServletHandler().newListenerHolder(Source.DESCRIPTOR);
|
||||
|
@ -2018,15 +1894,9 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param p
|
||||
* @return the normalized pattern
|
||||
*/
|
||||
public String normalizePattern(String p)
|
||||
{
|
||||
if (p != null && p.length() > 0 && !p.startsWith("/") && !p.startsWith("*")) return "/" + p;
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -37,6 +37,8 @@ import java.util.Set;
|
|||
import java.util.StringTokenizer;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.jws.soap.SOAPBinding.Use;
|
||||
|
||||
import org.eclipse.jetty.util.IO;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
|
@ -45,11 +47,12 @@ import org.eclipse.jetty.util.resource.Resource;
|
|||
import org.eclipse.jetty.util.resource.ResourceCollection;
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** ClassLoader for HttpContext.
|
||||
/**
|
||||
* ClassLoader for HttpContext.
|
||||
* <p>
|
||||
* Specializes URLClassLoader with some utility and file mapping
|
||||
* methods.
|
||||
*
|
||||
* <p>
|
||||
* This loader defaults to the 2.3 servlet spec behavior where non
|
||||
* system classes are loaded from the classpath in preference to the
|
||||
* parent loader. Java2 compliant loading, where the parent loader
|
||||
|
@ -57,11 +60,10 @@ import org.eclipse.jetty.util.resource.ResourceCollection;
|
|||
* {@link org.eclipse.jetty.webapp.WebAppContext#setParentLoaderPriority(boolean)}
|
||||
* method and influenced with {@link WebAppContext#isServerClass(String)} and
|
||||
* {@link WebAppContext#isSystemClass(String)}.
|
||||
*
|
||||
* <p>
|
||||
* If no parent class loader is provided, then the current thread
|
||||
* context classloader will be used. If that is null then the
|
||||
* classloader that loaded this class is used as the parent.
|
||||
*
|
||||
*/
|
||||
public class WebAppClassLoader extends URLClassLoader
|
||||
{
|
||||
|
@ -135,7 +137,10 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** Constructor.
|
||||
/**
|
||||
* Constructor.
|
||||
* @param context the context for this classloader
|
||||
* @throws IOException if unable to initialize from context
|
||||
*/
|
||||
public WebAppClassLoader(Context context)
|
||||
throws IOException
|
||||
|
@ -144,7 +149,12 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** Constructor.
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param parent the parent classloader
|
||||
* @param context the context for this classloader
|
||||
* @throws IOException if unable to initialize classloader
|
||||
*/
|
||||
public WebAppClassLoader(ClassLoader parent, Context context)
|
||||
throws IOException
|
||||
|
@ -204,6 +214,7 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
* @param resource Comma or semicolon separated path of filenames or URLs
|
||||
* pointing to directories or jar files. Directories should end
|
||||
* with '/'.
|
||||
* @throws IOException if unable to add classpath from resource
|
||||
*/
|
||||
public void addClassPath(Resource resource)
|
||||
throws IOException
|
||||
|
@ -224,6 +235,7 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
* @param classPath Comma or semicolon separated path of filenames or URLs
|
||||
* pointing to directories or jar files. Directories should end
|
||||
* with '/'.
|
||||
* @throws IOException if unable to add classpath
|
||||
*/
|
||||
public void addClassPath(String classPath)
|
||||
throws IOException
|
||||
|
@ -470,9 +482,10 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* @see addTransformer
|
||||
* @deprecated
|
||||
* @param transformer the transformer to add
|
||||
* @deprecated {@link #addTransformer(ClassFileTransformer)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public void addClassFileTransformer(ClassFileTransformer transformer)
|
||||
{
|
||||
_transformers.add(transformer);
|
||||
|
@ -480,27 +493,23 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* @see removeTransformer
|
||||
* @deprecated
|
||||
* @param transformer the transformer to remove
|
||||
* @return true if transformer was removed
|
||||
* @deprecated use {@link #removeTransformer(ClassFileTransformer)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean removeClassFileTransformer(ClassFileTransformer transformer)
|
||||
{
|
||||
return _transformers.remove(transformer);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* @see addClassFileTransformer
|
||||
*/
|
||||
public void addTransformer(ClassFileTransformer transformer)
|
||||
{
|
||||
_transformers.add(transformer);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* @see removeClassFileTransformer
|
||||
*/
|
||||
public boolean removeTransformer(ClassFileTransformer transformer)
|
||||
{
|
||||
return _transformers.remove(transformer);
|
||||
|
|
|
@ -34,6 +34,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.Servlet;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletRegistration.Dynamic;
|
||||
import javax.servlet.ServletSecurityElement;
|
||||
|
@ -66,8 +67,9 @@ import org.eclipse.jetty.util.log.Logger;
|
|||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.util.resource.ResourceCollection;
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** Web Application Context Handler.
|
||||
/**
|
||||
* Web Application Context Handler.
|
||||
* <p>
|
||||
* The WebAppContext handler is an extension of ContextHandler that
|
||||
* coordinates the construction and configuration of nested handlers:
|
||||
* {@link org.eclipse.jetty.security.ConstraintSecurityHandler}, {@link org.eclipse.jetty.server.session.SessionHandler}
|
||||
|
@ -77,7 +79,6 @@ import org.eclipse.jetty.util.resource.ResourceCollection;
|
|||
* {@link org.eclipse.jetty.webapp.JettyWebXmlConfiguration}.
|
||||
*
|
||||
* @org.apache.xbean.XBean description="Creates a servlet web application at a given context from a resource base"
|
||||
*
|
||||
*/
|
||||
@ManagedObject("Web Application ContextHandler")
|
||||
public class WebAppContext extends ServletContextHandler implements WebAppClassLoader.Context
|
||||
|
@ -243,10 +244,13 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
/**
|
||||
* This constructor is used in the geronimo integration.
|
||||
*
|
||||
* @param parent the parent handler
|
||||
* @param contextPath the context path
|
||||
* @param sessionHandler SessionHandler for this web app
|
||||
* @param securityHandler SecurityHandler for this web app
|
||||
* @param servletHandler ServletHandler for this web app
|
||||
* @param errorHandler ErrorHandler for this web app
|
||||
* @param options the options ({@link ServletContextHandler#SESSIONS} and/or {@link ServletContextHandler#SECURITY})
|
||||
*/
|
||||
public WebAppContext(HandlerContainer parent, String contextPath, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler,int options)
|
||||
{
|
||||
|
@ -280,12 +284,13 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** Set Resource Alias.
|
||||
/**
|
||||
* Set Resource Alias.
|
||||
* Resource aliases map resource uri's within a context.
|
||||
* They may optionally be used by a handler when looking for
|
||||
* a resource.
|
||||
* @param alias
|
||||
* @param uri
|
||||
* @param alias the alias for a resource
|
||||
* @param uri the uri for the resource
|
||||
*/
|
||||
public void setResourceAlias(String alias, String uri)
|
||||
{
|
||||
|
@ -415,11 +420,13 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** Pre configure the web application.
|
||||
/**
|
||||
* Pre configure the web application.
|
||||
* <p>
|
||||
* The method is normally called from {@link #start()}. It performs
|
||||
* the discovery of the configurations to be applied to this context,
|
||||
* specifically:<ul>
|
||||
* specifically:
|
||||
* <ul>
|
||||
* <li>Instantiate the {@link Configuration} instances with a call to {@link #loadConfigurations()}.
|
||||
* <li>Setup the default System classes by calling {@link #loadSystemClasses()}
|
||||
* <li>Setup the default Server classes by calling <code>loadServerClasses()</code>
|
||||
|
@ -427,7 +434,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
* <li>Calls the {@link Configuration#preConfigure(WebAppContext)} method of all
|
||||
* Configuration instances.
|
||||
* </ul>
|
||||
* @throws Exception
|
||||
* @throws Exception if unable to pre configure
|
||||
*/
|
||||
public void preConfigure() throws Exception
|
||||
{
|
||||
|
@ -1064,7 +1071,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
/* ------------------------------------------------------------ */
|
||||
/** Add EventListener
|
||||
* Convenience method that calls {@link #setEventListeners(EventListener[])}
|
||||
* @param listener
|
||||
* @param listener the listener to add
|
||||
*/
|
||||
@Override
|
||||
public void addEventListener(EventListener listener)
|
||||
|
@ -1152,9 +1159,10 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
*
|
||||
* In certain circumstances you want may want to deny access of one webapp from another
|
||||
* when you may not fully trust the webapp. Setting this white list will enable a
|
||||
* check when a servlet called getContext(String), validating that the uriInPath
|
||||
* check when a servlet called {@link org.eclipse.jetty.servlet.ServletContextHandler.Context#getContext(String)}, validating that the uriInPath
|
||||
* for the given webapp has been declaratively allows access to the context.
|
||||
* @param contextWhiteList
|
||||
*
|
||||
* @param contextWhiteList the whitelist of contexts for {@link org.eclipse.jetty.servlet.ServletContextHandler.Context#getContext(String)}
|
||||
*/
|
||||
public void setContextWhiteList(String[] contextWhiteList)
|
||||
{
|
||||
|
@ -1234,7 +1242,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
* webapp will be kept when the webapp stops. Otherwise,
|
||||
* it will be deleted.
|
||||
*
|
||||
* @param delete
|
||||
* @param persist true to persist the temp directory on shutdown / exit of the webapp
|
||||
*/
|
||||
public void setPersistTempDirectory(boolean persist)
|
||||
{
|
||||
|
@ -1242,7 +1250,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @return true if tmp directory will persist between startups of the webapp
|
||||
*/
|
||||
public boolean isPersistTempDirectory()
|
||||
{
|
||||
|
|
|
@ -227,8 +227,8 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
* Get a temporary directory in which to unpack the war etc etc.
|
||||
* The algorithm for determining this is to check these alternatives
|
||||
* in the order shown:
|
||||
*
|
||||
* <p>A. Try to use an explicit directory specifically for this webapp:</p>
|
||||
* <p>
|
||||
* A. Try to use an explicit directory specifically for this webapp:
|
||||
* <ol>
|
||||
* <li>
|
||||
* Iff an explicit directory is set for this webapp, use it. Set delete on
|
||||
|
@ -236,19 +236,21 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
* </li>
|
||||
* <li>
|
||||
* Iff javax.servlet.context.tempdir context attribute is set for
|
||||
* this webapp && exists && writeable, then use it. Set delete on exit depends on
|
||||
* this webapp && exists && writeable, then use it. Set delete on exit depends on
|
||||
* value of persistTempDirectory.
|
||||
* </li>
|
||||
* </ol>
|
||||
*
|
||||
* <p>B. Create a directory based on global settings. The new directory
|
||||
* will be called "Jetty-"+host+"-"+port+"__"+context+"-"+virtualhost+"-"+randomdigits+".dir"
|
||||
* </p>
|
||||
* <p>
|
||||
* B. Create a directory based on global settings. The new directory
|
||||
* will be called <code>"Jetty-"+host+"-"+port+"__"+context+"-"+virtualhost+"-"+randomdigits+".dir"</code>
|
||||
* <p>
|
||||
* If the user has specified the context attribute org.eclipse.jetty.webapp.basetempdir, the
|
||||
* directory specified by this attribute will be the parent of the temp dir created. Otherwise,
|
||||
* the parent dir is $(java.io.tmpdir). Set delete on exit depends on value of persistTempDirectory.
|
||||
* </p>
|
||||
* the parent dir is <code>${java.io.tmpdir}</code>. Set delete on exit depends on value of persistTempDirectory.
|
||||
*
|
||||
* @param context the context to resolve the temp directory from
|
||||
* @throws Exception if unable to resolve the temp directory
|
||||
*/
|
||||
public void resolveTempDirectory (WebAppContext context)
|
||||
throws Exception
|
||||
|
@ -546,18 +548,18 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a canonical name for a webapp temp directory.
|
||||
* <p>
|
||||
* The form of the name is:
|
||||
* <code>"jetty-"+host+"-"+port+"-"+resourceBase+"-_"+context+"-"+virtualhost+"-"+randomdigits+".dir"</code>
|
||||
*
|
||||
* <pre>"jetty-"+host+"-"+port+"-"+resourceBase+"-_"+context+"-"+virtualhost+"-"+randomdigits+".dir"</pre>
|
||||
*
|
||||
* host and port uniquely identify the server
|
||||
* context and virtual host uniquely identify the webapp
|
||||
* randomdigits ensure every tmp directory is unique
|
||||
*
|
||||
* @param context the context to get the canonical name from
|
||||
* @return the canonical name for the webapp temp directory
|
||||
*/
|
||||
public static String getCanonicalNameForWebAppTmpDir (WebAppContext context)
|
||||
|
@ -598,7 +600,6 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//Resource base
|
||||
try
|
||||
{
|
||||
|
@ -678,9 +679,9 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
/**
|
||||
* Look for jars that should be treated as if they are in WEB-INF/lib
|
||||
*
|
||||
* @param context
|
||||
* @param context the context to find the jars in
|
||||
* @return the list of jar resources found within context
|
||||
* @throws Exception
|
||||
* @throws Exception if unable to find the jars
|
||||
*/
|
||||
protected List<Resource> findJars (WebAppContext context)
|
||||
throws Exception
|
||||
|
@ -696,11 +697,11 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
}
|
||||
|
||||
/**
|
||||
* Look for jars in WEB-INF/lib
|
||||
* Look for jars in <code>WEB-INF/lib</code>
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
* @throws Exception
|
||||
* @param context the context to find the lib jars in
|
||||
* @return the list of jars as {@link Resource}
|
||||
* @throws Exception if unable to scan for lib jars
|
||||
*/
|
||||
protected List<Resource> findWebInfLibJars(WebAppContext context)
|
||||
throws Exception
|
||||
|
@ -741,9 +742,9 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
/**
|
||||
* Get jars from WebAppContext.getExtraClasspath as resources
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
* @throws Exception
|
||||
* @param context the context to find extra classpath jars in
|
||||
* @return the list of Resources with the extra classpath, or null if not found
|
||||
* @throws Exception if unable to find the extra classpath jars
|
||||
*/
|
||||
protected List<Resource> findExtraClasspathJars(WebAppContext context)
|
||||
throws Exception
|
||||
|
@ -769,11 +770,11 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
}
|
||||
|
||||
/**
|
||||
* Get WEB-INF/classes dir
|
||||
* Get <code>WEB-INF/classes</code> dir
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
* @throws Exception
|
||||
* @param context the context to look for the <code>WEB-INF/classes</code> directory
|
||||
* @return the Resource for the <code>WEB-INF/classes</code> directory
|
||||
* @throws Exception if unable to find the <code>WEB-INF/classes</code> directory
|
||||
*/
|
||||
protected Resource findWebInfClassesDir (WebAppContext context)
|
||||
throws Exception
|
||||
|
@ -798,9 +799,9 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
/**
|
||||
* Get class dirs from WebAppContext.getExtraClasspath as resources
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
* @throws Exception
|
||||
* @param context the context to look for extra classpaths in
|
||||
* @return the list of Resources to the extra classpath
|
||||
* @throws Exception if unable to find the extra classpaths
|
||||
*/
|
||||
protected List<Resource> findExtraClasspathDirs(WebAppContext context)
|
||||
throws Exception
|
||||
|
|
|
@ -37,8 +37,6 @@ import org.junit.Test;
|
|||
|
||||
/**
|
||||
* OrderingTest
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class OrderingTest
|
||||
{
|
||||
|
@ -111,9 +109,6 @@ public class OrderingTest
|
|||
return _name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.util.resource.Resource#getURL()
|
||||
*/
|
||||
@Override
|
||||
public URL getURL()
|
||||
{
|
||||
|
|
|
@ -123,7 +123,7 @@ public class WebAppContextTest
|
|||
/**
|
||||
* tests that the servlet context white list works
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception on test failure
|
||||
*/
|
||||
@Test
|
||||
public void testContextWhiteList() throws Exception
|
||||
|
|
Loading…
Reference in New Issue