@Service @Singleton public class NamedResourceManager extends Object
The NamedResource support mimics some of what's provided by the ConfigBean
implementation in hk2, primarily for security authorization support. Developers
annotate a POJO class with @NamedResource. If the class is a singleton (as
the top-level Domain interface is in the config structure) no further annos
are needed on the class. If the class can have multiple occurrences then
each instance will need a unique identifier and the developer annotates that
field on the class with @NamedResource.ID
.
When some code has fully populated an instance of such a @NamedResource
class it invokes the #prepare(java.lang.Object)
method, passing
the just-created object. The manager records the new instance and its
named resource children, primarily so
that authorization-related annotations such as @AccessRequired.To
can refer to such an object. The secure admin infrastructure can then
automatically determine the resource name for that instance for use in
authorization checks.
The named resource POJO class can have fields that point to other named resource classes or fields that are collections or arrays of named resource classes.
Constructor and Description |
---|
NamedResourceManager() |
public <T> T register(T instance) throws IllegalArgumentException, IllegalAccessException
Copyright © 2020. All rights reserved.