protected static void init(){
  String notificationfactoryClassName=null;
  try {
    notificationfactoryClassName=System.getProperty(NOTIFICATION_FACTORY_NAME);
  }
 catch (  SecurityException e) {
    throw new RuntimeException(e);
  }
  if (notificationfactoryClassName != null) {
    Class<?> nfc;
    try {
      nfc=Class.forName(notificationfactoryClassName);
      factory=(INotificationManagerFactory)nfc.newInstance();
    }
 catch (    ClassNotFoundException|InstantiationException|IllegalAccessException e) {
      throw new RuntimeException(e);
    }
  }
 else {
    factory=new SyslogNotificationFactory();
  }
}

protected static void init ( ) { String notificationfactoryClassName = null ; try { notificationfactoryClassName = System . getProperty ( NOTIFICATION_FACTORY_NAME ) ; } catch ( SecurityException e ) { throw new RuntimeException ( e ) ; } if ( notificationfactoryClassName != null ) { Class < ? > nfc ; try { nfc = Class . forName ( notificationfactoryClassName ) ; factory = ( INotificationManagerFactory ) nfc . newInstance ( ) ; } catch ( ClassNotFoundException | InstantiationException | IllegalAccessException e ) { throw new RuntimeException ( e ) ; } } else { factory = new SyslogNotificationFactory ( ) ; } }
a simple mechanism to initialize factory with dynamic binding . extended to default to syslognotifcationfactory in the event a dynamic binding is not specified via system properties . this allows init ( ) to be called multiple times for the unit tests and select the default or a another factory if the system property is cleared or is set , respectively .
