Interface IComponentFactory


  • public interface IComponentFactory
    A component factory is reponsible for providing a managed resource (Resource) given a component name. It provides the link between a component type declaration and its semantics.

    The component factory for a component type is invoked when no resource for a component of the given name is currently managed by the resource management system. In that case the component factory is asked to provide an implementation of (Resource). Typically the component factory will inspect the component descriptor (IComponentDescriptor) of the named component.

    Component factory is also a component type. Declaration of a component factory typically looks like this:

     com.zfabrik.component.type=com.zfabrik.componentFactory
     componentFactory.type=<type that is implemented by the factory>
     component.className=<class that implements the component factory>
     
    Properties supported for component factories: The class specified by IComponentDescriptor.COMPONENT_CLZ in the component factory's properties can either implement this interface or be an extension of Resource that has a single string arg constructor. In the latter case, the implementation resource of the requested component will be an instance of this class constructed by invoking that constructore with the component's name.

    The class will be loaded by the private loader of the sibling Java component of the component factory component - as described in IComponentDescriptor.COMPONENT_CLZ.

    Author:
    hb
    See Also:
    IComponentDescriptor, Resource
    • Method Detail

      • createComponentResource

        Resource createComponentResource​(java.lang.String name)