Package org.opensaml.core.xml.util
Class AbstractSingletonFactory<Input,Output>
java.lang.Object
org.opensaml.core.xml.util.AbstractSingletonFactory<Input,Output>
- Type Parameters:
Input
- the factory input class typeOutput
- the factory output class type
- All Implemented Interfaces:
SingletonFactory<Input,
Output>
- Direct Known Subclasses:
AbstractSimpleSingletonFactory
,AbstractWrappedSingletonFactory
public abstract class AbstractSingletonFactory<Input,Output>
extends Object
implements SingletonFactory<Input,Output>
An abstract Template design pattern implementation of
SingletonFactory
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Output
createNewInstance
(Input input) Create a new instance of the output class based on the input class instance.protected abstract Output
Get the output instance currently associated with the input instance.getInstance
(Input input) Obtain an instance of the output class based on an input class instance.protected abstract void
Store the input and output instance association.
-
Field Details
-
log
private final org.slf4j.Logger logClass logger.
-
-
Constructor Details
-
AbstractSingletonFactory
public AbstractSingletonFactory()
-
-
Method Details
-
getInstance
Obtain an instance of the output class based on an input class instance.- Specified by:
getInstance
in interfaceSingletonFactory<Input,
Output> - Parameters:
input
- the input class instance- Returns:
- an output class instance
-
get
Get the output instance currently associated with the input instance.- Parameters:
input
- the input instance key- Returns:
- the output instance which corresponds to the input instance, or null if not present
-
put
Store the input and output instance association.- Parameters:
input
- the input instance keyoutput
- the output instance value
-
createNewInstance
Create a new instance of the output class based on the input class instance.- Parameters:
input
- the input class instance- Returns:
- an output class instance
-