@ SuppressWarnings ( "unchecked" ) static InstanceManager loadInstanceManager ( final String instanceManagerClassName ) { Class < ? extends InstanceManager > instanceManagerClass ; try { instanceManagerClass = ( Class < ? extends InstanceManager > ) Class . forName ( instanceManagerClassName ) ; } catch ( ClassNotFoundException e ) { LOG . error ( "Cannot find class " + instanceManagerClassName + ": " + StringUtils . stringifyException ( e ) ) ; return null ; } InstanceManager instanceManager ; try { instanceManager = instanceManagerClass . newInstance ( ) ; } catch ( InstantiationException e ) { LOG . error ( "Cannot create instanceManager: " + StringUtils . stringifyException ( e ) ) ; return null ; } catch ( IllegalAccessException e ) { LOG . error ( "Cannot create instanceManager: " + StringUtils . stringifyException ( e ) ) ; return null ; } return instanceManager ; }
Tries to locate a class with given name and to instantiate a instance manager from it .