HHH-8363 cleanup and formatting
This commit is contained in:
parent
5011b4a30e
commit
3fdffcbcd4
|
@ -52,8 +52,9 @@ import org.jboss.logging.Logger;
|
||||||
public class ClassLoaderServiceImpl implements ClassLoaderService {
|
public class ClassLoaderServiceImpl implements ClassLoaderService {
|
||||||
private static final Logger log = Logger.getLogger( ClassLoaderServiceImpl.class );
|
private static final Logger log = Logger.getLogger( ClassLoaderServiceImpl.class );
|
||||||
|
|
||||||
private final ClassLoader aggregatedClassLoader;
|
private final AggregatedClassLoader aggregatedClassLoader;
|
||||||
private final LinkedList<ServiceLoader> loaders = new LinkedList<ServiceLoader>();
|
|
||||||
|
private final LinkedList<ServiceLoader> serviceLoaders = new LinkedList<ServiceLoader>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a ClassLoaderServiceImpl with standard set-up
|
* Constructs a ClassLoaderServiceImpl with standard set-up
|
||||||
|
@ -320,21 +321,21 @@ public class ClassLoaderServiceImpl implements ClassLoaderService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <S> LinkedHashSet<S> loadJavaServices(Class<S> serviceContract) {
|
public <S> LinkedHashSet<S> loadJavaServices(Class<S> serviceContract) {
|
||||||
ServiceLoader<S> serviceLoader = ServiceLoader.load( serviceContract, aggregatedClassLoader );
|
ServiceLoader<S> serviceLoader = ServiceLoader.load( serviceContract, aggregatedClassLoader );
|
||||||
final LinkedHashSet<S> services = new LinkedHashSet<S>();
|
final LinkedHashSet<S> services = new LinkedHashSet<S>();
|
||||||
for ( S service : serviceLoader) {
|
for ( S service : serviceLoader ) {
|
||||||
services.add( service );
|
services.add( service );
|
||||||
}
|
}
|
||||||
loaders.add(serviceLoader);
|
serviceLoaders.add( serviceLoader );
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
while (!loaders.isEmpty()){
|
while ( !serviceLoaders.isEmpty() ) {
|
||||||
ServiceLoader loader = loaders.removeLast();
|
ServiceLoader loader = serviceLoaders.removeLast();
|
||||||
loader.reload();//clear service loader providers
|
loader.reload(); // clear service loader providers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
Loading…
Reference in New Issue