All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.encoway.edu.spring.EventDrivenUpdatesContextFactoryBean Maven / Gradle / Ivy

There is a newer version: 2.3.1
Show newest version
package com.encoway.edu.spring;

import com.encoway.edu.EventDrivenUpdatesContext;

import javax.el.ELContext;
import javax.faces.context.FacesContext;

import org.springframework.beans.factory.FactoryBean;

/**
 * {@link FactoryBean} for {@link EventDrivenUpdatesContext}.
 * Expects a JSF managed bean named {@link #setManagedBeanName(String)}.
 */
public class EventDrivenUpdatesContextFactoryBean implements FactoryBean {

    private String managedBeanName = "eduContext";

    public void setManagedBeanName(String managedBeanName) {
        this.managedBeanName = managedBeanName;
    }

    @Override
    public EventDrivenUpdatesContext getObject() throws Exception {
        ELContext elContext = FacesContext.getCurrentInstance().getELContext();
        return (EventDrivenUpdatesContext) elContext.getELResolver().getValue(elContext, null, managedBeanName);
    }

    @Override
    public Class getObjectType() {
        return EventDrivenUpdatesContext.class;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy