Package com.zfabrik.components.provider
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 byIComponentDescriptor.COMPONENT_CLZ
in the component factory's properties can either implement this interface or be an extension ofResource
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
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
IMPLEMENTED_TYPE
static java.lang.String
TYPE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Resource
createComponentResource(java.lang.String name)
-
-
-
Field Detail
-
TYPE
static final java.lang.String TYPE
- See Also:
- Constant Field Values
-
IMPLEMENTED_TYPE
static final java.lang.String IMPLEMENTED_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
createComponentResource
Resource createComponentResource(java.lang.String name)
-
-