Class BasicComponentFactory<T>
- java.lang.Object
-
- io.streamthoughts.azkarra.runtime.components.BasicComponentFactory<T>
-
- All Implemented Interfaces:
ComponentFactory<T>
public class BasicComponentFactory<T> extends Object implements ComponentFactory<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.streamthoughts.azkarra.api.components.ComponentFactory
ComponentFactory.SimpleFactory<T>
-
-
Constructor Summary
Constructors Constructor Description BasicComponentFactory(Class<T> type)
Creates a newBasicComponentFactory
instance.BasicComponentFactory(Class<T> type, boolean isSingleton)
Creates a newBasicComponentFactory
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<T>
getType()
Returns the type of the component created by thisComponentFactory
.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.
-
-
-
Constructor Detail
-
BasicComponentFactory
public BasicComponentFactory(Class<T> type)
Creates a newBasicComponentFactory
instance.- Parameters:
type
- the component type.
-
BasicComponentFactory
public BasicComponentFactory(Class<T> type, boolean isSingleton)
Creates a newBasicComponentFactory
instance.- Parameters:
type
- the component type.type
- is this component a singleton.
-
-
Method Detail
-
make
public T make()
Creates a new instance for the specified type.- Specified by:
make
in interfaceComponentFactory<T>
- Returns:
- the new instance of type
ComponentFactory
.
-
getType
public Class<T> getType()
Returns the type of the component created by thisComponentFactory
.- Specified by:
getType
in interfaceComponentFactory<T>
- Returns:
- a
Class
instance.
-
isSingleton
public boolean isSingleton()
Returns the if the instance created from thisComponentFactory
must be shared across the application.- Specified by:
isSingleton
in interfaceComponentFactory<T>
- Returns:
true
if the instance is shared,false
otherwise.
-
-