public interface SubjectRegistry
Subject
instances.
Note that a registry conceptually only provides reading access, not modifying access to its contents. For
modifying operations, see SubjectManager
.Modifier and Type | Interface and Description |
---|---|
static class |
SubjectRegistry.Implementation
A simple
SubjectRegistry default implementation that synchronizes on a provided lock instance for
accessing the internal registry in order to avoid concurrency issues while the internal datastructure is
rebuilt. |
Modifier and Type | Method and Description |
---|---|
Object |
lockSubjectRegistry()
Returns the lock instance that is internally used by this registry instance.
|
static SubjectRegistry |
New(Collection<? extends Subject> subjects)
Creates a new
SubjectRegistry instance using the passed Subject instance to derive its
internal datastructure from and a newly instantiated object to be used as the synchronization lock. |
static SubjectRegistry |
New(Collection<? extends Subject> subjects,
Object registryLock)
Creates a new
SubjectRegistry instance using the passed Subject instances to derive its
internal datastructure from and the passed registryLock instance as the synchronization lock for
accessing the registry. |
static SubjectRegistry |
New(Map<String,Subject> registry)
Creates a new
SubjectRegistry instance using the passed map instance and a newly instantiated object
to be used a synchronization lock. |
static SubjectRegistry |
New(Map<String,Subject> registry,
Object registryLock)
Creates a new
SubjectRegistry instance using the passed map instance as its internal datastructure
and the passed registryLock instance as the synchronization lock for accessing the registry. |
Subject |
subject(String subjectName)
Returns the
Subject instance identified by the passed subject name. |
Map<String,Subject> |
subjects()
Returns a read-only map of all known
Subject instances (values), identified by their names (keys). |
Subject subject(String subjectName)
Subject
instance identified by the passed subject name.Map<String,Subject> subjects()
Subject
instances (values), identified by their names (keys).Object lockSubjectRegistry()
static SubjectRegistry New(Map<String,Subject> registry, Object registryLock)
SubjectRegistry
instance using the passed map instance as its internal datastructure
and the passed registryLock instance as the synchronization lock for accessing the registry.registry
- the map instance to be used as the internal datastructure.registryLock
- the locking instance to be used to synchronize on for accessing the registry.SubjectRegistry
instance using the passed instances.static SubjectRegistry New(Map<String,Subject> registry)
SubjectRegistry
instance using the passed map instance and a newly instantiated object
to be used a synchronization lock.registry
- the map instance to be used as the internal datastructure.SubjectRegistry
instance using the passed instance.static SubjectRegistry New(Collection<? extends Subject> subjects, Object registryLock)
SubjectRegistry
instance using the passed Subject
instances to derive its
internal datastructure from and the passed registryLock instance as the synchronization lock for
accessing the registry.subjects
- the Subject
instances to derive the internal datastructure from.registryLock
- the locking instance to be used to synchronize on for accessing the registry.SubjectRegistry
instance using the passed instances.static SubjectRegistry New(Collection<? extends Subject> subjects)
SubjectRegistry
instance using the passed Subject
instance to derive its
internal datastructure from and a newly instantiated object to be used as the synchronization lock.subjects
- the Subject
instance to be used as the internal datastructure.SubjectRegistry
instance using the passed instance.