Interface ComponentFactory<T>
-
- Type Parameters:
T
- the component-type.
- All Known Implementing Classes:
BasicComponentFactory
,ComplexWordCountTopologyModule
,ComponentFactory.SimpleFactory
,ComponentModule
public interface ComponentFactory<T>
TheComponentFactory
interface is used for creating new component instance.- See Also:
ComponentRegistry
,ComponentDescriptor
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ComponentFactory.SimpleFactory<T>
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Class<T>
getType()
Returns the type of the component created by thisComponentFactory
.default boolean
isSingleton()
Returns the if the instance created from thisComponentFactory
must be shared across the application.T
make()
Creates a new instance for the specified type.static <T> ComponentFactory<T>
prototypeOf(T instance)
static <T> ComponentFactory<T>
singletonOf(T instance)
-
-
-
Method Detail
-
singletonOf
static <T> ComponentFactory<T> singletonOf(T instance)
-
prototypeOf
static <T> ComponentFactory<T> prototypeOf(T instance)
-
make
T make()
Creates a new instance for the specified type.- Returns:
- the new instance of type
ComponentFactory
.
-
getType
Class<T> getType()
Returns the type of the component created by thisComponentFactory
.- Returns:
- a
Class
instance.
-
isSingleton
default boolean isSingleton()
Returns the if the instance created from thisComponentFactory
must be shared across the application.- Returns:
true
if the instance is shared,false
otherwise.
-
-