public static ResourceService getResourceService ( ) { if ( resourceService == null ) { try { Class clazz = Class . forName ( RESOURCE_SERVICE ) ; resourceService = ( ResourceService ) clazz . newInstance ( ) ; } catch ( ClassNotFoundException | InstantiationException | IllegalAccessException e ) { LOGGER . warn ( "Cannot instanciate util: {}" , e . getMessage ( ) ) ; throw new IllegalStateException ( e ) ; } } return resourceService ; }
Retrieve ResourceService implementation