Package gda.factory
Interface Factory
- All Superinterfaces:
Configurable
- All Known Implementing Classes:
FactoryBase,RmiProxyFactory,SpringApplicationContextBasedObjectFactory
An interface class used to provide findable objects.
Factorys are used by the Finder to find objects they act as different object sources.
Adding beans directly to a Spring application context is now the
preferred method for instantiating objects. Encapsulating objects within a
Factory results in objects that cannot be referenced from the
application context. Instead of creating new factories, consider writing a
BeanDefinitionParser to create Spring BeanDefinitions.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddFindable(Findable findable) Used to add theFindables to this factory<T extends Findable>
TgetFindable(String name) Return a named object from the factory or null if this factory can't provide the object.Returns a list of the names of all findable objects held in this factory.Returns the findable objects held in this factory.getFindablesOfType(Class<T> clazz) Return all objects of the requested type from this factory.booleanisLocal()Indicates whether this factory contains objects that have been instantiated locally.Methods inherited from interface gda.factory.Configurable
configure, isConfigureAtStartup, isConfigured, reconfigure
-
Method Details
-
addFindable
Used to add theFindables to this factory- Parameters:
findable- the object to add.
-
getFindables
Returns the findable objects held in this factory.- Returns:
- the list of objects.
-
getFindableNames
Returns a list of the names of all findable objects held in this factory.- Returns:
- a list of findable names
-
getFindable
Return a named object from the factory or null if this factory can't provide the object.- Type Parameters:
T- The type of the object to find- Parameters:
name- the name of the object as defined by theFindableinterface.- Returns:
- the named object or
nullif this factory can't provide it. - Throws:
FactoryException
-
getFindablesOfType
Return all objects of the requested type from this factory.- Type Parameters:
T- The type of the object to find- Parameters:
clazz- the type of the objects to be found- Returns:
- a map of name to requested objects that can be provided from this factory or an empty map if none can be provided
-
isLocal
boolean isLocal()Indicates whether this factory contains objects that have been instantiated locally.- Returns:
- whether this factory contains local objects
-