Enum ByteArrayClassLoader.PersistenceHandler

    • Enum Constant Detail

      • LATENT

        public static final ByteArrayClassLoader.PersistenceHandler LATENT
        The latent persistence handler hides all class file representations and does not make them accessible even before they are loaded.
    • Method Detail

      • values

        public static ByteArrayClassLoader.PersistenceHandler[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ByteArrayClassLoader.PersistenceHandler c : ByteArrayClassLoader.PersistenceHandler.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ByteArrayClassLoader.PersistenceHandler valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • isManifest

        public boolean isManifest()
        Checks if this persistence handler represents manifest class file storage.
        Returns:
        true if this persistence handler represents manifest class file storage.
      • lookup

        protected abstract byte[] lookup​(String name,
                                         ConcurrentMap<String,​byte[]> typeDefinitions)
        Performs a lookup of a class file by its name.
        Parameters:
        name - The name of the class to be loaded.
        typeDefinitions - A map of fully qualified class names pointing to their binary representations.
        Returns:
        The byte array representing the requested class or null if no such class is known.
      • url

        protected abstract URL url​(String resourceName,
                                   ConcurrentMap<String,​byte[]> typeDefinitions)
        Returns a URL representing a class file.
        Parameters:
        resourceName - The name of the requested resource.
        typeDefinitions - A mapping of byte arrays by their type names.
        Returns:
        A URL representing the type definition or null if the requested resource does not represent a class file.
      • release

        protected abstract void release​(String name,
                                        ConcurrentMap<String,​byte[]> typeDefinitions)
        Removes the binary representation of the supplied type if this class loader is latent.
        Parameters:
        name - The name of the type.
        typeDefinitions - A mapping of byte arrays by their type names.