Class AgentBuilder.InitializationStrategy.SelfInjection.Dispatcher.InjectingInitializer

    • Field Detail

      • instrumentedType

        private final TypeDescription instrumentedType
        The instrumented type.
      • auxiliaryTypes

        private final java.util.Set<TypeDescription> auxiliaryTypes
        The auxiliary types to inject.
      • classFileLocator

        private final ClassFileLocator classFileLocator
        The class file locator to use.
      • loadedTypeInitializers

        private final java.util.Map<TypeDescription,​LoadedTypeInitializer> loadedTypeInitializers
        The instrumented types and auxiliary types mapped to their loaded type initializers. The instrumented types and auxiliary types mapped to their loaded type initializers.
      • classInjector

        private final ClassInjector classInjector
        The class injector to use.
    • Constructor Detail

      • InjectingInitializer

        protected InjectingInitializer​(TypeDescription instrumentedType,
                                       java.util.Set<TypeDescription> auxiliaryTypes,
                                       ClassFileLocator classFileLocator,
                                       java.util.Map<TypeDescription,​LoadedTypeInitializer> loadedTypeInitializers,
                                       ClassInjector classInjector)
        Creates a new injection initializer.
        Parameters:
        instrumentedType - The instrumented type.
        auxiliaryTypes - The auxiliary types to inject.
        classFileLocator - The class file locator to use.
        loadedTypeInitializers - The instrumented types and auxiliary types mapped to their loaded type initializers.
        classInjector - The class injector to use.
    • Method Detail

      • onLoad

        public void onLoad​(java.lang.Class<?> type)
        Callback that is invoked on the creation of an instrumented type. If the loaded type initializer is alive, this method should be implemented empty instead of throwing an exception.
        Specified by:
        onLoad in interface LoadedTypeInitializer
        Parameters:
        type - The manifestation of the instrumented type.
      • isAlive

        public boolean isAlive()
        Indicates if this initializer is alive and needs to be invoked. This is only meant as a mark. A loaded type initializer that is not alive might still be called and must therefore not throw an exception but rather provide an empty implementation.
        Specified by:
        isAlive in interface LoadedTypeInitializer
        Returns:
        true if this initializer is alive.