Package kieker.common.util.classpath
Class InstantiationFactory
java.lang.Object
kieker.common.util.classpath.InstantiationFactory
This class encapsulates the creation of Kieker monitoring controllers.
- Since:
- 1.15
- Author:
- Holger Knoche, Reiner Jung
-
Method Summary
Modifier and TypeMethodDescription<C> CThis is a helper method .<C> CcreateAndInitialize(Class<C> c, String className, Configuration configuration) This is a helper method trying to find, create and initialize the given class, using its public constructor which accepts a singleConfiguration.static <C> CcreateWithConfiguration(Class<C> implementedInterface, String className, Configuration configuration) This is a helper method trying to find, create and initialize the given class, using its public constructor which accepts a singleConfiguration.static InstantiationFactorygetInstance(Configuration configuration) Get an instance of the controller factory for the given configuration.
-
Method Details
-
getInstance
Get an instance of the controller factory for the given configuration.- Parameters:
configuration- The configuration to use- Returns:
- A controller factory instance
-
createAndInitialize
This is a helper method trying to find, create and initialize the given class, using its public constructor which accepts a singleConfiguration.- Type Parameters:
C- The type of the returned class.- Parameters:
c- This class defines the expected result of the method call.className- The name of the class to be created.configuration- The configuration which will be used to initialize the class in question.- Returns:
- A new and initializes class instance if everything went well.
-
createWithConfiguration
public static <C> C createWithConfiguration(Class<C> implementedInterface, String className, Configuration configuration) throws ConfigurationException This is a helper method trying to find, create and initialize the given class, using its public constructor which accepts a singleConfiguration.- Type Parameters:
C- The type of the returned class.- Parameters:
implementedInterface- This class defines the expected result of the method call.className- The name of the class to be created.configuration- The configuration which will be used to initialize the class in question.- Returns:
- A new and initializes class instance if everything went well.
- Throws:
ConfigurationException- on configuration errors during instantiation
-
create
This is a helper method .- Type Parameters:
C- The type of the returned class.- Parameters:
c- This class defines the expected result of the method call.className- The name of the class to be created.parameterTypes- types of the parametersparameters- parameter for the constructor- Returns:
- A new and initializes class instance if everything went well.
-