@Test @AgentAttachmentRule.Enforce(retransformsClasses = true) public void testStrategyCreation() throws Exception { assertThat(ByteBuddyAgent.install(), instanceOf(Instrumentation.class)); assertThat(ClassReloadingStrategy.fromInstalledAgent(), notNullValue()); }
public static ClassReloadingStrategy fromInstalledAgent() { try { return ClassReloadingStrategy.of((Instrumentation) ClassLoader.getSystemClassLoader() .loadClass(INSTALLER_TYPE) .getMethod(INSTRUMENTATION_GETTER) .invoke(STATIC_MEMBER)); } catch (RuntimeException exception) { throw exception; } catch (Exception exception) { throw new IllegalStateException("The Byte Buddy agent is not installed or not accessible", exception); } }
ClassReloadingStrategy implements ClassLoadingStrategy<ClassLoader> { public static ClassReloadingStrategy fromInstalledAgent() { try { return ClassReloadingStrategy.of((Instrumentation) ClassLoader.getSystemClassLoader() .loadClass(INSTALLER_TYPE) .getMethod(INSTRUMENTATION_GETTER) .invoke(STATIC_MEMBER)); } catch (RuntimeException exception) { throw exception; } catch (Exception exception) { throw new IllegalStateException("The Byte Buddy agent is not installed or not accessible", exception); } } }
ClassReloadingStrategy implements ClassLoadingStrategy<ClassLoader> { public static ClassReloadingStrategy fromInstalledAgent() { try { return ClassReloadingStrategy.of((Instrumentation) ClassLoader.getSystemClassLoader() .loadClass(INSTALLER_TYPE) .getMethod(INSTRUMENTATION_GETTER) .invoke(STATIC_MEMBER)); } catch (RuntimeException exception) { throw exception; } catch (Exception exception) { throw new IllegalStateException("The Byte Buddy agent is not installed or not accessible", exception); } } ClassReloadingStrategy(Instrumentation instrumentation, Strategy strategy); protected  ClassReloadingStrategy(Instrumentation instrumentation,
                                     Strategy strategy,
                                     BootstrapInjection bootstrapInjection,
                                     Map<String, Class<?>> preregisteredTypes); }
ClassReloadingStrategy implements ClassLoadingStrategy<ClassLoader> { public static ClassReloadingStrategy fromInstalledAgent() { try { return ClassReloadingStrategy.of((Instrumentation) ClassLoader.getSystemClassLoader() .loadClass(INSTALLER_TYPE) .getMethod(INSTRUMENTATION_GETTER) .invoke(STATIC_MEMBER)); } catch (RuntimeException exception) { throw exception; } catch (Exception exception) { throw new IllegalStateException("The Byte Buddy agent is not installed or not accessible", exception); } } ClassReloadingStrategy(Instrumentation instrumentation, Strategy strategy); protected  ClassReloadingStrategy(Instrumentation instrumentation,
                                     Strategy strategy,
                                     BootstrapInjection bootstrapInjection,
                                     Map<String, Class<?>> preregisteredTypes); static ClassReloadingStrategy of(Instrumentation instrumentation); static ClassReloadingStrategy fromInstalledAgent(); static ClassReloadingStrategy fromInstalledAgent(Strategy strategy); Map<TypeDescription, Class<?>> load(ClassLoader classLoader, Map<TypeDescription, byte[]> types); ClassReloadingStrategy reset(Class<?>... type); ClassReloadingStrategy reset(ClassFileLocator classFileLocator, Class<?>... type); ClassReloadingStrategy enableBootstrapInjection(File folder); ClassReloadingStrategy preregistered(Class<?>... type); }
ClassReloadingStrategy implements ClassLoadingStrategy<ClassLoader> { public static ClassReloadingStrategy fromInstalledAgent() { try { return ClassReloadingStrategy.of((Instrumentation) ClassLoader.getSystemClassLoader() .loadClass(INSTALLER_TYPE) .getMethod(INSTRUMENTATION_GETTER) .invoke(STATIC_MEMBER)); } catch (RuntimeException exception) { throw exception; } catch (Exception exception) { throw new IllegalStateException("The Byte Buddy agent is not installed or not accessible", exception); } } ClassReloadingStrategy(Instrumentation instrumentation, Strategy strategy); protected  ClassReloadingStrategy(Instrumentation instrumentation,
                                     Strategy strategy,
                                     BootstrapInjection bootstrapInjection,
                                     Map<String, Class<?>> preregisteredTypes); static ClassReloadingStrategy of(Instrumentation instrumentation); static ClassReloadingStrategy fromInstalledAgent(); static ClassReloadingStrategy fromInstalledAgent(Strategy strategy); Map<TypeDescription, Class<?>> load(ClassLoader classLoader, Map<TypeDescription, byte[]> types); ClassReloadingStrategy reset(Class<?>... type); ClassReloadingStrategy reset(ClassFileLocator classFileLocator, Class<?>... type); ClassReloadingStrategy enableBootstrapInjection(File folder); ClassReloadingStrategy preregistered(Class<?>... type);  }