users@javaee-security-spec.java.net

[javaee-security-spec users] [jsr375-experts] Re: Identity Store Proposal 2.0

From: arjan tijms <arjan.tijms_at_gmail.com>
Date: Mon, 22 Jun 2015 14:52:47 +0200

p.s.

On Mon, Jun 22, 2015 at 2:44 PM, arjan tijms <arjan.tijms_at_gmail.com> wrote:
> And look it up programmatically:
>
> UsernamePasswordStore store = cdi.select(UsernamePasswordStore.class);
>
> or
>
> IdentityStore store = cdi.select(UsernamePasswordStore.class);

With a small convenience method on the Credential type, you could also
get this without using class literals, e.g.

IdentityStore store = cdi.select(credential.handlingStore());

or if AnnotationLiterals were used instead:

IdentityStore store = cdi.select(IdentityStore.class,
credential.handlingStore());

Just brainstorming here, and the name "handlingStore()" can probably
be improved.