openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars-Fredrik Smedberg <>
Subject Question on verifying java classes in a CDI extension
Date Sat, 12 Jul 2014 18:51:40 GMT

I have the following scenario:

1. A CDI extensions verifies all AnnotatedTypes (in @Observes
ProcessAnnotatedType) that is annotated with a specific annotation
2. The class (from annotatedType.getJavaClass()) is verified according to
some application specific rules...
3. If the class has been successfully verified its placed in a
Set<Class<?>> that is a member variable of the CDI extension
4. The extension is injected into another bean and when the application is
running I would like to check if a specific object has a type that is
amongst the correctly verified types in the Set

The above works fine if the object to check is an object created by new or
if its an injected dependent object. However if the object is a normal
scoped object the class of the object will
not match any of the classes in the Set because it will be the proxy class
and not the proxied class (which is the one verified and put in the Set in
the CDI extension).

Is there any other way of doing the above or can I somehow get the proxied
class so I can check if its in the Set?


Med vänlig hälsning / Best regards

Lars-Fredrik Smedberg

The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at, and destroy all copies of this
message and any attachments.

View raw message