String className) {
try {
Class< ? extends AccumulateFunction> clazz = (Class< ? extends AccumulateFunction>) getClassLoader().loadClass(className);
return clazz.newInstance();
} catch ( ClassNotFoundException e ) {
throw new RuntimeDroolsException( "Error loading accumulate function for identifier " + identifier + ". Class " + className + " not found",
e );
} catch ( InstantiationException e ) {
throw new RuntimeDroolsException( "Error loading accumulate function for identifier " + identifier + ". Instantiation failed for class " + className,
e );
} catch ( IllegalAccessException e ) {
throw new RuntimeDroolsException( "Error loading accumulate function for identifier " + identifier + ". Illegal access to class " + className,
e );
}
}