Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 11 java.base.jmod - Base Module
JDK 11 java.base.jmod is the JMOD file for JDK 11 Base module.
JDK 11 Base module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\java.base.jmod.
JDK 11 Base module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Base module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\java.base.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/internal/module/ServicesCatalog.java
/* * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.internal.module; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleDescriptor.Provides; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; import jdk.internal.loader.ClassLoaderValue; /** * A <em>services catalog</em>. Each {@code ClassLoader} and {@code Layer} has * an optional {@code ServicesCatalog} for modules that provide services. * * @apiNote This class will be replaced once the ServiceLoader is further * specified */ public final class ServicesCatalog { /** * Represents a service provider in the services catalog. */ public final class ServiceProvider { private final Module module; private final String providerName; public ServiceProvider(Module module, String providerName) { this.module = module; this.providerName = providerName; } public Module module() { return module; } public String providerName() { return providerName; } @Override public int hashCode() { return Objects.hash(module, providerName); } @Override public boolean equals(Object ob) { if (!(ob instanceof ServiceProvider)) return false; ServiceProvider that = (ServiceProvider)ob; return Objects.equals(this.module, that.module) && Objects.equals(this.providerName, that.providerName); } } // service name -> list of providers private final Map<String, List<ServiceProvider>> map = new ConcurrentHashMap<>(); private ServicesCatalog() { } /** * Creates a ServicesCatalog that supports concurrent registration and * and lookup */ public static ServicesCatalog create() { return new ServicesCatalog(); } /** * Returns the list of service provides for the given service type * name, creating it if needed. */ private List<ServiceProvider> providers(String service) { // avoid computeIfAbsent here List<ServiceProvider> list = map.get(service); if (list == null) { list = new CopyOnWriteArrayList<>(); List<ServiceProvider> prev = map.putIfAbsent(service, list); if (prev != null) list = prev; // someone else got there } return list; } /** * Registers the providers in the given module in this services catalog. */ public void register(Module module) { ModuleDescriptor descriptor = module.getDescriptor(); for (Provides provides : descriptor.provides()) { String service = provides.service(); List<String> providerNames = provides.providers(); int count = providerNames.size(); if (count == 1) { String pn = providerNames.get(0); providers(service).add(new ServiceProvider(module, pn)); } else { List<ServiceProvider> list = new ArrayList<>(count); for (String pn : providerNames) { list.add(new ServiceProvider(module, pn)); } providers(service).addAll(list); } } } /** * Add a provider in the given module to this services catalog * * @apiNote This method is for use by java.lang.instrument */ public void addProvider(Module module, Class<?> service, Class<?> impl) { List<ServiceProvider> list = providers(service.getName()); list.add(new ServiceProvider(module, impl.getName())); } /** * Returns the (possibly empty) list of service providers that implement * the given service type. */ public List<ServiceProvider> findServices(String service) { return map.getOrDefault(service, Collections.emptyList()); } /** * Returns the ServicesCatalog for the given class loader or {@code null} * if there is none. */ public static ServicesCatalog getServicesCatalogOrNull(ClassLoader loader) { return CLV.get(loader); } /** * Returns the ServicesCatalog for the given class loader, creating it if * needed. */ public static ServicesCatalog getServicesCatalog(ClassLoader loader) { // CLV.computeIfAbsent(loader, (cl, clv) -> create()); ServicesCatalog catalog = CLV.get(loader); if (catalog == null) { catalog = create(); ServicesCatalog previous = CLV.putIfAbsent(loader, catalog); if (previous != null) catalog = previous; } return catalog; } // the ServicesCatalog registered to a class loader private static final ClassLoaderValue<ServicesCatalog> CLV = new ClassLoaderValue<>(); }
⏎ jdk/internal/module/ServicesCatalog.java
Or download all of them as a single archive file:
File name: java.base-11.0.1-src.zip File size: 8740354 bytes Release date: 2018-11-04 Download
2020-05-29, 207530👍, 0💬
Popular Posts:
xml-commons Resolver Source Code Files are provided in the source package file, xml-commons-resolver...
Provides a simple high-level Http server API, which can be used to build embedded HTTP servers. Both...
JDK 11 jdk.internal.le.jmod is the JMOD file for JDK 11 Internal Line Editing module. JDK 11 Interna...
JAX-WS is an API for building web services and clients. It is the next generation Web Services API r...
How to download and install JDK (Java Development Kit) 1.4? If you want to write Java applications, ...