public class BaseCombiningAlgFactory extends CombiningAlgFactory
CombiningAlgFactory
. It
implements the insertion and retrieval methods, but doesn't actually
setup the factory with any algorithms.
Note that while this class is thread-safe on all creation methods, it is not safe to add support for a new algorithm while creating an instance of an algorithm. This follows from the assumption that most people will initialize these factories up-front, and then start processing without ever modifying the factories. If you need these mutual operations to be thread-safe, then you should write a wrapper class that implements the right synchronization.
Constructor and Description |
---|
BaseCombiningAlgFactory()
Default constructor.
|
BaseCombiningAlgFactory(Set algorithms)
Constructor that configures this factory with an initial set of
supported algorithms.
|
Modifier and Type | Method and Description |
---|---|
void |
addAlgorithm(CombiningAlgorithm alg)
Adds a combining algorithm to the factory.
|
CombiningAlgorithm |
createAlgorithm(URI algId)
Tries to return the correct combinging algorithm based on the
given algorithm ID.
|
Set |
getSupportedAlgorithms()
Returns the algorithm identifiers supported by this factory.
|
addCombiningAlg, createCombiningAlg, getInstance, getInstance, registerFactory, setDefaultFactory
public BaseCombiningAlgFactory()
public BaseCombiningAlgFactory(Set algorithms)
algorithms
- a Set
of
CombiningAlgorithmsIllegalArgumentException
- if any elements of the set are not
CombiningAlgorithmspublic void addAlgorithm(CombiningAlgorithm alg)
addAlgorithm
in class CombiningAlgFactory
alg
- the combining algorithm to addIllegalArgumentException
- if the algId is already registeredpublic Set getSupportedAlgorithms()
getSupportedAlgorithms
in class CombiningAlgFactory
Set
of String
spublic CombiningAlgorithm createAlgorithm(URI algId) throws UnknownIdentifierException
createAlgorithm
in class CombiningAlgFactory
algId
- the identifier by which the algorithm is knownUnknownIdentifierException
- algId is unknownCopyright © 2023 JBoss by Red Hat. All rights reserved.