141 // 142 // An internal SystemProperty is one that has been removed in 143 // jdk.internal.VM.saveAndRemoveProperties, like jdk.boot.class.path.append. 144 // 145 class SystemProperty : public PathString { 146 private: 147 char* _key; 148 SystemProperty* _next; 149 bool _internal; 150 bool _writeable; 151 bool writeable() { return _writeable; } 152 153 public: 154 // Accessors 155 char* value() const { return PathString::value(); } 156 const char* key() const { return _key; } 157 bool internal() const { return _internal; } 158 SystemProperty* next() const { return _next; } 159 void set_next(SystemProperty* next) { _next = next; } 160 161 // A system property should only have its value set 162 // via an external interface if it is a writeable property. 163 // The internal, non-writeable property jdk.boot.class.path.append 164 // is the only exception to this rule. It can be set externally 165 // via -Xbootclasspath/a or JVMTI OnLoad phase call to AddToBootstrapClassLoaderSearch. 166 // In those cases for jdk.boot.class.path.append, the base class 167 // set_value and append_value methods are called directly. 168 bool set_writeable_value(const char *value) { 169 if (writeable()) { 170 return set_value(value); 171 } 172 return false; 173 } 174 175 // Constructor 176 SystemProperty(const char* key, const char* value, bool writeable, bool internal = false) : PathString(value) { 177 if (key == NULL) { 178 _key = NULL; 179 } else { 180 _key = AllocateHeap(strlen(key)+1, mtArguments); 731 } 732 733 // Java launcher properties 734 static void process_sun_java_launcher_properties(JavaVMInitArgs* args); 735 736 // System properties 737 static void init_system_properties(); 738 739 // Update/Initialize System properties after JDK version number is known 740 static void init_version_specific_system_properties(); 741 742 // Property List manipulation 743 static void PropertyList_add(SystemProperty *element); 744 static void PropertyList_add(SystemProperty** plist, SystemProperty *element); 745 static void PropertyList_add(SystemProperty** plist, const char* k, const char* v, bool writeable, bool internal); 746 747 static void PropertyList_unique_add(SystemProperty** plist, const char* k, const char* v, 748 PropertyAppendable append, PropertyWriteable writeable, 749 PropertyInternal internal); 750 static const char* PropertyList_get_value(SystemProperty* plist, const char* key); 751 static int PropertyList_count(SystemProperty* pl); 752 static const char* PropertyList_get_key_at(SystemProperty* pl,int index); 753 static char* PropertyList_get_value_at(SystemProperty* pl,int index); 754 755 static bool is_internal_module_property(const char* option); 756 757 // Miscellaneous System property value getter and setters. 758 static void set_dll_dir(const char *value) { _sun_boot_library_path->set_value(value); } 759 static void set_java_home(const char *value) { _java_home->set_value(value); } 760 static void set_library_path(const char *value) { _java_library_path->set_value(value); } 761 static void set_ext_dirs(char *value) { _ext_dirs = os::strdup_check_oom(value); } 762 763 // Set up the underlying pieces of the system boot class path 764 static void add_patch_mod_prefix(const char *module_name, const char *path, bool* patch_mod_javabase); 765 static void set_sysclasspath(const char *value) { 766 _system_boot_class_path->set_value(value); 767 set_jdkbootclasspath_append(); 768 } 769 static void append_sysclasspath(const char *value) { 770 _system_boot_class_path->append_value(value); 771 set_jdkbootclasspath_append(); | 141 // 142 // An internal SystemProperty is one that has been removed in 143 // jdk.internal.VM.saveAndRemoveProperties, like jdk.boot.class.path.append. 144 // 145 class SystemProperty : public PathString { 146 private: 147 char* _key; 148 SystemProperty* _next; 149 bool _internal; 150 bool _writeable; 151 bool writeable() { return _writeable; } 152 153 public: 154 // Accessors 155 char* value() const { return PathString::value(); } 156 const char* key() const { return _key; } 157 bool internal() const { return _internal; } 158 SystemProperty* next() const { return _next; } 159 void set_next(SystemProperty* next) { _next = next; } 160 161 bool is_readable() const { 162 return !_internal || strcmp(_key, "jdk.boot.class.path.append") == 0; 163 } 164 165 // A system property should only have its value set 166 // via an external interface if it is a writeable property. 167 // The internal, non-writeable property jdk.boot.class.path.append 168 // is the only exception to this rule. It can be set externally 169 // via -Xbootclasspath/a or JVMTI OnLoad phase call to AddToBootstrapClassLoaderSearch. 170 // In those cases for jdk.boot.class.path.append, the base class 171 // set_value and append_value methods are called directly. 172 bool set_writeable_value(const char *value) { 173 if (writeable()) { 174 return set_value(value); 175 } 176 return false; 177 } 178 179 // Constructor 180 SystemProperty(const char* key, const char* value, bool writeable, bool internal = false) : PathString(value) { 181 if (key == NULL) { 182 _key = NULL; 183 } else { 184 _key = AllocateHeap(strlen(key)+1, mtArguments); 735 } 736 737 // Java launcher properties 738 static void process_sun_java_launcher_properties(JavaVMInitArgs* args); 739 740 // System properties 741 static void init_system_properties(); 742 743 // Update/Initialize System properties after JDK version number is known 744 static void init_version_specific_system_properties(); 745 746 // Property List manipulation 747 static void PropertyList_add(SystemProperty *element); 748 static void PropertyList_add(SystemProperty** plist, SystemProperty *element); 749 static void PropertyList_add(SystemProperty** plist, const char* k, const char* v, bool writeable, bool internal); 750 751 static void PropertyList_unique_add(SystemProperty** plist, const char* k, const char* v, 752 PropertyAppendable append, PropertyWriteable writeable, 753 PropertyInternal internal); 754 static const char* PropertyList_get_value(SystemProperty* plist, const char* key); 755 static const char* PropertyList_get_readable_value(SystemProperty* plist, const char* key); 756 static int PropertyList_count(SystemProperty* pl); 757 static int PropertyList_readable_count(SystemProperty* pl); 758 static const char* PropertyList_get_key_at(SystemProperty* pl,int index); 759 static char* PropertyList_get_value_at(SystemProperty* pl,int index); 760 761 static bool is_internal_module_property(const char* option); 762 763 // Miscellaneous System property value getter and setters. 764 static void set_dll_dir(const char *value) { _sun_boot_library_path->set_value(value); } 765 static void set_java_home(const char *value) { _java_home->set_value(value); } 766 static void set_library_path(const char *value) { _java_library_path->set_value(value); } 767 static void set_ext_dirs(char *value) { _ext_dirs = os::strdup_check_oom(value); } 768 769 // Set up the underlying pieces of the system boot class path 770 static void add_patch_mod_prefix(const char *module_name, const char *path, bool* patch_mod_javabase); 771 static void set_sysclasspath(const char *value) { 772 _system_boot_class_path->set_value(value); 773 set_jdkbootclasspath_append(); 774 } 775 static void append_sysclasspath(const char *value) { 776 _system_boot_class_path->append_value(value); 777 set_jdkbootclasspath_append(); |