Dashboard Builder Commons 6.0.0.Final

org.jboss.dashboard.factory
Class Factory

java.lang.Object
  extended by 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


Field Summary
static String FACTORY_COMMENT_CHAR
           
static String FACTORY_EXTENSION
           
static String FACTORY_FILENAME
           
protected  List<String> modules
           
protected  ComponentsTree tree
           
 
Constructor Summary
protected Factory()
           
protected Factory(File configDir)
           
protected Factory(ZipInputStream zis)
           
 
Method Summary
protected  void addDescriptorFiles(List descriptorFiles)
           
protected  boolean checkModuleName(String moduleName)
           
 void destroy()
           
protected  String doGetAlias(String path, String relativeToPath)
           
protected  Object doLookup(String path, String relativeToPath)
           
static void doWork(FactoryWork work)
           
static void doWork(FactoryWork work, boolean profileWork)
           
static String getAlias(String path)
           
static Object getAlias(String path, String relativeToPath)
           
static Factory getFactory(File configDir)
          Gets a factory for the specified configuration dir.
static Factory getFactory(ZipInputStream zis)
          Get a factory from the specified input stream, equivalent to the typical directory structure.
 List<String> getModules()
           
 ComponentsTree getTree()
           
protected  void init(File factoryDir)
           
protected  void init(ZipInputStream zis)
           
protected  List<DescriptorFile> initModuleFromDir(File moduleDir)
           
protected  List<DescriptorFile> initModuleFromJar(String moduleName)
           
protected  List<DescriptorFile> initModuleFromZip(File moduleZip)
           
static Object lookup(String path)
           
static Object lookup(String path, String relativeToPath)
           
protected  void runWork(FactoryWork work, boolean profile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

Factory

protected Factory(File configDir)
           throws IOException
Throws:
IOException

Factory

protected Factory(ZipInputStream zis)
           throws IOException
Throws:
IOException

Factory

protected Factory()
Method Detail

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)

Dashboard Builder Commons 6.0.0.Final

Copyright © 2012-2013 JBoss by Red Hat. All Rights Reserved.