49 * is defined to the given class loader. 50 * 51 * The URI is for information purposes only, it can be {@code null}. 52 */ 53 Module defineModule(ClassLoader loader, ModuleDescriptor descriptor, URI uri); 54 55 /** 56 * Updates the readability so that module m1 reads m2. The new read edge 57 * does not result in a strong reference to m2 (m2 can be GC'ed). 58 * 59 * This method is the same as m1.addReads(m2) but without a permission check. 60 */ 61 void addReads(Module m1, Module m2); 62 63 /** 64 * Updates module m to read all unnamed modules. 65 */ 66 void addReadsAllUnnamed(Module m); 67 68 /** 69 * Updates module m1 to export a package to module m2. The export does 70 * not result in a strong reference to m2 (m2 can be GC'ed). 71 */ 72 void addExports(Module m1, String pkg, Module m2); 73 74 /** 75 * Updates module m1 to open a package to module m2. Opening the 76 * package does not result in a strong reference to m2 (m2 can be GC'ed). 77 */ 78 void addOpens(Module m1, String pkg, Module m2); 79 80 /** 81 * Updates a module m to export a package to all modules. 82 */ 83 void addExportsToAll(Module m, String pkg); 84 85 /** 86 * Updates a module m to open a package to all modules. 87 */ 88 void addOpensToAll(Module m, String pkg); 89 90 /** 91 * Updates a module m to export a package to all unnamed modules. 92 */ 93 void addExportsToAllUnnamed(Module m, String pkg); 94 95 /** 96 * Updates a module m to open a package to all unnamed modules. 97 */ 98 void addOpensToAllUnnamed(Module m, String pkg); 99 100 /** 101 * Updates a module m to use a service. 102 */ 103 void addUses(Module m, Class<?> service); 104 105 /** 106 * Add a package to the given module. 107 */ 108 void addPackage(Module m, String pkg); 109 110 /** 111 * Returns the ServicesCatalog for the given Layer. 112 */ 113 ServicesCatalog getServicesCatalog(Layer layer); 114 115 /** 116 * Returns an ordered stream of layers. The first element is is the 117 * given layer, the remaining elements are its parents, in DFS order. 118 */ 119 Stream<Layer> layers(Layer layer); 120 121 /** 122 * Returns a stream of the layers that have modules defined to the 123 * given class loader. 124 */ 125 Stream<Layer> layers(ClassLoader loader); 126 127 /** 128 * Tests if a module exports a package at least {@code other} via its 129 * module declaration. 130 * 131 * @apiNote This is a temporary method for debugging features. 132 */ 133 boolean isStaticallyExported(Module module, String pn, Module other); 134 } | 49 * is defined to the given class loader. 50 * 51 * The URI is for information purposes only, it can be {@code null}. 52 */ 53 Module defineModule(ClassLoader loader, ModuleDescriptor descriptor, URI uri); 54 55 /** 56 * Updates the readability so that module m1 reads m2. The new read edge 57 * does not result in a strong reference to m2 (m2 can be GC'ed). 58 * 59 * This method is the same as m1.addReads(m2) but without a permission check. 60 */ 61 void addReads(Module m1, Module m2); 62 63 /** 64 * Updates module m to read all unnamed modules. 65 */ 66 void addReadsAllUnnamed(Module m); 67 68 /** 69 * Update module m to export a package to all modules. 70 */ 71 void addExports(Module m, String pn); 72 73 /** 74 * Updates module m1 to export a package to module m2. The export does 75 * not result in a strong reference to m2 (m2 can be GC'ed). 76 */ 77 void addExports(Module m1, String pkg, Module m2); 78 79 /** 80 * Updates a module m to export a package to all unnamed modules. 81 */ 82 void addExportsToAllUnnamed(Module m, String pkg); 83 84 /** 85 * Updates a module m to open a package to all modules. 86 */ 87 void addOpens(Module m, String pkg); 88 89 /** 90 * Updates module m1 to open a package to module m2. Opening the 91 * package does not result in a strong reference to m2 (m2 can be GC'ed). 92 */ 93 void addOpens(Module m1, String pkg, Module m2); 94 95 /** 96 * Updates a module m to open a package to all unnamed modules. 97 */ 98 void addOpensToAllUnnamed(Module m, String pkg); 99 100 /** 101 * Updates a module m to use a service. 102 */ 103 void addUses(Module m, Class<?> service); 104 105 /** 106 * Returns the ServicesCatalog for the given Layer. 107 */ 108 ServicesCatalog getServicesCatalog(Layer layer); 109 110 /** 111 * Returns an ordered stream of layers. The first element is is the 112 * given layer, the remaining elements are its parents, in DFS order. 113 */ 114 Stream<Layer> layers(Layer layer); 115 116 /** 117 * Returns a stream of the layers that have modules defined to the 118 * given class loader. 119 */ 120 Stream<Layer> layers(ClassLoader loader); 121 } |