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 {
|
||||
private static final Logger log = Logger.getLogger( ClassLoaderServiceImpl.class );
|
||||
|
||||
private final ClassLoader aggregatedClassLoader;
|
||||
private final LinkedList<ServiceLoader> loaders = new LinkedList<ServiceLoader>();
|
||||
private final AggregatedClassLoader aggregatedClassLoader;
|
||||
|
||||
private final LinkedList<ServiceLoader> serviceLoaders = new LinkedList<ServiceLoader>();
|
||||
|
||||
/**
|
||||
* Constructs a ClassLoaderServiceImpl with standard set-up
|
||||
|
@ -322,18 +323,18 @@ public class ClassLoaderServiceImpl implements ClassLoaderService {
|
|||
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) {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue