Index

Symbols

(JPA) Java Persistence API 48

(JShell) Java Shell Tool 20

@Controller annotation 370

@-files (argument files) 198

@Generated annotation 160, 160, 162

@jdk.Exported annotation 145

@Nonnull annotation 156, 157, 160, 162

@Nullable annotation 157

@RequestMapping annotation 370

@Test annotation 368, 370

$JAVA_HOME 196

A

abstract classes 228

Abstract Window Toolkit (AWT) 19

accessibility 6775

defined 67

encapsulating transitive dependencies 7171

encapsulation skirmishes 7275

module not read 7475

package not exported 7474

type not public 7373

strong encapsulation 6971

AccessibleObject::setAccessible 193, 280

AccessibleObject::trySetAccessible 280

addExports 286

Add-Exports 198

--add-exports option 133, 150, 152, 153, 154, 163, 199, 268, 269, 298

--add-modules ALL-MODULE-PATH 174

add-modules monitor.persistence 116

--add-modules option 81, 82, 106, 106, 106, 115, 122, 129, 129, 160, 162, 173, 174, 181, 182, 183, 198, 203, 243, 259, 259, 268, 316, 316, 318, 318

--add-modules option, defined 81

addOpens 286

Add-Opens 198

--add-opens option 133, 154, 199, 298, 298

--add-opens option, defined 277

addPropertyChangeListener method 147

addReads 286

--add-reads app=ALL-UNNAMED option 186

--add-reads option 163

--add-reads option, defined 82

addUses 286

AdoptOpenJDK 192

aggregation 253

aggregator modules 20, 252, 252, 253

ALL-DEFAULT value 81

ALL-MODULE-PATH value 81, 259

ALL-SYSTEM value 81

ALL-UNNAMED value 149, 149, 186

AlphaServiceObserver 36, 37, 37, 221, 222, 228

ambiguity checks 63

anchor class 109

AnnotatedElement interface 370

annotation processors, defined 77

Apache Derby DB 139

Apache Hadoop 17

Apache Twill 310313

--api-only option 382

APIs

decoupling implementations and consumers of 4848

internal, encapsulation of

analyzing dependencies with JDeps 147148

compiler and JVM options for accessing internal APIs 155155

compiling against internal APIs 149150

executing against internal APIs 150154

kinds of APIs 144145

removed APIs 147147

sun.misc.Unsafe class and 146146

public, defining 4141

small surface 348348

AppClassLoader 133, 133, 140

Applet API 140

appletviewer tool 140

application class loader 126, 290

application images, defined 322

application modules, defined 58

argument files (@-files) 198

artifacts 76, 142, 202

AssertJ 200

asterisk, as token for module name 9495

automated security 2828

Automatic-Module-Name 176, 178, 179180, 188, 189, 190, 204, 205, 206, 209, 213

automatic modules

as bridge to classpath 187187

defined 59

depending on 188189

names, adding and editing 209210

AWT (Abstract Window Toolkit) 19

B

base module

defined 58

loading 2222

BCEL (Byte Code Engineering Library) 89

BetaServiceObserver 36, 37, 37, 221, 223, 228

--bind-services option 320, 323

--bind-services option, defined 318

boot class loader 290

-bootclasspath option 98

boot classpath options 137, 137

boot layer, defined 290

bottom-up modularization 200, 202202, 213

break-duplicate-modules-even-if-unrequired branch 63

break-missing-transitive-dependency 62

break-reflection-over-internals branch 73

break-split-package-compilation branch 66

break-split-package-launch branch 66

BuiltinClassLoader 133, 133, 140

bundles 358

Byte Buddy tool 178, 209

Byte Code Engineering Library (BCEL) 89

C

caller sensitive methods 286

Cassandra Java Driver 310313

chains of dependencies 248

charsets 320, 338

--check option 383

cherry-picking functionality, defined 28

Class 107, 108, 122, 303, 368

Class::getResource* method 135

class-data sharing 336

class diagrams 6

classes

adding to modules 211211

with same name, showing 1313

.class files 21, 23, 25, 89, 109, 377, 385

class-for-name plugin 336

ClassLoader::getPlatformClassLoader 290

ClassLoader::getResource* method 135

ClassLoader::getSystemClassLoader method 290

ClassLoader class 107, 108, 122, 131, 133, 140, 154

class loaders 358

class loading 1616

ClassNotFoundException 358

class path 25, 170, 176

defined 365

in Java 9 and later 366366

unnamed module and 172172

using to load application JARs 365366

class-path mode . see unnamed module

class-path mode . see unnamed module

-classpath option 366

-classpath option . seeAlso -cp

--class-path option 171, 366, 379

--class-path option . -classpath option

CMS (Concurrent Mark Sweep) 140

Collection<String> roots argument 294

com.google.collect package 309

com.google.common.collect.Iterators class 13

com.google.common.io.InputSupplier class 15

com.sun.* packages 143, 144, 263

com.sun.java.swing.plaf.nimbus package 150

command-line options 27, 70, 180, 198198, 199, 199, 201

applying 198199

pitfalls of 199199

commenting module declarations 351351

compact profiles 18, 136136

compatibility issues, when moving to Java 9 (or later) 125140

deprecations 140140

JEE modules, working with 127131

new version strings 138138

selecting, replacing, and extending platform 135137

tools no longer included 139139

updated run-time image directory layout 134135

URLClassLoader, casting to 131134

compiledVersion method 308

compileOnly 257, 356

compiler 9898, 366

compiling

errors with 9, 25, 91, 142, 193, 193

multiple modules 9297

asterisk as token for module name 9495

module source path 9394

naive approach 9293

setting initial module 9697

source path entries 9596

whether worth it 9797

single module 8992

composition 253

compress plugin

defined 332

concealed package conflict 156

concern/module hierarchy 86

Concurrent Mark Sweep (CMS) 140

configuration method 291

configurations.compile 377

configurations.runtime 377

Consumer actor 227

consumers

isolating from global state 230232

organizing into modules 232233

continuous integration (CI) 194

copy-dependencies 377

Copy task 377

coupling, keeping to minimum 348349

—cp . seeAlso -classpath option

-cp option 366

createIfMatchingService method 223, 229

--create-module option 90

cyclic dependencies, using services to break 233235

D

debugging modules and modular applications 111120

analyzing individual module 111111

validating sets of modules 112112

excluding modules during resolution 115117

listing observable modules and dependencies 113115

observing module system with log messages 118120

validating module graph 112113

debug messages 374

debug option 151

debug symbols 334

declaration 53

deep reflection 369

defineModules 296

defineModulesWithManyLoaders method 296

defineModulesWithOneLoader method 296

deny option 151

dependencies

analysing 147148, 379382

declaring on other modules 4041

defined 55

direct 366

editing 354355

exposing 246247

implying readability on 247248

indispensible, marking 4747

optional 4949, 256262

coding against 260262

marking as 258259

module resolution of 259260

reliable configuration and 257257

unexpressed between JARs 1212

version conflicts 163164

dependency cycles 6364, 65

dependency inversion 7

dependency tree 304

describe method 291

--describe-module option 111, 306

describe operation 51

DiagnosticDataPoint class 33, 36, 36, 36, 37, 37, 40, 47, 47, 100, 246

direct dependencies 96, 201, 366

directed edges 79

directory structure

new proposal 86

directory structure, organizing projects in 8689

established directory structure 8788

place for module declarations 8889

dirty checking 329

DisconnectedServiceObserver class 72, 72, 73, 73, 74, 75

DOM (document object model) 19, 127, 263

-d option 89, 89, 93, 95

.dot files 380, 381

--dot-output option 380

--dry-run option 112, 113, 119, 122

duplicate modules 6263

dynamic modules 289

E

EAR file 99

Eclipse JGit 16

ecosystem-wide dependency graph 204

encapsulation

of internal APIs 143155

analyzing dependencies with JDeps 147148

compiler and JVM options for accessing internal APIs 155155

compiling against internal APIs 149150

executing against internal APIs 150154

kinds of APIs 144145

removed APIs 147147

sun.misc.Unsafe class and 146146

of transitive dependencies 7171

skirmishes 7275

module not read 7475

package not exported 7474

type not public 7373

strong 6971

weak, across JARs 1617

endorsed standards override mechanism 127137

equals comparison 303

erroneous module declarations 208

exclude-files plugin, defined 333

exclude-resources plugin, defined 333

executable modules 176

ExecutionException 8

explicit dependencies 11, 12

explicit modules 185

explicit modules, defined 59

export directives 39, 41, 53, 83, 221, 244, 262, 272, 272273, 275, 275, 276, 278, 297

exported packages 27

defined 56

exports, making more targeted 4848

exports clauses 109

exports directives 340, 341, 341, 343, 348, 349, 354

exports keyword 53, 56

exports to directive 267, 269, 274

exposed dependencies 206, 248

exposed module 247, 247, 250, 250, 251

exposing module 247, 247, 250, 250, 251

ExtendedCopyOption class 146

ExtendedOpenOption class 146

ExtendedWatchEventModifier class 146

extension mechanism 136136

F

factories, as services 228229

fat JAR 13

feature-implied-readability branch 245

feature-jlink branch 315

featureObject.getClass().newInstance() method 358

feature-optional-dependencies branch 256

feature-qualified-exports branch 262

feature-resources branch 107

features-combined branch 340

feature-services branch 217

feature-versions branch 306

file=value 374

FindBugs 157

findFirst() method 239

findLoader method 291

findModule method 291, 291

Future interface 8, 8

FXML 20

G

gc (garbage collection) 373

generate-jli-classes plugin 336

--generate-module-info option 382

--generate-open-module option 207, 382

getAnnotations method 370

getCallerClass 293

getClass().getClassLoader() method 131

getClassLoader method 131

getClass method 131

getConstructor method 368, 369

get method 369

getMethod method 368, 368, 369

getModule method 172, 284

getName method 172

getResourceAsStream method 107, 109, 122

getResource method 107, 109, 109, 109, 110, 122

global state, isolating consumers from 230232

Gradle 12, 26, 197, 304

gradle dependencies 6

graphs 55, 6

graphs . module graphs

Graphviz 380, 381

Guava 46, 78, 179, 181, 185, 188, 189, 200, 250, 310

Guice 48, 70, 84

H

Hazelcast 17

Hibernate 27, 41, 48, 48, 70, 84, 200

hibernate.jpa dependency 24, 43, 116

hibernate.jpa module 323

high-level code 7

HotSpot FlatProfiler 140

hprof agent library 139

I

--illegal-access=permit option 152

IllegalAccessError 186

IllegalAccessException 369

--illegal-access option 151, 151, 152, 153, 154, 193, 199

IllegalCallerException 286

ImageIO API, Java 229

ImageReader 229, 229

ImageReaderSpi class 229, 229

ImmutableList 185, 185, 185, 186

implied readability 71, 247248, 253

refactoring modules with 251255

when to rely on 250251

when to use 249250

InaccessibleObjectException 280, 280

include-locales plugin

defined 333

incremental modularization

automatic modules and 176189

module resolution for 181186

names 178180

classpath and 170176

reasons for using 167170

technical underpinnings of 169170

unnamed module and 170176

incubator modules, defined 58

indirect dependencies 201

initial module 58, 83

inner classes 228

InputStream class 107, 218

InputSupplier class 15

inside-out modularization 200, 203204, 213

instanceof 303

IntelliJ 13

internal packages/APIs 133, 144, 145

InterruptedException 8

--inverse option 381

--inverse option . -I option

invoke method 368

-I option 381

-I option . —inverse option

IoT (Internet of Things) 314

isAnnotationPresent 240

isModulePresent 292, 292

iterate method 242

iterator method 239

Iterators class 13

J

Jackson 244

jar command 29, 30, 49, 85, 134, 306, 313

jar --describe-module 111, 179, 201, 306, 307, 313

JAR hell 3, 12, 30

jar --main-class 101

jar --module-version 300

-jar option 198

JARs

dependencies unexpressed between 1212

loading, using class path 365366

modular, making 205212

generating module declarations with JDeps 206208

hacking third-party JARs 209211

opening modules as intermediate step 205206

modular, packaging 99101

analyzing a JAR 100100

archiver options 101101

defining entry point 100101

modular, publishing for Java 8 and older 211212

plain, mixing and matching with modules 168168

weak encapsulation across 1617

jar tool 21, 99, 101, 102, 178, 209, 210

jar --update option 210, 211, 211

Java, scalability of 2828

java.* packages 143, 332

java.activation module 127, 131

java.applet package 140

java.awt.* package 19

java.awt.dnd.peer package 147

java.awt.peer package 147

java.base module 19, 21, 22, 23, 23, 24, 57, 100, 115, 136, 200, 224, 287, 318, 332, 332, 335

java.beans package 19

java.class.path property 133

java.compiler module 136

java.corba module 127, 131

java.desktop module 19, 115, 263, 263

java.endorsed.dirs property 137

java.ext.dirs property 136

java.instrument module 136

java.lang.invoke.VarHandle class 282

java.lang.module.ModuleDescriptor class 284

java.lang.Module class 109, 122, 284

java.lang.ModuleLayer class 291

java.lang.Object class 57

java.lang.System.LoggerFinder class 224

java.lang package 9, 19, 331

java.logging module 19, 57, 57, 136, 248, 248, 251

java.management module 136

java.naming module 136, 320

java.nio.charset.spi.CharsetProvider class 319

java.prefs module 136

java.rmi module 19, 57, 136

java.runtime.version property 138

java.scripting module 136

java.se.ee module 20

java.security.jgss module 136, 320

java.security.sasl module 136, 320

java.se module 19, 20, 173

java.smartcardio 320

java.specification.version property 138

java.sql.Connection class 247

java.sql.Driver 248

java.sql.Driver.getParentLogger() method 251

java.sql.Driver class 224

java.sql.rowset module 20, 136

java.sql.SQLXML class 247

java.sql module 20, 60, 136, 224, 232, 247, 378

java.transaction module 127, 131

java.util.Base64 class 146

java.util.concurrent package 9, 56, 56

java.util.jar.Pack200.Packer class 147

java.util.jar.Pack200.Unpacker class 147

java.util.List class 301

java.util.logging.Logger class 248

java.util.logging.LogManager class 147

java.util.logging package 19, 57

java.util package 19, 56, 56

java.version property 138

java.vm.specification.version property 138

java.vm.version property 138

java.xml.bind module 20, 127, 127, 129, 131, 157, 196

java.xml.crypto module 136, 263, 265, 266, 320

java.xml.ws.annotation module 127, 131, 157, 160, 163

java.xml.ws module 127, 131, 265

java.xml module 19, 21, 23, 23, 24, 60, 115, 136, 265

java @file option 277

Java 5, no compilation for 137137

Java 9 or before

loading resources from modules before Java 9 107107

loading resources from modules on Java 9 108109

Java 9 or later

challenges running on 142164

encapsulation of internal APIs 143155

mending split packages 156164

class path in 366366

compatibility issues when moving to 125140

deprecations 140140

JEE modules, working with 127131

new version strings 138138

selecting, replacing, and extending platform 135137

tools no longer included 139139

updated run-time image directory layout 134135

URLClassLoader, casting to 131134

Java API for XML Processing (JAXP) 19, 263

Java API for XML Web Services (JAX-WS) 127

Java Architecture for XML Binding (JAXB) 20, 127

JavaBeans 19

JavaBeans Activation Framework (JAF) 127

javac file option 277

java command 29, 30, 44, 49, 58, 76, 77, 81, 103, 104, 121, 137, 149, 153, 198, 277, 316, 327, 366, 372

Java Community Process (JCP) 127, 157

javac tool 29, 30, 43, 49, 58, 76, 77, 81, 85, 91, 98, 102, 134, 136, 137, 149, 198, 277, 306, 313, 316, 317, 366

Java Database Connectivity (JDBC) 20, 263

JavaDB 139

Java Dependency Analysis Tool (JDeps) 20

java --describe-module option 111, 265, 307

Java Development Kit (JDK) 4, 358358

javadoc tool 134

.java files 134, 350

Java Flight Recorder 139

javafx.bindings module 20

javafx.controls module 20

javafx.graphics module 263

javafx.media module 20

javafx.scene.web module 333

javafx.swing 20

javafx.web 20

JavaFX modules 20, 263, 332

java --list-modules option 20, 51, 58, 113

java --module option 326

Java modules (JMODs) 51

Java Network Launch Protocol (JNLP) 138

javapackager 315

Java Persistence API (JPA) 48, 329

Java Platform Group 305

Java Remote Method Invocation Compiler 196

java-rmi.cgi 139

java-rmi.exe 139

Java Runtime Environment (JRE) 127, 137137, 144

Java SE API 20

Java Shell Tool (JShell) 20

java --show-module-resolution option 173

Java Specification Request (JSR) 28, 157

java tool 315

Java Util Logging 371

Java Virtual Machine (JVM) 8, 328

Java Web Start 137

javaws tool 140

javax.* packages 143

javax.annotation.Generated annotation 163

javax.annotation.Nonnull annotation 163

javax.annotation package 127, 157, 157, 160, 160, 160, 162

javax.swing.* packages 19

javax.xml.bind.JAXB class 157

javax.xml.bind.JAXBException 157

javax.xml.bind.Marshaller class 157

javax.xml.bind package 157

javax.xml.datatype package 266

javax.xml.XMLConstants class 23

JAXB (Java Architecture for XML Binding) 20, 127

JAXBException 127, 129

JAXP (Java API for XML Processing) 19, 263

JAX-WS (Java API for XML Web Services) 127

JBoss Modules 167

jcmd tool 139

JCP (Java Community Process) 127, 157

JDBC (Java Database Connector) 20, 263

JDBC RowSet API 20

JDeps (Java Dependency Analysis Tool)

analysing dependencies 379379381, 382

analyzing dependencies 147148

configuring output 380380

generating module declarations with 206208

modules and 382383

overview 378378

right-sizing images with 320322

jdeps --generate-module-info option 213

jdeps -h option 382

JDK_JAVA_OPTIONS variable 198

jdk.* modules 145

jdk.* packages 144

jdk.charsets module 225, 318, 320

jdk.compiler module 317

jdk.crypto.cryptoki module 320

jdk.crypto.ec module 320

jdk.deploy module 320

jdk.Exported annotation 144

jdk.incubator.* modules 58

jdk.internal.loader package 133

jdk.localedata module 319, 319, 320, 325, 333, 333

jdk.security.jgss module 320

jdk.unsupported module 146, 147, 174

jdk.zipfs module 320

JDK (Java Development Kit) 358358

JDK-internal APIs 151, 186, 193

--jdk-internals option 147, 382

jdk-monitor 325

JEE modules 82, 127129, 131, 186, 193

resolving manually 129130

special features of 127127

third-party implementations of 130131

jhat heap visualizer 139

jlink 28, 29, 58, 131, 136, 164, 173, 314, 315, 317, 328, 336

defined 316

optimizing images using jlink plugins 329336

improving run-time performance 335336

plugins for jlink 329331

reducing image size 331335

right-sizing images with 320322

JLINK_VM_OPTIONS 327

jlink --add-modules option 321

jlink --list-plugins option 331

jmap tool 139

jmod tool 51

JNLP (Java Network Launch Protocol) 138

JOOQ 200

JPA (Java Persistence API) 329

JPEGImageReaderSpi class 229

JPMS (Java Platform Module System)

microservices with 362362

OSGi and 359360

vs. microservices 361362

JRE (Java Runtime Environment) 127, 137137, 144

JSR (Java Specification Request) 28, 157

JUnit 200, 368

jvm.config 196

JVM (Java Virtual Machine) 8, 328

launching with modules 104107

options 121121

unified logging 371375

configuring entire logging pipeline 375375

defining what messages should say 374374

defining where messages should go 374374

defining which messages should be shown 373374

overview 371372

L

--launcher option 326

layer() method 296

layers 158, 309, 313

layers, module graphs with 288297

creating module layers 294

describing module layer 291

finding modules in and across layers 292293

layers explained 289290

lib/modules file 334

--limit-modules option 82, 114, 117, 122, 136, 243

List class 221, 231, 291, 296

--list-deps option 383

--list-modules option 113, 115, 116

--list-reduced-deps option 383

loadInstalled method 238

load methods 238

locales 320

Locator actor 227

Log4j 46, 371

Logback 371

Logger class 225, 228

LoggerFinder class 224, 224, 225, 229, 232

Logger getParentLogger() method 248

Lookup class 282, 283, 283, 298

low-level code 7

M

Main.java file 91

Main class 172, 221, 385

Main-Class entry 101

--main-class option 101

main method 21, 44, 58, 59, 60, 83, 101, 101, 102, 104, 106, 173, 286, 310, 311, 320

manifest file 178, 209

manually implement security checks 17

Map interface 69, 70

master branch 85

Maven 5, 12, 26, 197, 304, 355357

dependency management 356356

encapsulation, services, and linking 356357

maven-dependency-plugin 377

META-INF/versions 387, 388

MethodHandles.lookup() method 282

method signatures 69

microservices

connectivity graphs 5

vs. JPMS 361362

with JPMS 362362

migration strategies 192199

command-line options 198199

continuously building on Java 9+ 194197

estimating effort involved 192194

preparatory updates 192192

missing dependencies 207208

Mockito 27

modular code, extending base 4545

modular diamond of death 6767

modularity, overview of 78

modularization strategies 200205

applying within project 204205

bottom-up modularization 202202

inside-out modularization 203204

top-down modularization 202203

modularized dependencies 187

modular JARs 20, 90, 169, 190, 202

defined 52

Module::getResourceAsStream method 135

Module:addOpens method 287

module/concern hierarchy 87

module.getDescriptor().requires() method 308

module.info.java file 74

Module class 299

module class, defined 284

module declarations 2139, 52, 53, 83, 208, 210

clean 350351

commenting 351351

editing 353355

adding and removing services 354354

changing module's name 353353

dependencies 354355

exporting fewer packages 354354

examples 5757

exporting packages to define module's API 5656

naming modules 5454

requiring modules to express dependencies 5555

reviewing 352352

vs. descriptors 5353

ModuleDescriptor::rawVersion method 313

ModuleDescriptor::requires method 313

ModuleDescriptor class 299, 300, 307, 307

ModuleDescriptor class, defined 284

module descriptors 20, 52, 53, 83

adding and editing 210210

defined 52

module erasure 9

ModuleFinder after argument 294

ModuleFinder before argument 294

module graphs 7883, 182, 288, 289, 297, 299, 344

adding edges to 8283

adding modules to 8082

defined 79

validating 112113

with layers

creating module layers 294

describing module layer 291

finding modules in and across layers 292293

layers explained 289290

module-info.class file 39, 44, 52, 52, 89, 90, 99, 99, 99, 102, 211, 212

module-info.java file 21, 21, 38, 39, 49, 52, 53, 70, 88, 89, 89, 90, 91, 206, 206, 352, 355

module keyword 53, 53, 54

ModuleLayer

defined 291

module layer, defined 289

module name 53, 172, 206

asterisk as token 9495

automatic 178

unnamed module 176

module not found error 88

--module option 22, 23, 23, 96, 96, 102, 104, 104, 105, 107, 116, 116, 122, 327, 382

--module option . -m option

module path 25, 25, 43, 75, 76, 78

defined 76

--module-path option 22, 43, 49, 76, 77, 84, 89, 316, 382

--module-path option . -p option

module-related commands 76

module resolution 2223, 61, 7778, 225227

module resolution*

for optional dependencies 259

modules 8, 20, 87

compiling and packaging 4344

declaring and describing 3942

declaring dependencies on other modules 4041

defining module’s public API 4141

duplicate 6263

ideal 346350

coupling, keeping to minimum 348349

small API surface 348348

smallish modules 347348

most important 1920

reflection over 279288

analyzing module properties with reflection 284286

forwarding open packages 287288

modifying module properties with reflection 286287

updating reflecting code for modules 280281

using variable handles instead of reflection 282283

types of 5760

modules() method 291, 291

modules file 51, 58

--module-source-path option 93, 93, 95, 96, 102

module types, defined 57

--module-version option 99, 306, 307, 313

--module-version option, defined 306

monitor.* modules 181

monitor.alpha module 43

monitor.core module 254

Monitor.java file 91

monitor.Main class 104

monitor.observer.alpha module 37, 47, 47, 47, 48, 61, 221, 222, 225, 246, 248, 250, 255, 265, 323

monitor.observer.beta module 37, 47, 48, 62, 221, 222, 225, 255, 264, 265, 323

monitor.observer.dis 74

monitor.observer.jar 99, 100, 100, 177

monitor.observer.ServiceObserver class 301

monitor.observer.utils package 265, 343

monitor.observer.zero 236, 237, 237, 325

monitor.observer module 37, 43, 48, 55, 61, 72, 73, 74, 75, 87, 89, 89, 96, 99, 112, 115, 223, 246, 250, 252, 265, 323, 383

monitor.observer package 100, 344

monitor.peek 383

monitor.peek module 246, 251

monitor.persistence.entity package 41, 277, 279, 287, 340

monitor.persistence module 37, 41, 62, 63, 64, 251, 279, 323

monitor.resources.opened package 109, 110

monitor.resources module 110, 110

monitor.rest module 37, 41, 44, 64, 96, 96, 181, 183, 323, 343

monitor.statistics.fancy module 81, 81, 82

monitor.statistics.jar 177

monitor.statistics module 37, 46, 49, 53, 54, 55, 56, 62, 63, 64, 66, 96, 115, 252, 254, 260, 323, 342

monitor.statistics package 66, 66, 158, 159

monitor.Utils class 159

Monitor class 33, 33, 35, 35, 36, 36, 37, 37, 41, 221

monitor JAR 10, 24, 177

monitor module 323

monitor package 44, 48, 48, 66, 66, 75, 158, 159, 174, 224, 226

MonitorServer class 36, 36, 36, 37, 37, 41, 156

mon-modular classes 170

monolithic approach 33

-m option 102, 382

-m option . —module option

MR-JARs (multirelease JARs)

creating 212

MR-JARs (multi-release JARs)

creating 212385386

defined 385

internal workings of 387387

usage recommendations 387389

Multimap 303

multiple modules, compiling 9293, 97

asterisk as token for module name 9495

module source path 9394

naive approach 9293

setting initial module 9697

source path entries 9596

whether worth it 9797

multi-release JARs . See MR-JARs (multi-release JARs)

mvn clean install 195

mvn clean verify 195

mvn dependency:tree 6

my.xml.app.jar 22

my.xml.app module 21, 22, 22, 23, 23, 23

N

name() method 308

Named modules, defined 59

native2ascii tool 139

Neo4J 17

Netty 17

newInstance() method 358

next method 240

NimbusLookAndFeel class 143, 150, 152, 153

NoClassDefFoundError 12, 15, 78, 127, 127, 159, 160, 258, 260, 261, 262, 322, 387

non-JDK modules 58

non-JEE modules 190

non-modular code 91

non-public classes 144

NotImplementedException 197

O

Object 69, 75

observable modules 7677

observable modules, defined 58

observer JAR 10, 24

OkHttp 71, 71

openConnection method 369

opening packages

for specific modules 276277

to run-time access 275276

vs. exporting packages 277278

OpenJDK 146, 192

open modules 48, 70

defined 278

open packages 48, 70

opens directive 109, 275, 276, 276, 278, 278, 283, 297

defined 275

opens to directive 276, 298

Optional 223, 229, 239, 291

optional dependencies 77, 343

reliable configuration and 256257, 257

coding against 260262

marking as 258259

module resolution of 259260

Oracle JDK 146

order-resources 336

org.eclipse.jgit.internal package 16

OSGi (Open Service Gateway initiative) 357360

JDK, why doesn't use 358358

JPMS and 359360

OSGi (Open Service Gateway Initiative) 26

--output option 316

P

package-name collision 161

--package option 163

package relationships 347

packages

exporting fewer 354354

making available to reflection only 4849

opening

for specific modules 276277

to run-time access 275276

vs. exporting packages 277278

package-visibility 78, 223

packaging modular JAR 99101

analyzing a JAR 100100

archiver options 101101

defining entry point 100101

parent layers 289

parents() method 291

--patch-module option 136, 137, 162, 162, 198, 210, 211, 287

permit option 151

persistence JAR 10, 24

persistence module 40

plain JARs 90, 99, 169, 181, 190, 202

platform class loader 290

platform modules 19, 20, 83

defined 58

plugin --${name} command-line option, defined 331

plugins 196, 199

PNGImageReaderSpi class 229

policytool security tool 140

-p option 43, 49, 76, 84

-p option . --module-path option

PowerMock 17

--processor-module-path option 77

--processor-path 77

-profile option 136

Project Jigsaw 4

projects

existing, modularizing 346

lifetime of, effect on benefits of modularization 346

projects, organizing in directory structure 8689

established directory structure 8788

new proposal 86

place for module declarations 8889

protected methods 69

protocol field 369

provide method 221, 241

Provider class 221, 227

provider constructor 220

Provider instance 239

provider method 221

providers, organizing into modules 232233

provides directives 221, 222, 225, 233, 233

Proxy parameter 368

public API, defined 69

public methods 69

public static void main method 23, 100, 104

public visibility 16, 30

publishing modules 189

Q

qualified exports 48, 70, 74, 262268

exporting packages on command line 267268

exporting packages to modules 264266

exposing internal APIs 263263

vs. plain 348

when to use 266267

qualified opens 48

qualifying opens, defined 276

R

rawCompiledVersion() method 308

rawVersion() method 307

readability 60

achieving reliable configuration 6161

experimenting with unreliable configurations 6167

readability edges

defined 60

-recursive 379

refactoring modules

by merging them 255256

with implied readability 251255

reflected module 282

reflection 270, 297

annotations and 370370

exports directives as bad fit for 272275

opening modules 278279

opening packages

for specific modules 276277

to run-time access 275276

vs. exporting packages 277278

over modules 279288

analyzing module properties with reflection 284286

forwarding open packages 287288

modifying module properties with reflection 286287

updating reflecting code for modules 280281

using variable handles instead of reflection 282283

reflection API 367, 368369, 370

Reflection class 146

ReflectionFactory class 146

--release option 98, 98, 137, 211, 388

reliable configuration 4646, 83

reload() method 240

Remote Method Invocation (RMI) 19, 263

Remote Method Invocation Compiler (rmic) 196

removePropertyChangeListener method 147

renaming modules 67

requires directive 39, 40, 49, 53, 55, 70, 71, 74, 83, 92, 176, 181, 203, 207, 207, 217, 219, 221, 244, 245, 246, 248, 256, 308, 308, 314

requires directives 340, 341, 341, 349, 354

requires keyword 53

requires optional directive 342

requires static directive 258, 259, 268, 317

requires static directives 342, 354

requires transitive directive 247, 249, 252, 252, 268, 342, 343, 352, 354

resolveAndBind method 294295

resolve method 294, 295

ResourceBundleProvider 111

resources, loading from modules 107111

before Java 9 107107

on Java 9 and later 108109

package resources across module boundaries 109110

REST endpoint 41

restricted keywords 53

reverse-domain naming scheme 54

RichFaces 15

right-sizing images, with jlink 320322

rigid runtime 18

RMI (Remote Method Invocation) 19263

rmic (Remote Method Invocation Compiler) 196

root modules 81

Root modules, defined 58

rt.jar 134

Runtime.Version type 138, 389

run-time access, opening packages to 275276

run-time errors 71, 142

RuntimeException 280

runtime images 314336

creating self-contained application images 322327

custom, creating 315322

image content and structure 317317

including services in runtime images 318320

right-sizing images with jlink and jdeps 320322

generating images across operating systems 328329

options for jlink 336336

using jlink plugins to optimize images 329336

improving run-time performance 335336

plugins for jlink 329331

reducing image size 331335

run-time representation 11

run-time warnings 25

S

SAX (Simple API for XML) 19, 127

Scaffold Hunter 148

scalable Java platform 2828

security, automated 2828

security checks 17

SecurityManager::checkPackageAccess 17

selectors 373, 375

SensitivityWatchEventModifier class 146

Service actor 227

service binding 225, 242

ServiceConfigurationError 240, 242

ServiceLoader API 237240

ServiceLoader class 170, 176, 217, 221, 225, 227, 229, 230, 234, 235, 240, 240, 241, 242

ServiceMonitor application 9, 24, 24, 33, 33, 38, 46, 49, 61, 72, 79, 91, 92, 104, 119, 158, 171, 208, 221, 226, 254, 288, 294, 295, 325

adding to 340345

decoupled with services 344344

diversified dependencies 342343

handles dependencies on plain JARs 345345

loads code at run time with layers 344345

reduced visibility 343344

bells-and-whistles version 340

cutting into modules 3737

modularizing 3737

overview 33, 36

running 4444

visualizing with module graph 4142

ServiceObserver class 33, 33, 36, 37, 37, 47, 48, 75, 100, 222, 228, 228, 229, 240, 246, 251, 288, 296, 325, 344

ServiceObserverFactory 223, 223, 229, 229, 236, 236, 344

ServiceObserver interface 33, 34, 47, 72

ServiceRegistry 229

services

accessing services with ServiceLoader API 237240

loading and accessing services 238240

adding and removing 354354

designing well 227237

declaring services across different Java versions 235237

isolating consumers from global state 230232

organizing services, consumers, and providers into modules 232233

types that can be services 228228

using factories as services 228229

using services to break cyclic dependencies 233235

in Java Platform Module System (JPMS) 220227

module resolution for services 225227

using, providing, and consuming services 220225

need for 218219

overusing 349

Set 291, 308

setAccessible method 73, 274, 369, 369

set method 369

shadowing

defined 13

--show-module-resolution option 118, 122, 174, 225

Signal class 146

SignalHandler class 146

Simple API for XML (SAX) 19, 127

SimpleStatistician class 66, 66, 158

single module, compiling 8992

SLF4J 46, 200

slow startup 18

-source option 98, 137

spark.core module 43, 323

Spark micro framework 24, 41, 181

split packages 61, 66, 66, 127, 132, 142, 156, 164

effects of 158160

finding with JDeps 163163

patching modules, as way of handling 162163

problem with 157158

unit tests and 157

ways to handle 161162

Spring 18, 27, 61, 70, 71, 84, 200, 244

src.zip 134

standalone JARs 13

standalone technologies 127

standardized classes 144

starter, to spin up additional layers 309310

startup performance 2828

Statistician::compute 40

Statistician class 33, 33, 36, 37, 37, 66

Statistics class 33, 33, 35, 36, 37, 37

StatisticsEntity class 275

statistics JAR 10, 24

statistics module 40, 254, 261

StatisticsRepository class 33, 36, 37, 37, 41

stats.fancy module 257, 342

StAX (Streaming API for XML) 19, 263

stderr value 374

stdout value 374

stream() method 239, 242, 242

Streaming API for XML (StAX) 19, 263

--strip-debug option 331

strip-debug plugin

defined 334

strong encapsulation 27, 27, 46, 47, 47, 84, 109, 143, 199, 361

suggested descriptor 383

--suggest-providers option 319

--suggest-providers option, defined 318

-summary option 380

sun.* packages 20, 25, 142, 143, 144

sun.misc.BASE64Decoder 147

sun.misc.BASE64Encoder 147

sun.misc.Cleaner 147

sun.misc.Service class 147

sun.misc.Unsafe class 17, 146, 146, 146, 146

SuperfastHashMap class 69, 70

Swing 263

system checks 61

system class loader 126, 131, 290

system-modules plugin

defined 58, 324

--system option 137

T

tags option 373, 373

-target option 98, 137

temporary fixes 197

Thread::stop 139

TimeoutException 8

TimeUnit class 8

toExternalForm method 368

tools.jar 134

top-down modularization 200, 200, 202203, 213

transitive dependencies 15, 84, 96, 182186

transitive keyword 206, 254

transitive reduced graph 383

type method 239

type token 238

U

uber.lib 250, 257, 257, 257, 258, 261

uber JAR 13

UML diagrams 5

unified logging

configuring entire logging pipeline 375375

defining what messages should say 374374

defining where messages should go 374374

defining which messages should be shown 373374

overview 371372

use to debug modules 119

unit tests 157

universe of observable modules 76, 84

universe of observable modules, defined 58

unmodularized dependencies 200

unnamed modules 52, 159, 169, 170, 170, 171, 176, 176, 189, 360, 366

defined 59

depending on 174176

module resolution for 173174181, 186

names 178180

unreliable configurations 77

Unsafe class 17, 146, 146

UnsupportedOperationException 139, 197

unzip 179, 179

-u option 209

-u option . --update option

--update option 209, 213

--update option . -u option

updateStatistics() method 35

--upgrade-module-path option 130, 136, 161

URL::openConnection method 368

URL class 367, 369

URLClassLoader class 25, 125, 126, 131131, 131, 134, 134, 140, 193, 193, 213, 233

use directives 220, 221, 225, 227, 234, 237, 242

utils.fancy module 264

Utils class 66

V

validating sets of modules

excluding modules during resolution 115117

listing observable modules and dependencies 113115

validating module graph 112113

var 26

variable handles 282283, 389

Vavr 200

-verbose:class 381

-version:N option 141

version() method 307

version conflicts, defined 15

versions 300313

lack of support for in JPMS 301305

multiple versions 301303

version selection 303305

multiple of module, running in separate layers 309313

recording info about 306309

accessing module versions 307309

while building modules 306307

VisualVM 139

VM (virtual machine) 366

W

WAR file 99

warn option 151

weak circular dependencies 92, 97

weak encapsulation 198

WebKit 335

Web Start 140

WebView class 332, 333

what-expression 375

wildcards 56, 9495, 278, 373

wsgen tool 129, 139

X

-Xbootclasspath/p option 137

-Xbootclasspath option 137, 141

-Xboundthreads 139

xjc tool 129, 139

-Xlog option 119, 371, 372, 374, 375

-Xlog option, defined 371

XMLConstants class 23, 23

-Xoptimize 139

-Xoss 139

-Xprof 140

-Xsqnopause 139

-Xusealtsigs 139

-XX:+IgnoreUnrecognizedVMOptions option 196

Z

ZeroServiceObserverFactory class 236, 236

zip file system 320

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.173.199