Top Description Inners Methods
org.hibernate.boot.registry.classloading.spi

public Interface ClassLoaderService

extends ResourceLocator, ResourceStreamLocator, Service, Stoppable
Known Direct Implementers
org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl
Imports
java.io.InputStream, java.lang.reflect.InvocationHandler, java.net.URL, java.util.Collection, .List, org.hibernate.boot.ResourceLocator, .ResourceStreamLocator, org.hibernate.service.Service, org.hibernate.service.spi.Stoppable

A service for interacting with class loaders.
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Method Summary

Modifier and TypeMethod and Description
public <
The returned class type.
T
>
Class<T>

Returns:

The class reference
classForName
(String
The name of the class to locate
className
)

Locate a class by name.

public default <T> Class<T>
public <T> T
generateProxy(InvocationHandler handler, Class<T>... interfaces)

public <
The type of the service contract
S
>
Collection<S>

Returns:

The ordered set of discovered services.
loadJavaServices
(Class<S>
The java type defining the service contract
serviceContract
)

Discovers and instantiates implementations of the named service contract.

public URL

Returns:

The located URL; may return null to indicate the resource was not found
locateResource
(String
The resource name.
name
)

Redeclares org.hibernate.boot.ResourceLocator.locateResource.

Locate a resource by name (classpath lookup).
public List<URL>

Returns:

The list of URL matching; may return null to indicate the resource was not found
locateResources
(String
The resource name.
name
)

Locate a series of resource by name (classpath lookup).

public InputStream

Returns:

The stream of the located resource; may return null to indicate the resource was not found
locateResourceStream
(String
The resource name.
name
)

Redeclares org.hibernate.boot.ResourceStreamLocator.locateResourceStream.

Locate a resource by name (classpath lookup) and gets its stream.
public Package

Returns:

The Package. null if no such Package is found, or if the ClassLoader call leads to an exception (LinkageError, e.g.).
packageForNameOrNull
(String packageName)

Loading a Package from the ClassLoader.

public <T> T
Inherited from org.hibernate.service.spi.Stoppable:
stop

Method Detail

classForNameback to summary
public <T> Class<T> classForName(String className)

Locate a class by name.

Parameters
<T>
The returned class type.
className:String

The name of the class to locate

Returns:Class<T>

The class reference

Exceptions
ClassLoadingException:
Indicates the class could not be found
classForTypeNameback to summary
public default <T> Class<T> classForTypeName(String className)
Annotations
@SuppressWarnings:unchecked
generateProxyback to summary
public <T> T generateProxy(InvocationHandler handler, Class<T>... interfaces)
loadJavaServicesback to summary
public <S> Collection<S> loadJavaServices(Class<S> serviceContract)

Discovers and instantiates implementations of the named service contract.

API Note

The term "service" here does not refer to a Service. Here it refers to a Java java.util.ServiceLoader.

Parameters
<S>
The type of the service contract
serviceContract:Class<S>

The java type defining the service contract

Returns:Collection<S>

The ordered set of discovered services.

See Also
org.hibernate.service.JavaServiceLoadable
locateResourceback to summary
public URL locateResource(String name)

Redeclares org.hibernate.boot.ResourceLocator.locateResource.

Locate a resource by name (classpath lookup).

Parameters
name:String

The resource name.

Returns:URL

The located URL; may return null to indicate the resource was not found

locateResourcesback to summary
public List<URL> locateResources(String name)

Locate a series of resource by name (classpath lookup).

Parameters
name:String

The resource name.

Returns:List<URL>

The list of URL matching; may return null to indicate the resource was not found

locateResourceStreamback to summary
public InputStream locateResourceStream(String name)

Redeclares org.hibernate.boot.ResourceStreamLocator.locateResourceStream.

Locate a resource by name (classpath lookup) and gets its stream.

Parameters
name:String

The resource name.

Returns:InputStream

The stream of the located resource; may return null to indicate the resource was not found

packageForNameOrNullback to summary
public Package packageForNameOrNull(String packageName)

Loading a Package from the ClassLoader.

Returns:Package

The Package. null if no such Package is found, or if the ClassLoader call leads to an exception (LinkageError, e.g.).

workWithClassLoaderback to summary
public <T> T workWithClassLoader(ClassLoaderService.Work<T> work)
org.hibernate.boot.registry.classloading.spi back to summary

public Interface ClassLoaderService.Work<T>


Method Summary

Modifier and TypeMethod and Description
public T
doWork(ClassLoader classLoader)

Method Detail

doWorkback to summary
public T doWork(ClassLoader classLoader)