org.kuali.hr.sys.context
Class SpringContext

java.lang.Object
  extended by org.kuali.hr.sys.context.SpringContext
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public class SpringContext
extends Object
implements org.springframework.context.ApplicationContextAware

helper class for spring beans stuff Copied over from SpringContext.java from the LeaveManager Project


Constructor Summary
SpringContext()
          public constructor that throws exception if you try to instantiate it twice
 
Method Summary
static
<T> T
getBean(Class<T> clazz)
          returns a spring bean by its class...
static Object getBean(SpringBeans bean)
          return a spring bean by its name
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringContext

public SpringContext()
              throws Exception
public constructor that throws exception if you try to instantiate it twice

Throws:
Exception
Method Detail

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

getBean

public static Object getBean(SpringBeans bean)
return a spring bean by its name

Parameters:
beanName -
Returns:

getBean

public static <T> T getBean(Class<T> clazz)
returns a spring bean by its class... this only works when the class name equals the spring bean name

Parameters:
clazz -
Returns:


Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.