public class DirectoryRegistry extends Object
BaseDirectoryDescriptor
registry holding registered descriptors and instantiated Directory
objects.
The directory descriptors have two special boolean flags that control how merge works:
remove="true"
: this removes the definition of the directory. The next definition (if any) will be done
from scratch.
template="true"
: this defines an abstract descriptor which cannot be directly instantiated as a
directory. However another descriptor can extend it through extends="templatename"
to inherit all its
properties.
Modifier and Type | Field and Description |
---|---|
protected Map<String,List<BaseDirectoryDescriptor>> |
allDescriptors
All descriptors registered.
|
protected Map<String,BaseDirectoryDescriptor> |
descriptors
Effective descriptors.
|
protected Map<String,Directory> |
directories
Effective instantiated directories.
|
Constructor and Description |
---|
DirectoryRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
addContribution(BaseDirectoryDescriptor contrib) |
protected void |
contributionChanged(BaseDirectoryDescriptor contrib) |
List<Directory> |
getDirectories()
Gets all the directories.
|
Directory |
getDirectory(String id)
Gets the directory with the given id.
|
BaseDirectoryDescriptor |
getDirectoryDescriptor(String id)
Gets the effective directory descriptor with the given id.
|
List<String> |
getDirectoryIds()
Gets all the directory ids.
|
protected BaseDirectoryDescriptor |
recomputeDescriptor(String id)
Recomputes the effective descriptor for a directory id.
|
void |
removeContribution(BaseDirectoryDescriptor contrib) |
protected void |
removeDirectory(String id) |
void |
shutdown()
Shuts down all directories and clears the registry.
|
protected static void |
shutdownDirectory(Directory dir)
Shuts down the given directory and catches any
DirectoryException . |
protected Map<String,List<BaseDirectoryDescriptor>> allDescriptors
protected Map<String,BaseDirectoryDescriptor> descriptors
protected Map<String,Directory> directories
public DirectoryRegistry()
public void addContribution(BaseDirectoryDescriptor contrib)
public void removeContribution(BaseDirectoryDescriptor contrib)
protected void contributionChanged(BaseDirectoryDescriptor contrib)
protected void removeDirectory(String id)
protected BaseDirectoryDescriptor recomputeDescriptor(String id)
public BaseDirectoryDescriptor getDirectoryDescriptor(String id)
id
- the directory idnull
if not foundpublic Directory getDirectory(String id)
id
- the directory idnull
if not foundpublic List<String> getDirectoryIds()
public List<Directory> getDirectories()
public void shutdown()
protected static void shutdownDirectory(Directory dir)
DirectoryException
.dir
- the directoryCopyright © 2017 Nuxeo. All rights reserved.