Example usage for org.springframework.beans.factory.config AutowireCapableBeanFactory getBean

List of usage examples for org.springframework.beans.factory.config AutowireCapableBeanFactory getBean

Introduction

In this page you can find the example usage for org.springframework.beans.factory.config AutowireCapableBeanFactory getBean.

Prototype

Object getBean(String name) throws BeansException;

Source Link

Document

Return an instance, which may be shared or independent, of the specified bean.

Usage

From source file:nc.noumea.mairie.organigramme.core.authentification.AuthentificationFilter.java

public void init(FilterConfig config) throws ServletException {
    ServletContext servletContext = config.getServletContext();
    WebApplicationContext webApplicationContext = WebApplicationContextUtils
            .getWebApplicationContext(servletContext);

    AutowireCapableBeanFactory autowireCapableBeanFactory = webApplicationContext
            .getAutowireCapableBeanFactory();

    radiWSConsumer = (IRadiWSConsumer) autowireCapableBeanFactory.getBean("radiWSConsumer");
    sirhWSConsumer = (ISirhWSConsumer) autowireCapableBeanFactory.getBean("sirhWSConsumer");
}