public static final String KEY = "com.twitter.chill.config.configuredinstantiator";
public ConfiguredInstantiator(Config conf) throws ConfigurationException {
String key = conf.get(KEY);
if (null == key) {
delegate = new KryoInstantiator();
}
else {
String[] parts = key.split(":");
if(parts.length != 1 && parts.length != 2) {
throw new ConfigurationException("Invalid Config Key: " + conf.get(KEY));
}
KryoInstantiator reflected = null;
try { reflected = reflect((Class<? extends KryoInstantiator>)Class.forName(parts[0]), conf); }
catch(ClassNotFoundException x) {
throw new ConfigurationException("Could not find class for: " + parts[0], x);
}
if(parts.length == 2) {
delegate = deserialize(reflected.newKryo(), parts[1]);
if(null == delegate) {
throw new ConfigurationException("Null delegate from: " + parts[1]);
}
}
else {