public final class InstallManager extends Object
The GNU Lesser General Public License for details.
Modifier and Type | Field and Description |
---|---|
private Map<String,Class<InstallerFactory>> |
factories
The map of installer factories
|
private Map<String,Installer> |
installers
The list of discovered installers
|
private List<InstallerListener> |
listeners
The list of listeners
|
private static org.slf4j.Logger |
log
The log stream
|
private static String |
PREFIX
The prefix for the keys in the installer property file.
|
Constructor and Description |
---|
InstallManager()
Simple ctor
|
Modifier and Type | Method and Description |
---|---|
void |
addInstaller(String name,
Installer installer)
Add an installer to our list of installers
|
void |
addInstallerListener(InstallerListener li)
Remove a BibleListener from our list of listeners
|
protected void |
fireInstallersChanged(Object source,
Installer installer,
boolean added)
Kick of an event sequence
|
String |
getFactoryNameForInstaller(Installer installer)
Find the registered name of the InstallerFactory that created the given
installer.
|
Installer |
getInstaller(String name)
Find an installer by name
|
InstallerFactory |
getInstallerFactory(String name)
Find the InstallerFactory associated with the given name.
|
Set<String> |
getInstallerFactoryNames()
The names of all the known InstallerFactories
|
String |
getInstallerNameForInstaller(Installer installer)
Find the registered name of the Installer.
|
Map<String,Installer> |
getInstallers()
Accessor for the known installers
|
private void |
internalAdd(String name,
Installer installer)
InstallManager is a Map, however we demand that both names and installers
are unique (so we can lookup a name from an installer)
|
void |
removeBooksListener(InstallerListener li)
Add a BibleListener to our list of listeners
|
void |
removeInstaller(String name)
Remove an installer from our list
|
void |
save()
Save all properties to the user's local area.
|
private static final String PREFIX
private Map<String,Class<InstallerFactory>> factories
private List<InstallerListener> listeners
private static final org.slf4j.Logger log
public void save()
public Set<String> getInstallerFactoryNames()
public String getFactoryNameForInstaller(Installer installer)
installer
- the installerpublic String getInstallerNameForInstaller(Installer installer)
installer
- the installerpublic InstallerFactory getInstallerFactory(String name)
name
- The InstallerFactory name to look-uppublic Map<String,Installer> getInstallers()
public Installer getInstaller(String name)
name
- The name of the installer to findpublic void addInstaller(String name, Installer installer)
name
- The name by which we reference the installerinstaller
- The installer to addprivate void internalAdd(String name, Installer installer)
name
- The name of the new installerinstaller
- The installer to associate with the given namepublic void removeInstaller(String name)
name
- The name by which this installer is referencedpublic void addInstallerListener(InstallerListener li)
li
- The old listenerpublic void removeBooksListener(InstallerListener li)
li
- The new listener