Example usage for org.springframework.instrument.classloading LoadTimeWeaver getClass

List of usage examples for org.springframework.instrument.classloading LoadTimeWeaver getClass

Introduction

In this page you can find the example usage for org.springframework.instrument.classloading LoadTimeWeaver getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.springframework.context.weaving.DefaultContextLoadTimeWeaver.java

@Override
public void setBeanClassLoader(ClassLoader classLoader) {
    LoadTimeWeaver serverSpecificLoadTimeWeaver = createServerSpecificLoadTimeWeaver(classLoader);
    if (serverSpecificLoadTimeWeaver != null) {
        if (logger.isInfoEnabled()) {
            logger.info("Determined server-specific load-time weaver: "
                    + serverSpecificLoadTimeWeaver.getClass().getName());
        }/*from   w ww  .  j  a  v a  2  s.c o  m*/
        this.loadTimeWeaver = serverSpecificLoadTimeWeaver;
    } else if (InstrumentationLoadTimeWeaver.isInstrumentationAvailable()) {
        logger.info("Found Spring's JVM agent for instrumentation");
        this.loadTimeWeaver = new InstrumentationLoadTimeWeaver(classLoader);
    } else {
        try {
            this.loadTimeWeaver = new ReflectiveLoadTimeWeaver(classLoader);
            if (logger.isInfoEnabled()) {
                logger.info("Using a reflective load-time weaver for class loader: "
                        + this.loadTimeWeaver.getInstrumentableClassLoader().getClass().getName());
            }
        } catch (IllegalStateException ex) {
            throw new IllegalStateException(ex.getMessage() + " Specify a custom LoadTimeWeaver or start your "
                    + "Java virtual machine with Spring's agent: -javaagent:org.springframework.instrument.jar");
        }
    }
}