private void addHandler(String classname, String configFilename) throws ProbeHandlerConfigException {

    ClassLoader cl = ClassLoader.getSystemClassLoader();
    Class<?> handlerClass;
    try {
      handlerClass = cl.loadClass(classname);
    } catch (ClassNotFoundException e1) {
      throw new ProbeHandlerConfigException("Error loading the handler class", e1);
    }
    ProbeHandlerPlugin handler;

    try {
      handler = (ProbeHandlerPlugin) handlerClass.newInstance();
    } catch (InstantiationException | IllegalAccessException e) {
      LOGGER.warn("Could not create an instance of the configured handler class - " + classname);
      throw new ProbeHandlerConfigException("Error instantiating the handler class " + classname, e);
    }

    handler.initializeWithPropertiesFilename(configFilename);
    LOGGER.info("Loaded Probe Handler [" + handler.pluginName() + "] classname [" + classname + "] configFile [" + configFilename + "]");

    _handlers.add(handler);
  }
private void addHandler ( String classname , String configFilename ) throws ProbeHandlerConfigException { ClassLoader cl = ClassLoader . getSystemClassLoader ( ) ; Class < ? > handlerClass ; try { handlerClass = cl . loadClass ( classname ) ; } catch ( ClassNotFoundException e1 ) { throw new ProbeHandlerConfigException ( "Error loading the handler class" , e1 ) ; } ProbeHandlerPlugin handler ; try { handler = ( ProbeHandlerPlugin ) handlerClass . newInstance ( ) ; } catch ( InstantiationException | IllegalAccessException e ) { LOGGER . warn ( "Could not create an instance of the configured handler class - " + classname ) ; throw new ProbeHandlerConfigException ( "Error instantiating the handler class " + classname , e ) ; } handler . initializeWithPropertiesFilename ( configFilename ) ; LOGGER . info ( "Loaded Probe Handler [" + handler . pluginName ( ) + "] classname [" + classname + "] configFile [" + configFilename + "]" ) ; _handlers . add ( handler ) ; }
Add a new handler given the classname and config filename. It instantiates
the class and then calls its initialization method to get the handler ready
to process inbound probes.

@param classname is the FQCN of the handler class
@param configFilename is the full path name of the config file name
specific for the handler (could be any crazy format)
@throws ResponderConfigException if there is some issues with the config
file