PersistenceProviderResolver instance.
If no PersistenceProviderResolver is set by the environment,
the default PersistenceProviderResolver is used.
Enable "jakarta.persistence.spi" logger to show diagnostic
information.
Implementations must be thread-safe.
| Modifier and Type | Class and Description |
|---|---|
| private static class | PersistenceProviderResolverHolder.
Default provider resolver class to use when none is explicitly set. |
| Modifier and Type | Field and Description |
|---|---|
| private static PersistenceProviderResolver |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static PersistenceProviderResolver | Returns: the current persistence provider resolverReturns the current persistence provider resolver. |
| public static void | setPersistenceProviderResolver(PersistenceProviderResolver
persistence provider resolver to be used. resolver)Defines the persistence provider resolver used. |
| singleton | back to summary |
|---|---|
| private static PersistenceProviderResolver singleton | |
| PersistenceProviderResolverHolder | back to summary |
|---|---|
| public PersistenceProviderResolverHolder() | |
| getPersistenceProviderResolver | back to summary |
|---|---|
| public static PersistenceProviderResolver getPersistenceProviderResolver() Returns the current persistence provider resolver.
| |
| setPersistenceProviderResolver | back to summary |
|---|---|
| public static void setPersistenceProviderResolver(PersistenceProviderResolver resolver) Defines the persistence provider resolver used.
| |
Uses service loading mechanism as described in the Jakarta Persistence specification. A ServiceLoader.load() call is made with the current context classloader to find the service provider files on the classpath.
| Modifier and Type | Class and Description |
|---|---|
| private class | PersistenceProviderResolverHolder.
Key used for cached persistence providers. |
| private static interface | PersistenceProviderResolverHolder.
The common interface to get a CacheKey implemented by LoaderReference and PersistenceProviderReference. |
| private class | PersistenceProviderResolverHolder.
References to class loaders are weak references, so that they can be garbage collected when nobody else is using them. |
| private class | PersistenceProviderResolverHolder.
References to persistence provider are soft references so that they can be garbage collected when they have no hard references. |
| Modifier and Type | Field and Description |
|---|---|
| private Logger | |
| private static final String | |
| private volatile HashMap | providers
Cached list of available providers cached by CacheKey to ensure there is not potential for provider visibility issues. |
| private static final ReferenceQueue | referenceQueue
Queue for reference objects referring to class loaders or persistence providers. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | clearCachedProviders()
Implements jakarta. Clear all cached providers |
| private static ClassLoader | getContextClassLoader()
Wraps |
| public List | getPersistenceProviders()
Implements jakarta. Returns a list of the persistence provider implementations available in the runtime environment. |
| private void | |
| private void |
| logger | back to summary |
|---|---|
| private Logger logger | |
| LOGGER_SUBSYSTEM | back to summary |
|---|---|
| private static final String LOGGER_SUBSYSTEM | |
| providers | back to summary |
|---|---|
| private volatile HashMap<PersistenceProviderResolverHolder. Cached list of available providers cached by CacheKey to ensure there is not potential for provider visibility issues. | |
| referenceQueue | back to summary |
|---|---|
| private static final ReferenceQueue<T> referenceQueue Queue for reference objects referring to class loaders or persistence providers. | |
| DefaultPersistenceProviderResolver | back to summary |
|---|---|
| private DefaultPersistenceProviderResolver() | |
| clearCachedProviders | back to summary |
|---|---|
| public void clearCachedProviders() Implements jakarta. Clear all cached providers | |
| getContextClassLoader | back to summary |
|---|---|
| private static ClassLoader getContextClassLoader() Wraps | |
| getPersistenceProviders | back to summary |
|---|---|
| public List Implements jakarta. Doc from jakarta. Returns a list of the persistence provider implementations available in the runtime environment.
| |
| log | back to summary |
|---|---|
| private void log(Level level, String message) | |
| processQueue | back to summary |
|---|---|
| private void processQueue() Remove garbage collected cache keys & providers. | |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private PersistenceProviderResolverHolder. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public Object | |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Indicates whether some other object is "equal to" this one. |
| pack-priv ClassLoader | |
| public int | |
| public String |
| hashCodeCache | back to summary |
|---|---|
| private int hashCodeCache | |
| loaderRef | back to summary |
|---|---|
| private PersistenceProviderResolverHolder. | |
| CacheKey | back to summary |
|---|---|
| pack-priv CacheKey(ClassLoader loader) | |
| calculateHashCode | back to summary |
|---|---|
| private void calculateHashCode() | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) 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.
| |
| getLoader | back to summary |
|---|---|
| pack-priv ClassLoader getLoader() | |
| 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
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| Modifier and Type | Method and Description |
|---|---|
| public PersistenceProviderResolverHolder. |
| getCacheKey | back to summary |
|---|---|
| public PersistenceProviderResolverHolder. | |
| Modifier and Type | Field and Description |
|---|---|
| private PersistenceProviderResolverHolder. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public PersistenceProviderResolverHolder. |
| cacheKey | back to summary |
|---|---|
| private PersistenceProviderResolverHolder. | |
| LoaderReference | back to summary |
|---|---|
pack-priv LoaderReference(ClassLoader referent, ReferenceQueue<T> q, PersistenceProviderResolverHolder.
| |
| getCacheKey | back to summary |
|---|---|
| public PersistenceProviderResolverHolder. | |
| Modifier and Type | Field and Description |
|---|---|
| private PersistenceProviderResolverHolder. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public PersistenceProviderResolverHolder. |
| cacheKey | back to summary |
|---|---|
| private PersistenceProviderResolverHolder. | |
| PersistenceProviderReference | back to summary |
|---|---|
pack-priv PersistenceProviderReference(List<PersistenceProvider> referent, ReferenceQueue<T> q, PersistenceProviderResolverHolder.
| |
| getCacheKey | back to summary |
|---|---|
| public PersistenceProviderResolverHolder. | |