org.jboss.dashboard.factory
Class Factory
java.lang.Object
org.jboss.dashboard.factory.Factory
public final class Factory
- extends Object
Main class for the initialization and lookup of components within the platform.
TODO: Replace by CDI
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FACTORY_FILENAME
public static final String FACTORY_FILENAME
- See Also:
- Constant Field Values
FACTORY_EXTENSION
public static final String FACTORY_EXTENSION
- See Also:
- Constant Field Values
FACTORY_COMMENT_CHAR
public static final String FACTORY_COMMENT_CHAR
- See Also:
- Constant Field Values
tree
protected ComponentsTree tree
modules
protected List<String> modules
Factory
protected Factory(File configDir)
throws IOException
- Throws:
IOException
Factory
protected Factory(ZipInputStream zis)
throws IOException
- Throws:
IOException
Factory
protected Factory()
getFactory
public static Factory getFactory(File configDir)
- Gets a factory for the specified configuration dir. This directory must contain a file
named FACTORY_FILENAME, with a list of relative directory names where configuration trees
are present.
- Parameters:
configDir - starting directory
- Returns:
- a Factory for this directory, or an empty factory if the directory is invalid.
getFactory
public static Factory getFactory(ZipInputStream zis)
- Get a factory from the specified input stream, equivalent to the typical directory structure.
- Parameters:
zis - Input stream to the zipped Factory config files
- Returns:
- a Factory for this zip file, or an empty factory if the zip is invalid.
init
protected void init(ZipInputStream zis)
throws IOException
- Throws:
IOException
init
protected void init(File factoryDir)
throws IOException
- Throws:
IOException
initModuleFromDir
protected List<DescriptorFile> initModuleFromDir(File moduleDir)
throws IOException
- Throws:
IOException
initModuleFromZip
protected List<DescriptorFile> initModuleFromZip(File moduleZip)
throws IOException
- Throws:
IOException
initModuleFromJar
protected List<DescriptorFile> initModuleFromJar(String moduleName)
throws IOException
- Throws:
IOException
addDescriptorFiles
protected void addDescriptorFiles(List descriptorFiles)
destroy
public void destroy()
getModules
public List<String> getModules()
getTree
public ComponentsTree getTree()
doLookup
protected Object doLookup(String path,
String relativeToPath)
doGetAlias
protected String doGetAlias(String path,
String relativeToPath)
runWork
protected void runWork(FactoryWork work,
boolean profile)
lookup
public static Object lookup(String path)
lookup
public static Object lookup(String path,
String relativeToPath)
getAlias
public static String getAlias(String path)
getAlias
public static Object getAlias(String path,
String relativeToPath)
doWork
public static void doWork(FactoryWork work)
doWork
public static void doWork(FactoryWork work,
boolean profileWork)
checkModuleName
protected boolean checkModuleName(String moduleName)
Copyright © 2012-2013 JBoss by Red Hat. All Rights Reserved.