users@servlet-spec.java.net

[servlet-spec users] ServletContainerInitializer and annotated annotation classes

From: Richard Evans <richard.d.evans_at_oracle.com>
Date: Tue, 13 Oct 2015 09:32:53 +0100

I'm experimenting with a ServletContainerInitializer. I'd like to find
all annotation classes with are themselves annotated with a specific
annotation - for example @A.

So I have A.class in the @HandlesTypes annotaton of the
ServletContainerInitializer. But I am getting different results
depending on application server.

In WebLogic 12 onStartup /is/ passed annotation classes which are
annotated with @A. In Tomcat 8 I do not get these classes.

The servlet 3.1 spec says:

"The HandlesTypes annotation on the implementation of the
ServletContainerInitializer is used to express interest in classes that
may have annotations (type, method or field level annotations) specified
in the value of the HandlesTypes or if it extends/implements one those
classes anywhere in the class' super types."

Does class here imply a concrete class? Or can be be anything -
interface, annotation - which has a corresponding Java class?

Thanks

Richard

-- 
Oracle <http://www.oracle.com>
Richard Evans | Product Architect
Phone: +44 1223 228408 <tel:+44%201223%20228408> | Mobile: +44 7973 
839664 <tel:+44%207973%20839664>
Oracle Product Development
Newton House Cambridge Business Park | Cambridge | CB4 0WZ | United Kingdom
ORACLE Corporation UK Ltd is a company incorporated in England & Wales | 
Company Reg. No. 1782505 | Reg. office: Oracle Parkway, Thames Valley 
Park, Reading RG6 1RA
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to 
developing practices and products that help protect the environment