All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.earcam.instrumental.agent.InstrumentationServiceProvider Maven / Gradle / Ivy

The newest version!
/*-
 * #%L
 * io.earcam.instrumental.agent
 * %%
 * Copyright (C) 2018 earcam
 * %%
 * SPDX-License-Identifier: (BSD-3-Clause OR EPL-1.0 OR Apache-2.0 OR MIT)
 * 
 * You must choose to accept, in full - any individual or combination of 
 * the following licenses:
 * 
 * #L%
 */
package io.earcam.instrumental.agent;

import java.lang.instrument.Instrumentation;
import java.nio.file.Path;
import java.util.Objects;

import io.earcam.unexceptional.Exceptional;

/**
 * 

* InstrumentationServiceProvider class. *

* */ public final class InstrumentationServiceProvider extends InstrumentationWrapper { static volatile Instrumentation instance; /** *

* Constructor for InstrumentationServiceProvider. *

*/ public InstrumentationServiceProvider() { attach(); setDelegate(instance); } private static void attach() { if(instance == null) { Path agentJar = StubAgentJar.stubAgentJar("fake-agent-", FakeAgent.class); Exceptional.accept(Attach::attach, agentJar.toUri(), ""); Objects.requireNonNull(instance); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy