464727 - Update Javadoc for Java 8 DocLint
+ Fixing javadoc in jetty-annotations
This commit is contained in:
parent
b58bbd906d
commit
cffeea3ed6
|
@ -58,8 +58,6 @@ import org.eclipse.jetty.webapp.WebDescriptor;
|
|||
|
||||
/**
|
||||
* Configuration for Annotations
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class AnnotationConfiguration extends AbstractConfiguration
|
||||
{
|
||||
|
@ -292,8 +290,7 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
}
|
||||
|
||||
/**
|
||||
* True if "*" is one of the values.
|
||||
* @return
|
||||
* @return true if "*" is one of the values.
|
||||
*/
|
||||
public boolean hasWildcard()
|
||||
{
|
||||
|
@ -301,8 +298,7 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the index of the "*" element, if it is specified. -1 otherwise.
|
||||
* @return
|
||||
* @return the index of the "*" element, if it is specified. -1 otherwise.
|
||||
*/
|
||||
public int getWildcardIndex()
|
||||
{
|
||||
|
@ -312,8 +308,7 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
}
|
||||
|
||||
/**
|
||||
* True if the ordering contains a single value of "*"
|
||||
* @return
|
||||
* @return true if the ordering contains a single value of "*"
|
||||
*/
|
||||
public boolean isDefaultOrder ()
|
||||
{
|
||||
|
@ -322,8 +317,8 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
|
||||
/**
|
||||
* Get the order index of the given classname
|
||||
* @param name
|
||||
* @return
|
||||
* @param name the classname to look up
|
||||
* @return the index of the class name (or -1 if not found)
|
||||
*/
|
||||
public int getIndexOf (String name)
|
||||
{
|
||||
|
@ -335,7 +330,7 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
|
||||
/**
|
||||
* Get the number of elements of the ordering
|
||||
* @return
|
||||
* @return the size of the index
|
||||
*/
|
||||
public int getSize()
|
||||
{
|
||||
|
@ -498,8 +493,8 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
/**
|
||||
* Perform scanning of classes for annotations
|
||||
*
|
||||
* @param context
|
||||
* @throws Exception
|
||||
* @param context the context for the scan
|
||||
* @throws Exception if unable to scan
|
||||
*/
|
||||
protected void scanForAnnotations (WebAppContext context)
|
||||
throws Exception
|
||||
|
@ -591,8 +586,9 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
|
||||
/**
|
||||
* Check if we should use multiple threads to scan for annotations or not
|
||||
* @param context
|
||||
* @return
|
||||
* @param context the context of the multi threaded setting
|
||||
* @return true if multi threading is enabled on the context, server, or via a System property.
|
||||
* @see #MULTI_THREADED
|
||||
*/
|
||||
protected boolean isUseMultiThreading(WebAppContext context)
|
||||
{
|
||||
|
@ -617,8 +613,9 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
/**
|
||||
* Work out how long we should wait for the async scanning to occur.
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
* @param context the context of the max scan wait setting
|
||||
* @return the max scan wait setting on the context, or server, or via a System property.
|
||||
* @see #MAX_SCAN_WAIT
|
||||
*/
|
||||
protected int getMaxScanWait (WebAppContext context)
|
||||
{
|
||||
|
@ -638,8 +635,6 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
return Integer.getInteger(MAX_SCAN_WAIT, DEFAULT_MAX_SCAN_WAIT).intValue();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.webapp.AbstractConfiguration#cloneConfigure(org.eclipse.jetty.webapp.WebAppContext, org.eclipse.jetty.webapp.WebAppContext)
|
||||
*/
|
||||
|
@ -649,13 +644,6 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
context.getObjectFactory().addDecorator(new AnnotationDecorator(context));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param scis
|
||||
* @throws Exception
|
||||
*/
|
||||
public void createServletContainerInitializerAnnotationHandlers (WebAppContext context, List<ServletContainerInitializer> scis)
|
||||
throws Exception
|
||||
{
|
||||
|
@ -723,7 +711,6 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
context.addBean(starter, true);
|
||||
}
|
||||
|
||||
|
||||
public Resource getJarFor (ServletContainerInitializer service)
|
||||
throws MalformedURLException, IOException
|
||||
{
|
||||
|
@ -746,13 +733,15 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
return Resource.newResource(loadingJarName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check to see if the ServletContainerIntializer loaded via the ServiceLoader came
|
||||
* from a jar that is excluded by the fragment ordering. See ServletSpec 3.0 p.85.
|
||||
* @param context
|
||||
* @param sci
|
||||
*
|
||||
* @param context the context for the jars
|
||||
* @param sci the servlet container initializer
|
||||
* @param sciResource the resource for the servlet container initializer
|
||||
* @return true if excluded
|
||||
* @throws Exception if unable to determine exclusion
|
||||
*/
|
||||
public boolean isFromExcludedJar (WebAppContext context, ServletContainerInitializer sci, Resource sciResource)
|
||||
throws Exception
|
||||
|
@ -799,9 +788,9 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
/**
|
||||
* Test if the ServletContainerIntializer is excluded by the
|
||||
* o.e.j.containerInitializerExclusionPattern
|
||||
* @param context
|
||||
* @param sci
|
||||
* @return
|
||||
*
|
||||
* @param sci the ServletContainerIntializer
|
||||
* @return true if the ServletContainerIntializer is excluded
|
||||
*/
|
||||
public boolean matchesExclusionPattern(ServletContainerInitializer sci)
|
||||
{
|
||||
|
@ -818,9 +807,9 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
/**
|
||||
* Test if the ServletContainerInitializer is from the container classpath
|
||||
*
|
||||
* @param context
|
||||
* @param sci
|
||||
* @return
|
||||
* @param context the context for the webapp classpath
|
||||
* @param sci the ServletContainerIntializer
|
||||
* @return true if ServletContainerIntializer is from container classpath
|
||||
*/
|
||||
public boolean isFromContainerClassPath (WebAppContext context, ServletContainerInitializer sci)
|
||||
{
|
||||
|
@ -829,11 +818,6 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
return sci.getClass().getClassLoader()==context.getClassLoader().getParent();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @return list of non-excluded {@link ServletContainerInitializer}s
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<ServletContainerInitializer> getNonExcludedInitializers (WebAppContext context)
|
||||
throws Exception
|
||||
{
|
||||
|
@ -952,7 +936,8 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
/**
|
||||
* Jetty-specific extension that allows an ordering to be applied across ALL ServletContainerInitializers.
|
||||
*
|
||||
* @return
|
||||
* @param context the context for the initializer ordering configuration
|
||||
* @return the ordering of the ServletContainerIntializer's
|
||||
*/
|
||||
public ServletContainerInitializerOrdering getInitializerOrdering (WebAppContext context)
|
||||
{
|
||||
|
@ -970,9 +955,9 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
/**
|
||||
* Scan jars on container path.
|
||||
*
|
||||
* @param context
|
||||
* @param parser
|
||||
* @throws Exception
|
||||
* @param context the context for the scan
|
||||
* @param parser the parser to scan with
|
||||
* @throws Exception if unable to scan
|
||||
*/
|
||||
public void parseContainerPath (final WebAppContext context, final AnnotationParser parser) throws Exception
|
||||
{
|
||||
|
@ -1003,9 +988,9 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
/**
|
||||
* Scan jars in WEB-INF/lib
|
||||
*
|
||||
* @param context
|
||||
* @param parser
|
||||
* @throws Exception
|
||||
* @param context the context for the scan
|
||||
* @param parser the annotation parser to use
|
||||
* @throws Exception if unable to scan and/or parse
|
||||
*/
|
||||
public void parseWebInfLib (final WebAppContext context, final AnnotationParser parser) throws Exception
|
||||
{
|
||||
|
@ -1066,9 +1051,9 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
/**
|
||||
* Scan classes in WEB-INF/classes
|
||||
*
|
||||
* @param context
|
||||
* @param parser
|
||||
* @throws Exception
|
||||
* @param context the context for the scan
|
||||
* @param parser the annotation parser to use
|
||||
* @throws Exception if unable to scan and/or parse
|
||||
*/
|
||||
public void parseWebInfClasses (final WebAppContext context, final AnnotationParser parser)
|
||||
throws Exception
|
||||
|
@ -1099,10 +1084,10 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
/**
|
||||
* Get the web-fragment.xml from a jar
|
||||
*
|
||||
* @param jar
|
||||
* @param frags
|
||||
* @return the fragment if found, or null of not found
|
||||
* @throws Exception
|
||||
* @param jar the jar to look in for a fragment
|
||||
* @param frags the fragments previously found
|
||||
* @return true if the fragment if found, or null of not found
|
||||
* @throws Exception if unable to determine the the fragment contains
|
||||
*/
|
||||
public FragmentDescriptor getFragmentFromJar (Resource jar, List<FragmentDescriptor> frags)
|
||||
throws Exception
|
||||
|
|
|
@ -23,16 +23,11 @@ import org.eclipse.jetty.webapp.WebAppContext;
|
|||
|
||||
/**
|
||||
* AnnotationDecorator
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class AnnotationDecorator implements Decorator
|
||||
{
|
||||
protected AnnotationIntrospector _introspector = new AnnotationIntrospector();
|
||||
|
||||
/**
|
||||
* @param context
|
||||
*/
|
||||
public AnnotationDecorator(WebAppContext context)
|
||||
{
|
||||
registerHandlers(context);
|
||||
|
@ -53,13 +48,13 @@ public class AnnotationDecorator implements Decorator
|
|||
/**
|
||||
* Look for annotations that can be discovered with introspection:
|
||||
* <ul>
|
||||
* <li> Resource
|
||||
* <li> Resources
|
||||
* <li> PostConstruct
|
||||
* <li> PreDestroy
|
||||
* <li> ServletSecurity?
|
||||
* <li> Resource </li>
|
||||
* <li> Resources </li>
|
||||
* <li> PostConstruct </li>
|
||||
* <li> PreDestroy </li>
|
||||
* <li> ServletSecurity? </li>
|
||||
* </ul>
|
||||
* @param o
|
||||
* @param o the object ot introspect
|
||||
*/
|
||||
protected void introspect (Object o)
|
||||
{
|
||||
|
|
|
@ -48,18 +48,18 @@ import org.objectweb.asm.Opcodes;
|
|||
|
||||
/**
|
||||
* AnnotationParser
|
||||
*
|
||||
* <p>
|
||||
* Use asm to scan classes for annotations. A SAX-style parsing is done.
|
||||
* Handlers are registered which will be called back when various types of
|
||||
* entity are encountered, eg a class, a method, a field.
|
||||
*
|
||||
* <p>
|
||||
* Handlers are not called back in any particular order and are assumed
|
||||
* to be order-independent.
|
||||
*
|
||||
* <p>
|
||||
* As a registered Handler will be called back for each annotation discovered
|
||||
* on a class, a method, a field, the Handler should test to see if the annotation
|
||||
* is one that it is interested in.
|
||||
*
|
||||
* <p>
|
||||
* For the servlet spec, we are only interested in annotations on classes, methods and fields,
|
||||
* so the callbacks for handling finding a class, a method a field are themselves
|
||||
* not fully implemented.
|
||||
|
@ -76,8 +76,8 @@ public class AnnotationParser
|
|||
/**
|
||||
* Convert internal name to simple name
|
||||
*
|
||||
* @param name
|
||||
* @return
|
||||
* @param name the internal name
|
||||
* @return the simple name
|
||||
*/
|
||||
public static String normalize (String name)
|
||||
{
|
||||
|
@ -96,8 +96,8 @@ public class AnnotationParser
|
|||
/**
|
||||
* Convert internal names to simple names.
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
* @param list the list of internal names
|
||||
* @return the list of simple names
|
||||
*/
|
||||
public static String[] normalize (String[] list)
|
||||
{
|
||||
|
@ -291,7 +291,6 @@ public class AnnotationParser
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handler
|
||||
*
|
||||
|
@ -307,13 +306,10 @@ public class AnnotationParser
|
|||
public void handle (FieldInfo info, String annotationName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* AbstractHandler
|
||||
*
|
||||
* Convenience base class to provide no-ops for all Handler methods.
|
||||
*
|
||||
*/
|
||||
public static abstract class AbstractHandler implements Handler
|
||||
{
|
||||
|
@ -533,7 +529,8 @@ public class AnnotationParser
|
|||
|
||||
/**
|
||||
* True if the class has already been processed, false otherwise
|
||||
* @param className
|
||||
* @param className the classname
|
||||
* @return true if class was parsed, false if not
|
||||
*/
|
||||
public boolean isParsed (String className)
|
||||
{
|
||||
|
@ -545,9 +542,10 @@ public class AnnotationParser
|
|||
/**
|
||||
* Parse a given class
|
||||
*
|
||||
* @param className
|
||||
* @param resolver
|
||||
* @throws Exception
|
||||
* @param handlers the set of handlers to find class
|
||||
* @param className the class name to parse
|
||||
* @param resolver the class name resolver to use
|
||||
* @throws Exception if unable to parse
|
||||
*/
|
||||
public void parse (Set<? extends Handler> handlers, String className, ClassNameResolver resolver)
|
||||
throws Exception
|
||||
|
@ -575,10 +573,11 @@ public class AnnotationParser
|
|||
/**
|
||||
* Parse the given class, optionally walking its inheritance hierarchy
|
||||
*
|
||||
* @param clazz
|
||||
* @param resolver
|
||||
* @param visitSuperClasses
|
||||
* @throws Exception
|
||||
* @param handlers the handlers to look for class in
|
||||
* @param clazz the class to look for
|
||||
* @param resolver the resolver to look up class with
|
||||
* @param visitSuperClasses if true, also visit super classes for parse
|
||||
* @throws Exception if unable to parse class
|
||||
*/
|
||||
public void parse (Set<? extends Handler> handlers, Class<?> clazz, ClassNameResolver resolver, boolean visitSuperClasses)
|
||||
throws Exception
|
||||
|
@ -612,9 +611,10 @@ public class AnnotationParser
|
|||
/**
|
||||
* Parse the given classes
|
||||
*
|
||||
* @param classNames
|
||||
* @param resolver
|
||||
* @throws Exception
|
||||
* @param handlers the set of handlers to look for class in
|
||||
* @param classNames the class name
|
||||
* @param resolver the class name resolver
|
||||
* @throws Exception if unable to parse
|
||||
*/
|
||||
public void parse (Set<? extends Handler> handlers, String[] classNames, ClassNameResolver resolver)
|
||||
throws Exception
|
||||
|
@ -629,9 +629,10 @@ public class AnnotationParser
|
|||
/**
|
||||
* Parse the given classes
|
||||
*
|
||||
* @param classNames
|
||||
* @param resolver
|
||||
* @throws Exception
|
||||
* @param handlers the set of handlers to look for class in
|
||||
* @param classNames the class names
|
||||
* @param resolver the class name resolver
|
||||
* @throws Exception if unable to parse
|
||||
*/
|
||||
public void parse (Set<? extends Handler> handlers, List<String> classNames, ClassNameResolver resolver)
|
||||
throws Exception
|
||||
|
@ -665,14 +666,15 @@ public class AnnotationParser
|
|||
/**
|
||||
* Parse all classes in a directory
|
||||
*
|
||||
* @param dir
|
||||
* @param resolver
|
||||
* @throws Exception
|
||||
* @param handlers the set of handlers to look for classes in
|
||||
* @param dir the resource directory to look for classes
|
||||
* @param resolver the class name resolver
|
||||
* @throws Exception if unable to parse
|
||||
*/
|
||||
protected void parseDir (Set<? extends Handler> handlers, Resource dir, ClassNameResolver resolver)
|
||||
throws Exception
|
||||
{
|
||||
//skip dirs whose name start with . (ie hidden)
|
||||
// skip dirs whose name start with . (ie hidden)
|
||||
if (!dir.isDirectory() || !dir.exists() || dir.getName().startsWith("."))
|
||||
return;
|
||||
|
||||
|
@ -723,11 +725,12 @@ public class AnnotationParser
|
|||
* Parse classes in the supplied classloader.
|
||||
* Only class files in jar files will be scanned.
|
||||
*
|
||||
* @param loader
|
||||
* @param visitParents
|
||||
* @param nullInclusive
|
||||
* @param resolver
|
||||
* @throws Exception
|
||||
* @param handlers the handlers to look for classes in
|
||||
* @param loader the classloader for the classes
|
||||
* @param visitParents if true, visit parent classloaders too
|
||||
* @param nullInclusive if true, an empty pattern means all names match, if false, none match
|
||||
* @param resolver the class name resolver
|
||||
* @throws Exception if unable to parse
|
||||
*/
|
||||
public void parse (final Set<? extends Handler> handlers, ClassLoader loader, boolean visitParents, boolean nullInclusive, final ClassNameResolver resolver)
|
||||
throws Exception
|
||||
|
@ -765,9 +768,10 @@ public class AnnotationParser
|
|||
/**
|
||||
* Parse classes in the supplied uris.
|
||||
*
|
||||
* @param uris
|
||||
* @param resolver
|
||||
* @throws Exception
|
||||
* @param handlers the handlers to look for classes in
|
||||
* @param uris the uris for the jars
|
||||
* @param resolver the class name resolver
|
||||
* @throws Exception if unable to parse
|
||||
*/
|
||||
public void parse (final Set<? extends Handler> handlers, final URI[] uris, final ClassNameResolver resolver)
|
||||
throws Exception
|
||||
|
@ -793,9 +797,11 @@ public class AnnotationParser
|
|||
|
||||
/**
|
||||
* Parse a particular uri
|
||||
* @param uri
|
||||
* @param resolver
|
||||
* @throws Exception
|
||||
*
|
||||
* @param handlers the handlers to look for classes in
|
||||
* @param uri the uri for the jar
|
||||
* @param resolver the class name resolver
|
||||
* @throws Exception if unable to parse
|
||||
*/
|
||||
public void parse (final Set<? extends Handler> handlers, URI uri, final ClassNameResolver resolver)
|
||||
throws Exception
|
||||
|
@ -809,9 +815,11 @@ public class AnnotationParser
|
|||
|
||||
/**
|
||||
* Parse a resource
|
||||
* @param r
|
||||
* @param resolver
|
||||
* @throws Exception
|
||||
*
|
||||
* @param handlers the handlers to look for classes in
|
||||
* @param r the resource to parse
|
||||
* @param resolver the class name resolver
|
||||
* @throws Exception if unable to parse
|
||||
*/
|
||||
public void parse (final Set<? extends Handler> handlers, Resource r, final ClassNameResolver resolver)
|
||||
throws Exception
|
||||
|
@ -847,9 +855,10 @@ public class AnnotationParser
|
|||
/**
|
||||
* Parse a resource that is a jar file.
|
||||
*
|
||||
* @param jarResource
|
||||
* @param resolver
|
||||
* @throws Exception
|
||||
* @param handlers the handlers to look for classes in
|
||||
* @param jarResource the jar resource to parse
|
||||
* @param resolver the class name resolver
|
||||
* @throws Exception if unable to parse
|
||||
*/
|
||||
protected void parseJar (Set<? extends Handler> handlers, Resource jarResource, final ClassNameResolver resolver)
|
||||
throws Exception
|
||||
|
@ -925,10 +934,12 @@ public class AnnotationParser
|
|||
|
||||
/**
|
||||
* Parse a single entry in a jar file
|
||||
* @param jar
|
||||
* @param entry
|
||||
* @param resolver
|
||||
* @throws Exception
|
||||
*
|
||||
* @param handlers the handlers to look for classes in
|
||||
* @param jar the jar resource to parse
|
||||
* @param entry the entry in the jar resource to parse
|
||||
* @param resolver the class name resolver
|
||||
* @throws Exception if unable to parse
|
||||
*/
|
||||
protected void parseJarEntry (Set<? extends Handler> handlers, Resource jar, JarEntry entry, final ClassNameResolver resolver)
|
||||
throws Exception
|
||||
|
@ -963,9 +974,10 @@ public class AnnotationParser
|
|||
/**
|
||||
* Use ASM on a class
|
||||
*
|
||||
* @param handlers the handlers to look for classes in
|
||||
* @param containingResource the dir or jar that the class is contained within, can be null if not known
|
||||
* @param is
|
||||
* @throws IOException
|
||||
* @param is the input stream to parse
|
||||
* @throws IOException if unable to parse
|
||||
*/
|
||||
protected void scanClass (Set<? extends Handler> handlers, Resource containingResource, InputStream is)
|
||||
throws IOException
|
||||
|
|
|
@ -25,7 +25,7 @@ public interface ClassNameResolver
|
|||
/**
|
||||
* Based on the execution context, should the class represented
|
||||
* by "name" be excluded from consideration?
|
||||
* @param name
|
||||
* @param name the name to test
|
||||
* @return true if classname is excluded
|
||||
*/
|
||||
public boolean isExcluded (String name);
|
||||
|
@ -35,7 +35,7 @@ public interface ClassNameResolver
|
|||
* Based on the execution context, if a duplicate class
|
||||
* represented by "name" is detected, should the existing
|
||||
* one be overridden or not?
|
||||
* @param name
|
||||
* @param name the name to test
|
||||
* @return true if name should be overridden
|
||||
*/
|
||||
public boolean shouldOverride (String name);
|
||||
|
|
|
@ -27,17 +27,12 @@ import org.eclipse.jetty.webapp.WebAppContext;
|
|||
|
||||
/**
|
||||
* DeclaresRolesAnnotationHandler
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class DeclareRolesAnnotationHandler extends AbstractIntrospectableAnnotationHandler
|
||||
{
|
||||
|
||||
protected WebAppContext _context;
|
||||
|
||||
/**
|
||||
* @param context
|
||||
*/
|
||||
public DeclareRolesAnnotationHandler(WebAppContext context)
|
||||
{
|
||||
super(false);
|
||||
|
|
|
@ -206,9 +206,12 @@ public class ResourceAnnotationHandler extends AbstractIntrospectableAnnotationH
|
|||
|
||||
/**
|
||||
* Process a Resource annotation on a Method.
|
||||
*
|
||||
* <p>
|
||||
* This will generate a JNDI entry, and an Injection to be
|
||||
* processed when an instance of the class is created.
|
||||
*
|
||||
* @param clazz the class to process
|
||||
* @param method the method to process
|
||||
*/
|
||||
public void handleMethod(Class<?> clazz, Method method)
|
||||
{
|
||||
|
|
|
@ -39,9 +39,6 @@ public class ServletContainerInitializersStarter extends AbstractLifeCycle imple
|
|||
private static final Logger LOG = Log.getLogger(ServletContainerInitializersStarter.class);
|
||||
WebAppContext _context;
|
||||
|
||||
/**
|
||||
* @param context
|
||||
*/
|
||||
public ServletContainerInitializersStarter(WebAppContext context)
|
||||
{
|
||||
_context = context;
|
||||
|
@ -72,6 +69,4 @@ public class ServletContainerInitializersStarter extends AbstractLifeCycle imple
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -40,15 +40,15 @@ import org.eclipse.jetty.webapp.WebAppContext;
|
|||
/**
|
||||
* ServletSecurityAnnotationHandler
|
||||
*
|
||||
* Inspect a class to see if it has an @ServletSecurity annotation on it,
|
||||
* setting up the <security-constraint>s.
|
||||
* Inspect a class to see if it has an <code>@ServletSecurity</code> annotation on it,
|
||||
* setting up the <code><security-constraint>s</code>.
|
||||
*
|
||||
* A servlet can be defined in:
|
||||
* <ul>
|
||||
* <li>web.xml
|
||||
* <li>web-fragment.xml
|
||||
* <li>@WebServlet annotation discovered
|
||||
* <li>ServletContext.createServlet
|
||||
* <li>web.xml</li>
|
||||
* <li>web-fragment.xml</li>
|
||||
* <li>@WebServlet annotation discovered</li>
|
||||
* <li>ServletContext.createServlet</li>
|
||||
* </ul>
|
||||
*
|
||||
* The ServletSecurity annotation for a servlet should only be processed
|
||||
|
@ -119,12 +119,14 @@ public class ServletSecurityAnnotationHandler extends AbstractIntrospectableAnno
|
|||
|
||||
|
||||
/**
|
||||
* Make a jetty Constraint object, which represents the <auth-constraint> and
|
||||
* <user-data-constraint> elements, based on the security annotation.
|
||||
* @param servlet
|
||||
* @param rolesAllowed
|
||||
* @param permitOrDeny
|
||||
* @param transport
|
||||
* Make a jetty Constraint object, which represents the <code><auth-constraint></code> and
|
||||
* <code><user-data-constraint></code> elements, based on the security annotation.
|
||||
*
|
||||
* @param servlet the servlet
|
||||
* @param rolesAllowed the roles allowed
|
||||
* @param permitOrDeny the role / permission semantic
|
||||
* @param transport the transport guarantee
|
||||
* @return the constraint
|
||||
*/
|
||||
protected Constraint makeConstraint (Class servlet, String[] rolesAllowed, EmptyRoleSemantic permitOrDeny, TransportGuarantee transport)
|
||||
{
|
||||
|
@ -135,7 +137,8 @@ public class ServletSecurityAnnotationHandler extends AbstractIntrospectableAnno
|
|||
|
||||
/**
|
||||
* Get the ServletMappings for the servlet's class.
|
||||
* @param className
|
||||
* @param className the class name
|
||||
* @return the servlet mappings for the class
|
||||
*/
|
||||
protected List<ServletMapping> getServletMappings(String className)
|
||||
{
|
||||
|
@ -154,9 +157,12 @@ public class ServletSecurityAnnotationHandler extends AbstractIntrospectableAnno
|
|||
|
||||
|
||||
/**
|
||||
* Check if there are already <security-constraint> elements defined that match the url-patterns for
|
||||
* Check if there are already <code><security-constraint></code> elements defined that match the url-patterns for
|
||||
* the servlet.
|
||||
* @param servletMappings
|
||||
*
|
||||
* @param servletMappings the servlet mappings
|
||||
* @param constraintMappings the constraint mappings
|
||||
* @return true if constraint exists
|
||||
*/
|
||||
protected boolean constraintsExist (List<ServletMapping> servletMappings, List<ConstraintMapping> constraintMappings)
|
||||
{
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.eclipse.jetty.util.TypeUtil;
|
|||
import org.objectweb.asm.Type;
|
||||
|
||||
/**
|
||||
* Util
|
||||
* Annotation Processing Utilities
|
||||
*/
|
||||
public class Util
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ public class Util
|
|||
/**
|
||||
* Check if the presented method belongs to a class that is one
|
||||
* of the classes with which a servlet container should be concerned.
|
||||
* @param c
|
||||
* @param c the class
|
||||
* @return true if class is a type of one of the following:
|
||||
* ({@link javax.servlet.Servlet},
|
||||
* {@link javax.servlet.Filter},
|
||||
|
|
|
@ -39,17 +39,11 @@ import org.eclipse.jetty.webapp.WebAppContext;
|
|||
|
||||
/**
|
||||
* WebFilterAnnotation
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class WebFilterAnnotation extends DiscoveredAnnotation
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(WebFilterAnnotation.class);
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param className
|
||||
*/
|
||||
public WebFilterAnnotation(WebAppContext context, String className)
|
||||
{
|
||||
super(context, className);
|
||||
|
|
|
@ -40,17 +40,11 @@ import org.eclipse.jetty.webapp.WebAppContext;
|
|||
|
||||
/**
|
||||
* WebListenerAnnotation
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class WebListenerAnnotation extends DiscoveredAnnotation
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(WebListenerAnnotation.class);
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param className
|
||||
*/
|
||||
public WebListenerAnnotation(WebAppContext context, String className)
|
||||
{
|
||||
super(context, className);
|
||||
|
|
|
@ -34,10 +34,6 @@ public class WebListenerAnnotationHandler extends AbstractDiscoverableAnnotation
|
|||
super(context);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.annotations.AnnotationParser.Handler#handle(ClassInfo, String)
|
||||
*/
|
||||
public void handle(ClassInfo info, String annotationName)
|
||||
{
|
||||
if (annotationName == null || !"javax.servlet.annotation.WebListener".equals(annotationName))
|
||||
|
|
|
@ -29,7 +29,6 @@ import org.eclipse.jetty.webapp.WebAppContext;
|
|||
* WebServletAnnotationHandler
|
||||
*
|
||||
* Process a WebServlet annotation on a class.
|
||||
*
|
||||
*/
|
||||
public class WebServletAnnotationHandler extends AbstractDiscoverableAnnotationHandler
|
||||
{
|
||||
|
@ -43,8 +42,6 @@ public class WebServletAnnotationHandler extends AbstractDiscoverableAnnotationH
|
|||
|
||||
/**
|
||||
* Handle discovering a WebServlet annotation.
|
||||
*
|
||||
* @see org.eclipse.jetty.annotations.AnnotationParser.Handler#handle(ClassInfo, String)
|
||||
*/
|
||||
@Override
|
||||
public void handle(ClassInfo info, String annotationName)
|
||||
|
|
Loading…
Reference in New Issue