Class InstantiationFactory

java.lang.Object
kieker.common.util.classpath.InstantiationFactory

public final class InstantiationFactory extends Object
This class encapsulates the creation of Kieker monitoring controllers.
Since:
1.15
Author:
Holger Knoche, Reiner Jung
  • Method Details

    • getInstance

      public static InstantiationFactory getInstance(Configuration configuration)
      Get an instance of the controller factory for the given configuration.
      Parameters:
      configuration - The configuration to use
      Returns:
      A controller factory instance
    • createAndInitialize

      public <C> C createAndInitialize(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 single Configuration.
      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 single Configuration.
      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

      public <C> C create(Class<C> c, String className, Class<?>[] parameterTypes, Object... parameters)
      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 parameters
      parameters - parameter for the constructor
      Returns:
      A new and initializes class instance if everything went well.