Class ClassFileLocator.AgentBased.ClassLoadingDelegate.Explicit

    • Field Detail

      • types

        private final java.util.Map<java.lang.String,​java.lang.Class<?>> types
        The map of registered classes mapped by their name.
    • Constructor Detail

      • Explicit

        public Explicit​(java.lang.ClassLoader classLoader,
                        java.util.Collection<? extends java.lang.Class<?>> types)
        Creates a new class loading delegate with a possibility of looking up explicitly registered classes.
        Parameters:
        classLoader - The class loader to be used for looking up classes.
        types - A collection of classes that cannot be looked up explicitly.
      • Explicit

        public Explicit​(ClassFileLocator.AgentBased.ClassLoadingDelegate fallbackDelegate,
                        java.util.Collection<? extends java.lang.Class<?>> types)
        Creates a new class loading delegate with a possibility of looking up explicitly registered classes.
        Parameters:
        fallbackDelegate - The class loading delegate to query for any class that is not registered explicitly.
        types - A collection of classes that cannot be looked up explicitly.
    • Method Detail

      • of

        public static ClassFileLocator.AgentBased.ClassLoadingDelegate of​(java.lang.Class<?> type)
        Creates an explicit class loading delegate for the given type.
        Parameters:
        type - The type that is explicitly locatable.
        Returns:
        A suitable class loading delegate.
      • locate

        public java.lang.Class<?> locate​(java.lang.String name)
                                  throws java.lang.ClassNotFoundException
        Loads a class by its name.
        Specified by:
        locate in interface ClassFileLocator.AgentBased.ClassLoadingDelegate
        Parameters:
        name - The name of the type.
        Returns:
        The class with the given name.
        Throws:
        java.lang.ClassNotFoundException - If a class cannot be found.