org.jboss.arquillian.core.impl.loadable
Class ServiceRegistryLoader

java.lang.Object
  extended by org.jboss.arquillian.core.impl.loadable.ServiceRegistryLoader
All Implemented Interfaces:
ServiceLoader

public class ServiceRegistryLoader
extends Object
implements ServiceLoader

MixedServiceLoader

Version:
$Revision: $
Author:
Aslak Knutsen

Constructor Summary
ServiceRegistryLoader(Injector injector, ServiceRegistry registry)
           
 
Method Summary
<T> Collection<T>
all(Class<T> serviceClass)
          Load multiple service implementations.
<T> T
onlyOne(Class<T> serviceClass)
          Load a single service implementation.
<T> T
onlyOne(Class<T> serviceClass, Class<? extends T> defaultServiceClass)
          Load a single service implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceRegistryLoader

public ServiceRegistryLoader(Injector injector,
                             ServiceRegistry registry)
Method Detail

all

public <T> Collection<T> all(Class<T> serviceClass)
Description copied from interface: ServiceLoader
Load multiple service implementations.

Specified by:
all in interface ServiceLoader
Parameters:
serviceClass - The service interface to load a implementations for
Returns:
A Collection of all instances of serviceClass

onlyOne

public <T> T onlyOne(Class<T> serviceClass)
Description copied from interface: ServiceLoader
Load a single service implementation. Method should throw IllegalStateException if multiple instances of serviceClass found.

Specified by:
onlyOne in interface ServiceLoader
Parameters:
serviceClass - The service interface to load a implementation for
Returns:
A instance of serviceClass

onlyOne

public <T> T onlyOne(Class<T> serviceClass,
                     Class<? extends T> defaultServiceClass)
Description copied from interface: ServiceLoader
Load a single service implementation. Method should returns a new instance of defaultServiceClass if no other instance is found.

Specified by:
onlyOne in interface ServiceLoader
Parameters:
serviceClass - The service interface to load a implementation for
defaultServiceClass - If no other implementations found, create a instance of this class
Returns:
A instance of serviceClass


Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.