private ClientManager getClientManager(Class<? extends ConnectionFactory> connectionFactoryClass,
Class<? extends ClientManagerFactory> clientManagerFactoryClass)
throws ReflectiveOperationException {
if (clientManagerFactoryClass != null) {
ClientManagerFactory factory = clientManagerFactoryClass.getConstructor().newInstance();
return factory.newInstance(connectionFactoryClass);
} else {
return new DefaultClientManager(connectionFactoryClass);
}
}