public final class KraServiceLocator extends Object
| Modifier and Type | Method and Description |
|---|---|
static org.springframework.context.ApplicationContext |
getAppContext()
Gets the appContext attribute.
|
static <T> T |
getService(Class<T> serviceClass)
Uses the service interface to find the first service that matches it by name as a default service.
|
static <T> T |
getService(String serviceName)
Lookups a service by name.
|
static void |
setAppContext(org.springframework.context.ApplicationContext appContext)
Sets the appContext attribute value.
|
public static void setAppContext(org.springframework.context.ApplicationContext appContext)
appContext - The appContext to set.public static org.springframework.context.ApplicationContext getAppContext()
public static <T> T getService(String serviceName)
T - the type of service you want.serviceName - name of the Interface class of the service you wantIllegalArgumentException - if the service name is blank.public static <T> T getService(Class<T> serviceClass)
Uses the service interface to find the first service that matches it by name as a default service. There may be many services for a given interface. Only use this method if you are interested in finding a service that matches the convention described.
The service name and the service interface name are the same when converted to lowercase. Again, this method should only be used in the special case where this convention applies. On KRA, this is usually the case.
T - the type of service you want.serviceClass - Interface class of the service you wantIllegalArgumentException - if the service class is null.Copyright © 2013 The Kuali Foundation. All Rights Reserved.