org.kuali.kfs.sys.context
Class SpringContext
java.lang.Object
org.kuali.kfs.sys.context.SpringContext
- Direct Known Subclasses:
- SpringContextForWorkflowImporter
public class SpringContext
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
protected static final org.apache.log4j.Logger LOG
APPLICATION_CONTEXT_DEFINITION
protected static final String APPLICATION_CONTEXT_DEFINITION
- See Also:
- Constant Field Values
TEST_CONTEXT_DEFINITION
protected static final String TEST_CONTEXT_DEFINITION
- See Also:
- Constant Field Values
MEMORY_MONITOR_THRESHOLD_KEY
protected static final String MEMORY_MONITOR_THRESHOLD_KEY
- See Also:
- Constant Field Values
USE_QUARTZ_SCHEDULING_KEY
protected static final String USE_QUARTZ_SCHEDULING_KEY
- See Also:
- Constant Field Values
applicationContext
protected static org.springframework.context.ConfigurableApplicationContext applicationContext
SINGLETON_TYPES
protected static Set<Class<? extends Object>> SINGLETON_TYPES
SINGLETON_BEANS_BY_TYPE_CACHE
protected static Map<Class<? extends Object>,Object> SINGLETON_BEANS_BY_TYPE_CACHE
SINGLETON_BEANS_BY_NAME_CACHE
protected static Map<String,Object> SINGLETON_BEANS_BY_NAME_CACHE
SINGLETON_BEANS_OF_TYPE_CACHE
protected static Map<Class<? extends Object>,Map> SINGLETON_BEANS_OF_TYPE_CACHE
processWatchThread
protected static Thread processWatchThread
SpringContext
public SpringContext()
getService
public static Object getService(String serviceName)
- Use this method to retrieve a service which may or may not be implemented locally. (That is,
defined in the main Spring ApplicationContext created by Rice.
getBean
public static <T> T getBean(Class<T> type)
- Use this method to retrieve a spring bean when one of the following is the case. Pass in the type of the service interface,
NOT the service implementation. 1. there is only one bean of the specified type in our spring context 2. there is only one
bean of the specified type in our spring context, but you want the one whose bean id is the same as type.getSimpleName() with
the exception of the first letter being lower case in the former and upper case in the latter, For example, there are two
beans of type DateTimeService in our context � dateTimeService and testDateTimeService. To retrieve the former, you should
specific DateTimeService.class as the type. To retrieve the latter, you should specify ConfigurableDateService.class as the
type. Unless you are writing a unit test and need to down cast to an implementation, you do not need to cast the result of
this method.
- Type Parameters:
T
- - Parameters:
type
-
- Returns:
- an object that has been defined as a bean in our spring context and is of the specified type
getBeansOfType
public static <T> Map<String,T> getBeansOfType(Class<T> type)
- Use this method to retrieve all beans of a give type in our spring context. Pass in the type of the service interface, NOT
the service implementation.
- Type Parameters:
T
- - Parameters:
type
-
- Returns:
- a map of the spring bean ids / beans that are of the specified type
getBean
public static <T> T getBean(Class<T> type,
String name)
getMethodCacheInterceptors
public static List<org.kuali.rice.kns.util.cache.MethodCacheInterceptor> getMethodCacheInterceptors()
getBean
protected static Object getBean(String beanName)
getBeanNames
protected static String[] getBeanNames()
initializeApplicationContext
protected static void initializeApplicationContext()
initializeApplicationContextWithoutSchedule
protected static void initializeApplicationContextWithoutSchedule()
initializeBatchApplicationContext
protected static void initializeBatchApplicationContext()
initializeTestApplicationContext
protected static void initializeTestApplicationContext()
close
protected static void close()
throws Exception
- Throws:
Exception
Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.