HHH-8363 cleanup and formatting
Conflicts: hibernate-core/src/main/java/org/hibernate/boot/registry/classloading/internal/ClassLoaderServiceImpl.java
This commit is contained in:
parent
b09466f1db
commit
db6841e5b4
|
@ -53,7 +53,8 @@ public class ClassLoaderServiceImpl implements ClassLoaderService {
|
|||
private static final Logger log = Logger.getLogger( ClassLoaderServiceImpl.class );
|
||||
|
||||
private final ClassLoader aggregatedClassLoader;
|
||||
private final LinkedList<ServiceLoader> loaders = new LinkedList<ServiceLoader>();
|
||||
|
||||
private final LinkedList<ServiceLoader> serviceLoaders = new LinkedList<ServiceLoader>();
|
||||
|
||||
public ClassLoaderServiceImpl() {
|
||||
this( ClassLoaderServiceImpl.class.getClassLoader() );
|
||||
|
@ -234,20 +235,20 @@ public class ClassLoaderServiceImpl implements ClassLoaderService {
|
|||
@Override
|
||||
public <S> LinkedHashSet<S> loadJavaServices(Class<S> serviceContract) {
|
||||
ServiceLoader<S> serviceLoader = ServiceLoader.load( serviceContract, aggregatedClassLoader );
|
||||
final LinkedHashSet<S> services = new LinkedHashSet<S>();
|
||||
for ( S service : serviceLoader) {
|
||||
final LinkedHashSet<S> services = new LinkedHashSet<S>();
|
||||
for ( S service : serviceLoader ) {
|
||||
services.add( service );
|
||||
}
|
||||
loaders.add(serviceLoader);
|
||||
serviceLoaders.add( serviceLoader );
|
||||
return services;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
while (!loaders.isEmpty()){
|
||||
ServiceLoader loader = loaders.removeLast();
|
||||
loader.reload();//clear service loader providers
|
||||
}
|
||||
while ( !serviceLoaders.isEmpty() ) {
|
||||
ServiceLoader loader = serviceLoaders.removeLast();
|
||||
loader.reload(); // clear service loader providers
|
||||
}
|
||||
}
|
||||
|
||||
private static class AggregatedClassLoader extends ClassLoader {
|
||||
|
|
Loading…
Reference in New Issue