org.hibernate.service.classloading.internal
Class ClassLoaderServiceImpl

java.lang.Object
  extended by org.hibernate.service.classloading.internal.ClassLoaderServiceImpl
All Implemented Interfaces:
Serializable, ClassLoaderService, Service, Stoppable

public class ClassLoaderServiceImpl
extends Object
implements ClassLoaderService

Standard implementation of the service for interacting with class loaders

See Also:
Serialized Form

Constructor Summary
ClassLoaderServiceImpl()
           
ClassLoaderServiceImpl(ClassLoader classLoader)
           
ClassLoaderServiceImpl(List<ClassLoader> providedClassLoaders)
           
 
Method Summary
<T> Class<T>
classForName(String className)
          Locate a class by name
static ClassLoaderServiceImpl fromConfigSettings(Map configVales)
          Deprecated. 
<S> LinkedHashSet<S>
loadJavaServices(Class<S> serviceContract)
          Discovers and instantiates implementations of the named service contract.
 URL locateResource(String name)
          Locate a resource by name (classpath lookup)
 List<URL> locateResources(String name)
          Locate a series of resource by name (classpath lookup)
 InputStream locateResourceStream(String name)
          Locate a resource by name (classpath lookup) and gets its stream
 void stop()
          Stop phase notification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassLoaderServiceImpl

public ClassLoaderServiceImpl()

ClassLoaderServiceImpl

public ClassLoaderServiceImpl(ClassLoader classLoader)

ClassLoaderServiceImpl

public ClassLoaderServiceImpl(List<ClassLoader> providedClassLoaders)
Method Detail

fromConfigSettings

@Deprecated
public static ClassLoaderServiceImpl fromConfigSettings(Map configVales)
Deprecated. 


classForName

public <T> Class<T> classForName(String className)
Description copied from interface: ClassLoaderService
Locate a class by name

Specified by:
classForName in interface ClassLoaderService
Parameters:
className - The name of the class to locate
Returns:
The class reference

locateResource

public URL locateResource(String name)
Description copied from interface: ClassLoaderService
Locate a resource by name (classpath lookup)

Specified by:
locateResource in interface ClassLoaderService
Parameters:
name - The resource name.
Returns:
The located URL; may return null to indicate the resource was not found

locateResourceStream

public InputStream locateResourceStream(String name)
Description copied from interface: ClassLoaderService
Locate a resource by name (classpath lookup) and gets its stream

Specified by:
locateResourceStream in interface ClassLoaderService
Parameters:
name - The resource name.
Returns:
The stream of the located resource; may return null to indicate the resource was not found

locateResources

public List<URL> locateResources(String name)
Description copied from interface: ClassLoaderService
Locate a series of resource by name (classpath lookup)

Specified by:
locateResources in interface ClassLoaderService
Parameters:
name - The resource name.
Returns:
The list of URL matching; may return null to indicate the resource was not found

loadJavaServices

public <S> LinkedHashSet<S> loadJavaServices(Class<S> serviceContract)
Description copied from interface: ClassLoaderService
Discovers and instantiates implementations of the named service contract.

NOTE : the terms service here is used differently than Service. Instead here we are talking about services as defined by ServiceLoader.

Specified by:
loadJavaServices in interface ClassLoaderService
Type Parameters:
S - The type of the service contract
Parameters:
serviceContract - The java type defining the service contract
Returns:
The ordered set of discovered services.

stop

public void stop()
Description copied from interface: Stoppable
Stop phase notification

Specified by:
stop in interface Stoppable


Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.