ClassLoader and Layer has
an optional ServicesCatalog for modules that provide services.
API Note
This class will be replaced once the ServiceLoader is further specified
| Modifier and Type | Class and Description |
|---|---|
| public static class | ServicesCatalog.
Represents a service provider in the services catalog. |
| Modifier and Type | Field and Description |
|---|---|
| private static final ClassLoaderValue | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | addProvider(Module module, Class<?> service, Class<?> impl)
Adds a provider in the given module to this services catalog. |
| private void | addProviders(String service, ServicesCatalog.
Adds service providers for the given service type. |
| public static ServicesCatalog | |
| public List | findServices(String service)
Returns the (possibly empty) list of service providers that implement the given service type. |
| public static ServicesCatalog | getServicesCatalog(ClassLoader loader)
Returns the ServicesCatalog for the given class loader, creating it if needed. |
| public static ServicesCatalog | getServicesCatalogOrNull(ClassLoader loader)
Returns the ServicesCatalog for the given class loader or |
| public static void | putServicesCatalog(ClassLoader loader, ServicesCatalog catalog)
Associates the given ServicesCatalog with the given class loader. |
| public void |
| CLV | back to summary |
|---|---|
| private static final ClassLoaderValue<ServicesCatalog> CLV | |
| map | back to summary |
|---|---|
| private final Map<String, List<ServicesCatalog. | |
| ServicesCatalog | back to summary |
|---|---|
| private ServicesCatalog() | |
| addProvider | back to summary |
|---|---|
| public void addProvider(Module module, Class<?> service, Class<?> impl) Adds a provider in the given module to this services catalog. API Note This method is for use by java.lang.instrument | |
| addProviders | back to summary |
|---|---|
| private void addProviders(String service, ServicesCatalog. Adds service providers for the given service type. | |
| create | back to summary |
|---|---|
| public static ServicesCatalog create() Creates a ServicesCatalog that supports concurrent registration and lookup | |
| findServices | back to summary |
|---|---|
| public List Returns the (possibly empty) list of service providers that implement the given service type. | |
| getServicesCatalog | back to summary |
|---|---|
| public static ServicesCatalog getServicesCatalog(ClassLoader loader) Returns the ServicesCatalog for the given class loader, creating it if needed. | |
| getServicesCatalogOrNull | back to summary |
|---|---|
| public static ServicesCatalog getServicesCatalogOrNull(ClassLoader loader) Returns the ServicesCatalog for the given class loader or | |
| putServicesCatalog | back to summary |
|---|---|
| public static void putServicesCatalog(ClassLoader loader, ServicesCatalog catalog) Associates the given ServicesCatalog with the given class loader. | |
| register | back to summary |
|---|---|
| public void register(Module module) Registers the providers in the given module in this services catalog. | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object ob)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public int | |
| public Module | |
| public String |
| module | back to summary |
|---|---|
| private final Module module | |
| providerName | back to summary |
|---|---|
| private final String providerName | |
| ServiceProvider | back to summary |
|---|---|
| public ServiceProvider(Module module, String providerName) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object ob) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| module | back to summary |
|---|---|
| public Module module() | |
| providerName | back to summary |
|---|---|
| public String providerName() | |