com.hs.mail.container.config
Class ComponentManager

java.lang.Object
  extended by com.hs.mail.container.config.ComponentManager
All Implemented Interfaces:
org.springframework.context.ApplicationContextAware

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

This class provides an application-wide access to the Spring ApplicationContext!

Since:
Feb 3, 2010
Author:
Won Chul Doh

Constructor Summary
ComponentManager()
           
 
Method Summary
static Object getBean(String beanName)
          This is about the same as context.getBean("beanName"), except it has its own static handle to the Spring context, so calling this method statically will give access to the beans by name in the Spring application context.
static Object getBeanOfType(Class type)
           
 void setApplicationContext(org.springframework.context.ApplicationContext appContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentManager

public ComponentManager()
Method Detail

setApplicationContext

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

getBean

public static Object getBean(String beanName)
                      throws org.springframework.beans.BeansException
This is about the same as context.getBean("beanName"), except it has its own static handle to the Spring context, so calling this method statically will give access to the beans by name in the Spring application context. As in the context.getBean("beanName") call, the caller must cast to the appropriate target class. If the bean does not exist, then a Runtime error will be thrown.

Parameters:
beanName - the name of the bean to get.
Returns:
an Object reference to the named bean.
Throws:
org.springframework.beans.BeansException

getBeanOfType

public static Object getBeanOfType(Class type)
                            throws org.springframework.beans.BeansException
Throws:
org.springframework.beans.BeansException


Copyright © 2011. All Rights Reserved.