public class SynchronizingModuleRegistry extends java.lang.Object implements WritableModuleRegistry
This is useful as reading
Boot uber-jars requires local java.io.File
access, but modules may reside in a remote registry (e.g.
backed by HDFS). For such a case, simply use this registry as the main registry, configuring it with the hdfs://
registry as
its source and the file://
one as its target.
Constructor and Description |
---|
SynchronizingModuleRegistry(WritableModuleRegistry remoteRegistry,
WritableModuleRegistry localRegistry) |
Modifier and Type | Method and Description |
---|---|
boolean |
delete(ModuleDefinition definition)
Attempt to delete the given definition, if that registry is responsible for it.
|
ModuleDefinition |
findDefinition(java.lang.String name,
ModuleType moduleType)
Lookup a module of the given type with the given name.
|
java.util.List<ModuleDefinition> |
findDefinitions()
Returns all module definitions.
|
java.util.List<ModuleDefinition> |
findDefinitions(ModuleType type)
Searches the registry for the type specified and returns all module definitions that match the type.
|
java.util.List<ModuleDefinition> |
findDefinitions(java.lang.String name)
Searches the registry for the name specified and returns all module definitions that match the name regardless of
module type.
|
boolean |
registerNew(ModuleDefinition definition)
Attempt to register the given definition, if that registry can handle it.
|
public SynchronizingModuleRegistry(WritableModuleRegistry remoteRegistry, WritableModuleRegistry localRegistry)
public ModuleDefinition findDefinition(java.lang.String name, ModuleType moduleType)
ModuleRegistry
findDefinition
in interface ModuleRegistry
null
if this registry does not have such a modulepublic java.util.List<ModuleDefinition> findDefinitions(java.lang.String name)
ModuleRegistry
findDefinitions
in interface ModuleRegistry
name
- The module definition name to be searched.public java.util.List<ModuleDefinition> findDefinitions(ModuleType type)
ModuleRegistry
findDefinitions
in interface ModuleRegistry
type
- The module type name to be searched.public java.util.List<ModuleDefinition> findDefinitions()
ModuleRegistry
findDefinitions
in interface ModuleRegistry
public boolean delete(ModuleDefinition definition)
WritableModuleRegistry
delete
in interface WritableModuleRegistry
public boolean registerNew(ModuleDefinition definition)
WritableModuleRegistry
registerNew
in interface WritableModuleRegistry