public interface ServiceContext
| Modifier and Type | Method and Description |
|---|---|
<T> T |
create(Class<T> serviceType)
Factory method to create a type, hereby a new instance is created on each access.
|
URL |
getResource(String resource,
ClassLoader cl)
Loads a resource from the current runtime context.
|
Enumeration<URL> |
getResources(String resource,
ClassLoader cl)
Loads resources from the current runtime context.
|
<T> T |
getService(Class<T> serviceType)
Access a service singleton via its type.
|
<T> List<T> |
getServices(Class<T> serviceType)
Access a list current services, given its type.
|
int |
ordinal() |
int ordinal()
<T> T getService(Class<T> serviceType)
Priority will be used.T - the type of the service type.serviceType - the service type.nullConfigException - if there are multiple service implementations with the maximum priority.<T> T create(Class<T> serviceType)
Priority will be used as the base
for creating subsequent instances.T - the type of the service type.serviceType - the service type.nullConfigException - if there are multiple service implementations with the maximum priority.<T> List<T> getServices(Class<T> serviceType)
T - the type of the list element returned by this methodserviceType - the service type.nullEnumeration<URL> getResources(String resource, ClassLoader cl) throws IOException
resource - the resource, not null.cl - the desired classloader context, if null, the current thread context classloader is used.IOExceptionURL getResource(String resource, ClassLoader cl)
resource - the resource, not null.cl - the desired classloader context, if null, the current thread context classloader is used.null.IOExceptionCopyright © 2014–2017 Apache Software Foundation. All rights reserved.