openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: Question on verifying java classes in a CDI extension
Date Sat, 12 Jul 2014 21:05:31 GMT
Hi

Common way to work with it in openwebbeans/openejb is to do: if class name
has $$ then use superclass
Le 12 juil. 2014 19:52, "Lars-Fredrik Smedberg" <itsmeden@gmail.com> a
écrit :

> Hi!
>
> 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?
>
> Regards
> Lars-Fredrik
>
> --
> Med vänlig hälsning / Best regards
>
> Lars-Fredrik Smedberg
>
> STATEMENT OF CONFIDENTIALITY:
> 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 itsmeden@gmail.com, and destroy all copies of this
> message and any attachments.
>

Mime
View raw message