static void load(final Instrumentation inst) { try { addMixinInterfacesToBootstrap(inst); addBridgeJarToClassPath(inst); addJarToClassPath( inst, new JarFile(EmbeddedJarFilesImpl.INSTANCE.getJarFileInAgent("newrelic-api"))); addJarToClassPath( inst, new JarFile(EmbeddedJarFilesImpl.INSTANCE.getJarFileInAgent("newrelic-weaver-api"))); } catch (Exception e) { throw new RuntimeException(e); } }
private static void addBridgeJarToClassPath(final Instrumentation instrProxy) throws ClassNotFoundException, IOException { final JarFile jarFileInAgent = new JarFile(EmbeddedJarFilesImpl.INSTANCE.getJarFileInAgent("agent-bridge")); forceCorrectNewRelicApi(instrProxy, jarFileInAgent); addJarToClassPath(instrProxy, jarFileInAgent); }
public static Collection<URL> getJarURLs() throws ClassNotFoundException, IOException { final List<URL> urls = new ArrayList<URL>(); for (final String name : new String[] {"agent-bridge", "newrelic-api", "newrelic-weaver-api"}) { final File jarFileInAgent = EmbeddedJarFilesImpl.INSTANCE.getJarFileInAgent(name); urls.add(jarFileInAgent.toURI().toURL()); } return urls; }