< prev index next >

src/hotspot/share/classfile/classLoader.hpp

Print this page

        

*** 45,67 **** template <typename T> class GrowableArray; class ClassPathEntry : public CHeapObj<mtClass> { private: ClassPathEntry* volatile _next; - protected: - const char* copy_path(const char*path); public: ClassPathEntry* next() const; virtual ~ClassPathEntry() {} void set_next(ClassPathEntry* next); ! virtual bool is_modules_image() const { return false; } ! virtual bool is_jar_file() const { return false; } ! // Is this entry created from the "Class-path" attribute from a JAR Manifest? ! virtual bool from_class_path_attr() const { return false; } virtual const char* name() const = 0; ! virtual JImageFile* jimage() const { return NULL; } ! virtual void close_jimage() {} // Constructor ClassPathEntry() : _next(NULL) {} // Attempt to locate file_name through this class path entry. // Returns a class file parsing stream if successfull. virtual ClassFileStream* open_stream(const char* name, TRAPS) = 0; --- 45,63 ---- template <typename T> class GrowableArray; class ClassPathEntry : public CHeapObj<mtClass> { private: ClassPathEntry* volatile _next; public: ClassPathEntry* next() const; virtual ~ClassPathEntry() {} void set_next(ClassPathEntry* next); ! virtual bool is_modules_image() const = 0; ! virtual bool is_jar_file() const = 0; virtual const char* name() const = 0; ! virtual JImageFile* jimage() const = 0; ! virtual void close_jimage() = 0; // Constructor ClassPathEntry() : _next(NULL) {} // Attempt to locate file_name through this class path entry. // Returns a class file parsing stream if successfull. virtual ClassFileStream* open_stream(const char* name, TRAPS) = 0;
*** 73,90 **** class ClassPathDirEntry: public ClassPathEntry { private: const char* _dir; // Name of directory public: const char* name() const { return _dir; } ! ClassPathDirEntry(const char* dir) { ! _dir = copy_path(dir); ! } virtual ~ClassPathDirEntry() {} ClassFileStream* open_stream(const char* name, TRAPS); }; // Type definitions for zip file and zip file entry typedef void* jzfile; typedef struct { char *name; /* entry name */ jlong time; /* modification time */ --- 69,89 ---- class ClassPathDirEntry: public ClassPathEntry { private: const char* _dir; // Name of directory public: + bool is_modules_image() const { return false; } + bool is_jar_file() const { return false; } const char* name() const { return _dir; } ! JImageFile* jimage() const { return NULL; } ! void close_jimage() {} ! ClassPathDirEntry(const char* dir); virtual ~ClassPathDirEntry() {} ClassFileStream* open_stream(const char* name, TRAPS); }; + // Type definitions for zip file and zip file entry typedef void* jzfile; typedef struct { char *name; /* entry name */ jlong time; /* modification time */
*** 98,113 **** class ClassPathZipEntry: public ClassPathEntry { private: jzfile* _zip; // The zip archive const char* _zip_name; // Name of zip archive - bool _from_class_path_attr; // From the "Class-path" attribute of a jar file public: bool is_jar_file() const { return true; } - bool from_class_path_attr() const { return _from_class_path_attr; } const char* name() const { return _zip_name; } ! ClassPathZipEntry(jzfile* zip, const char* zip_name, bool is_boot_append, bool from_class_path_attr); virtual ~ClassPathZipEntry(); u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS); ClassFileStream* open_stream(const char* name, TRAPS); void contents_do(void f(const char* name, void* context), void* context); }; --- 97,113 ---- class ClassPathZipEntry: public ClassPathEntry { private: jzfile* _zip; // The zip archive const char* _zip_name; // Name of zip archive public: + bool is_modules_image() const { return false; } bool is_jar_file() const { return true; } const char* name() const { return _zip_name; } ! JImageFile* jimage() const { return NULL; } ! void close_jimage() {} ! ClassPathZipEntry(jzfile* zip, const char* zip_name, bool is_boot_append); virtual ~ClassPathZipEntry(); u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS); ClassFileStream* open_stream(const char* name, TRAPS); void contents_do(void f(const char* name, void* context), void* context); };
*** 119,128 **** --- 119,129 ---- JImageFile* _jimage; const char* _name; DEBUG_ONLY(static ClassPathImageEntry* _singleton;) public: bool is_modules_image() const; + bool is_jar_file() const { return false; } bool is_open() const { return _jimage != NULL; } const char* name() const { return _name == NULL ? "" : _name; } JImageFile* jimage() const { return _jimage; } void close_jimage(); ClassPathImageEntry(JImageFile* jimage, const char* name);
*** 147,156 **** --- 148,159 ---- ModuleClassPathList(Symbol* module_name); ~ModuleClassPathList(); void add_to_list(ClassPathEntry* new_entry); }; + class SharedPathsMiscInfo; + class ClassLoader: AllStatic { public: enum ClassLoaderType { BOOT_LOADER = 1, /* boot loader */ PLATFORM_LOADER = 2, /* PlatformClassLoader */
*** 219,228 **** --- 222,233 ---- static ClassPathEntry* _first_append_entry; // Last entry in linked list of appended ClassPathEntry instances static ClassPathEntry* _last_append_entry; // Info used by CDS + CDS_ONLY(static SharedPathsMiscInfo * _shared_paths_misc_info;) + CDS_ONLY(static ClassPathEntry* _app_classpath_entries;) CDS_ONLY(static ClassPathEntry* _last_app_classpath_entry;) CDS_ONLY(static ClassPathEntry* _module_path_entries;) CDS_ONLY(static ClassPathEntry* _last_module_path_entry;) CDS_ONLY(static void setup_app_search_path(const char* class_path);)
*** 250,261 **** static void load_jimage_library(); public: static ClassPathEntry* create_class_path_entry(const char *path, const struct stat* st, bool throw_exception, ! bool is_boot_append, ! bool from_class_path_attr, TRAPS); // If the package for the fully qualified class name is in the boot // loader's package entry table then add_package() sets the classpath_index // field so that get_system_package() will know to return a non-null value // for the package's location. And, so that the package will be added to --- 255,265 ---- static void load_jimage_library(); public: static ClassPathEntry* create_class_path_entry(const char *path, const struct stat* st, bool throw_exception, ! bool is_boot_append, TRAPS); // If the package for the fully qualified class name is in the boot // loader's package entry table then add_package() sets the classpath_index // field so that get_system_package() will know to return a non-null value // for the package's location. And, so that the package will be added to
*** 275,285 **** static jboolean decompress(void *in, u8 inSize, void *out, u8 outSize, char **pmsg); static int crc32(int crc, const char* buf, int len); static bool update_class_path_entry_list(const char *path, bool check_for_duplicates, bool is_boot_append, - bool from_class_path_attr, bool throw_exception=true); CDS_ONLY(static void update_module_path_entry_list(const char *path, TRAPS);) static void print_bootclasspath(); // Timing --- 279,288 ----
*** 403,412 **** --- 406,419 ---- num_entries ++; e = e->next(); } return num_entries; } + static void finalize_shared_paths_misc_info(); + static int get_shared_paths_misc_info_size(); + static void* get_shared_paths_misc_info(); + static bool check_shared_paths_misc_info(void* info, int size, bool is_static); static void exit_with_path_failure(const char* error, const char* message); static char* skip_uri_protocol(char* source); static void record_result(InstanceKlass* ik, const ClassFileStream* stream, TRAPS); #endif static JImageLocationRef jimage_find_resource(JImageFile* jf, const char* module_name,
< prev index next >