[weld-dev] Principal built-in bean

Martin Kouba mkouba at redhat.com
Mon Sep 4 05:17:52 EDT 2017


Well, it works similar to how @Dependent stateless session beans work. 
Unlike @RequestScoped there is no real CDI context just a special proxy 
that delegates to SPI.

Martin

Dne 4.9.2017 v 11:09 Emily Jiang napsal(a):
> Does this mean it functions as a Request scoped bean even though it is a 
> Dependent bean?
> 
> Many thanks,
> Emily
> ===========================
> Emily Jiang
> WebSphere Application Server, CDI & MicroProfile Development Lead
> 
> MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
> Phone:  +44 (0)1962 816278  Internal: 246278
> 
> Email: emijiang at uk.ibm.com
> Lotus Notes: Emily Jiang/UK/IBM at IBMGB
> 
> 
> 
> 
> From: Martin Kouba <mkouba at redhat.com>
> To: Emily Jiang <emijiang6 at googlemail.com>, Weld-Dev List 
> <weld-dev at lists.jboss.org>
> Date: 04/09/2017 09:24
> Subject: Re: [weld-dev] Principal built-in bean
> Sent by: weld-dev-bounces at lists.jboss.org
> ------------------------------------------------------------------------
> 
> 
> 
> It's @Dependent. But a special proxy is injected and SPI
> org.jboss.weld.security.spi.SecurityServices.getPrincipal() is invoked
> to obtain the current caller identity for every invocation of an
> injected reference.
> 
> Martin
> 
> Dne 1.9.2017 v 16:57 Emily Jiang napsal(a):
>  > A Java EE or embeddable EJB container must provide the following
>  > built-in beans, all of which
>  > have qualifier @Default:
>  >
>  > a bean with bean type javax.security.Principal, allowing injection of a
>  > Principal
>  > representing the current caller identity.
>  >
>  > The spec does not say the scope of this bean. In Weld, what is the scope
>  > for the Principal bean?
>  >
>  > --
>  > Thanks
>  > Emily
>  > =================
>  > Emily Jiang
>  > ejiang at apache.org <mailto:ejiang at apache.org>
>  >
>  >
>  > _______________________________________________
>  > weld-dev mailing list
>  > weld-dev at lists.jboss.org
>  > 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.jboss.org_mailman_listinfo_weld-2Ddev&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=jt2y5_gH2oPaja8Vt6NzAZV-iEo6D2jiWeuVYs0H-1U&m=jIKn0UxNi92JGBmOv2ycs3JoHrlVZC6ARxh7qsqJzE8&s=7SXNuw9nF99r1RrRF97m4EBatYRmA9igLcjOExFx6ak&e=
>  >
> 
> -- 
> Martin Kouba
> Senior Software Engineer
> Red Hat, Czech Republic
> _______________________________________________
> weld-dev mailing list
> weld-dev at lists.jboss.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.jboss.org_mailman_listinfo_weld-2Ddev&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=jt2y5_gH2oPaja8Vt6NzAZV-iEo6D2jiWeuVYs0H-1U&m=jIKn0UxNi92JGBmOv2ycs3JoHrlVZC6ARxh7qsqJzE8&s=7SXNuw9nF99r1RrRF97m4EBatYRmA9igLcjOExFx6ak&e=
> 
> 
> 
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number 
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

-- 
Martin Kouba
Senior Software Engineer
Red Hat, Czech Republic


More information about the weld-dev mailing list