}
if (init_rpcs && config.hasProperty("tsd.rpc.plugins")) {
final String[] plugins = config.getString("tsd.rpc.plugins").split(",");
for (final String plugin : plugins) {
final RpcPlugin rpc = PluginLoader.loadSpecificPlugin(plugin.trim(),
RpcPlugin.class);
if (rpc == null) {
throw new IllegalArgumentException(
"Unable to locate RPC plugin: " + plugin.trim());
}
try {
rpc.initialize(this);
} catch (Exception e) {
throw new RuntimeException(
"Failed to initialize RPC plugin", e);
}
if (rpc_plugins == null) {
rpc_plugins = new ArrayList<RpcPlugin>(1);
}
rpc_plugins.add(rpc);
LOG.info("Successfully initialized RPC plugin [" +
rpc.getClass().getCanonicalName() + "] version: "
+ rpc.version());
}
}
}