@ SuppressWarnings ( "rawtypes" ) public static void inject ( final IPluginInterface plugin , final IJNRPEExecutionContext context ) { try { Class clazz = plugin . getClass ( ) ; inject ( clazz , plugin , context ) ; while ( IPluginInterface . class . isAssignableFrom ( clazz . getSuperclass ( ) ) ) { clazz = clazz . getSuperclass ( ) ; inject ( clazz , plugin , context ) ; } } catch ( Exception e ) { throw new Error ( e . getMessage ( ) , e ) ; } }
Inject JNRPE code inside the passed in plugin . The annotation is searched in the whole hierarchy .