|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.util.Factory
This class implements the "AbstractFactory" pattern, a software technique that decouples client code from the factory creational process. This is achieved by having a dedicated object perform this activity instead.
An AbstractFactory is simply a factory specialized in creating other factories, further decoupling client code from the knowledge of which factory object they are using to create new objects.
To create an AbstractFactory, you must instantiate this class.
Call the findFactory method, passing it the path to
the file which contains the factory configuration.
Factory objects that are dereferenced will be garbage collected.
Every AbstractFactory class depends on the types it is specialized to create.
| Constructor Summary | |
Factory()
Default constructor specifying no parameters. |
|
| Method Summary | |
java.lang.String |
findFactory(java.lang.String serviceFile,
java.lang.String defaultFactory)
This function searches for a factory class name at different locations in the following order: in the system properties where the property should look like follows: com.tensegrity.generic.attribute.AttributeFactory= PathToTheServiceFile in the attributes.properties file the attribute.properties must be located in the lib folder of the java.home directory. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Factory()
| Method Detail |
public java.lang.String findFactory(java.lang.String serviceFile,
java.lang.String defaultFactory)
- in the system properties where the property should look like follows:
com.tensegrity.generic.attribute.AttributeFactory= PathToTheServiceFile- in the attributes.properties file the attribute.properties must be located in the lib folder of the java.home directory. within the attribute.properties file must be an entry for the service file like follows:
com.tensegrity.generic.attribute.AttributeFactory= PathToTheServiceFile- in folder META-INF/services in file com.tensegrity.generic.attribute.AttributeFactory
serviceFile - the name of the service filedefaultFactory - the name of the default factory
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||