public ConfiguredInstantiator()

in chill-java/src/main/java/com/twitter/chill/config/ConfiguredInstantiator.java [49:75]


  public ConfiguredInstantiator(Config conf) throws ConfigurationException {
    String key = conf.get(KEY);
    if (null == key) {
      delegate = new KryoInstantiator();
    }
    else {
      String[] parts = fastSplitKey(key);
      if(parts == null) {
        throw new ConfigurationException("Invalid Config Key: " + conf.get(KEY));
      }
      KryoInstantiator reflected = null;
      try { reflected = reflect((Class<? extends KryoInstantiator>)Class.forName(parts[0], true, Thread.currentThread().getContextClassLoader()), conf); }
      catch(ClassNotFoundException x) {
        throw new ConfigurationException("Could not find class for: " + parts[0], x);
      }

      if(parts.length == 2) {
        delegate = fastDeserialize(reflected.newKryo(), parts[1]);
        if(null == delegate) {
          throw new ConfigurationException("Null delegate from: " + parts[1]);
        }
      }
      else {
        delegate = reflected;
      }
    }
  }