1 /*
2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
34
35 public:
36 // define_module defines a module containing the specified packages. It binds the
37 // module to its class loader by creating the ModuleEntry record in the
38 // ClassLoader's ModuleEntry table, and creates PackageEntry records in the class
39 // loader's PackageEntry table. As in JVM_DefineClass the jstring format for all
40 // package names must use "/" and not "."
41 //
42 // IllegalArgumentExceptions are thrown for the following :
43 // * Module's Class loader is not a subclass of java.lang.ClassLoader
44 // * Module's Class loader already has a module with that name
45 // * Module's Class loader has already defined types for any of the module's packages
46 // * Module_name is syntactically bad
47 // * Packages contains an illegal package name
48 // * Packages contains a duplicate package name
49 // * A package already exists in another module for this class loader
50 // * Module is an unnamed module
51 // * num_packages is negative
52 // * num_packages is non-zero when packages is null
53 // NullPointerExceptions are thrown if module is null.
54 static void define_module(jobject module, jstring version,
55 jstring location, const char* const* packages,
56 jsize num_packages, TRAPS);
57
58 // Provides the java.lang.reflect.Module for the unnamed module defined
59 // to the boot loader.
60 //
61 // IllegalArgumentExceptions are thrown for the following :
62 // * Module has a name
63 // * Module is not a subclass of java.lang.reflect.Module
64 // * Module's class loader is not the boot loader
65 // NullPointerExceptions are thrown if module is null.
66 static void set_bootloader_unnamed_module(jobject module, TRAPS);
67
68 // This either does a qualified export of package in module from_module to module
69 // to_module or, if to_module is null, does an unqualified export of package.
70 // The format for the package name must use "/' not ".".
71 //
72 // Error conditions causing IlegalArgumentException to be throw :
73 // * Module from_module does not exist
74 // * Module to_module is not null and does not exist
|
1 /*
2 * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
34
35 public:
36 // define_module defines a module containing the specified packages. It binds the
37 // module to its class loader by creating the ModuleEntry record in the
38 // ClassLoader's ModuleEntry table, and creates PackageEntry records in the class
39 // loader's PackageEntry table. As in JVM_DefineClass the jstring format for all
40 // package names must use "/" and not "."
41 //
42 // IllegalArgumentExceptions are thrown for the following :
43 // * Module's Class loader is not a subclass of java.lang.ClassLoader
44 // * Module's Class loader already has a module with that name
45 // * Module's Class loader has already defined types for any of the module's packages
46 // * Module_name is syntactically bad
47 // * Packages contains an illegal package name
48 // * Packages contains a duplicate package name
49 // * A package already exists in another module for this class loader
50 // * Module is an unnamed module
51 // * num_packages is negative
52 // * num_packages is non-zero when packages is null
53 // NullPointerExceptions are thrown if module is null.
54 static void define_module(jobject module, jboolean is_open, jstring version,
55 jstring location, const char* const* packages,
56 jsize num_packages, TRAPS);
57
58 // Provides the java.lang.reflect.Module for the unnamed module defined
59 // to the boot loader.
60 //
61 // IllegalArgumentExceptions are thrown for the following :
62 // * Module has a name
63 // * Module is not a subclass of java.lang.reflect.Module
64 // * Module's class loader is not the boot loader
65 // NullPointerExceptions are thrown if module is null.
66 static void set_bootloader_unnamed_module(jobject module, TRAPS);
67
68 // This either does a qualified export of package in module from_module to module
69 // to_module or, if to_module is null, does an unqualified export of package.
70 // The format for the package name must use "/' not ".".
71 //
72 // Error conditions causing IlegalArgumentException to be throw :
73 // * Module from_module does not exist
74 // * Module to_module is not null and does not exist
|