@ SuppressWarnings ( "unchecked" ) public static JobManagerProfiler loadJobManagerProfiler ( String profilerClassName , InetAddress jobManagerBindAddress ) { final Class < ? extends JobManagerProfiler > profilerClass ; try { profilerClass = ( Class < ? extends JobManagerProfiler > ) Class . forName ( profilerClassName ) ; } catch ( ClassNotFoundException e ) { LOG . error ( "Cannot find class " + profilerClassName + ": " + StringUtils . stringifyException ( e ) ) ; return null ; } JobManagerProfiler profiler = null ; try { final Constructor < JobManagerProfiler > constr = ( Constructor < JobManagerProfiler > ) profilerClass . getConstructor ( InetAddress . class ) ; profiler = constr . newInstance ( jobManagerBindAddress ) ; } catch ( InvocationTargetException e ) { LOG . error ( "Cannot create profiler: " + StringUtils . stringifyException ( e ) ) ; return null ; } catch ( NoSuchMethodException e ) { LOG . error ( "Cannot create profiler: " + StringUtils . stringifyException ( e ) ) ; return null ; } catch ( InstantiationException e ) { LOG . error ( "Cannot create profiler: " + StringUtils . stringifyException ( e ) ) ; return null ; } catch ( IllegalAccessException e ) { LOG . error ( "Cannot create profiler: " + StringUtils . stringifyException ( e ) ) ; return null ; } catch ( IllegalArgumentException e ) { LOG . error ( "Cannot create profiler: " + StringUtils . stringifyException ( e ) ) ; return null ; } return profiler ; }
Creates an instance of the job manager s profiling component .