Package gda.factory

Interface Factory

All Superinterfaces:
Configurable
All Known Implementing Classes:
FactoryBase, RmiProxyFactory, SpringApplicationContextBasedObjectFactory

public interface Factory extends Configurable
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 Details

    • addFindable

      void addFindable(Findable findable)
      Used to add the Findables to this factory
      Parameters:
      findable - the object to add.
    • getFindables

      List<Findable> getFindables()
      Returns the findable objects held in this factory.
      Returns:
      the list of objects.
    • getFindableNames

      List<String> getFindableNames()
      Returns a list of the names of all findable objects held in this factory.
      Returns:
      a list of findable names
    • getFindable

      <T extends Findable> T getFindable(String name) throws FactoryException
      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 the Findable interface.
      Returns:
      the named object or null if this factory can't provide it.
      Throws:
      FactoryException
    • getFindablesOfType

      <T extends Findable> Map<String,T> getFindablesOfType(Class<T> clazz)
      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