com.encoway.edu.spring.EventDrivenUpdatesContextFactoryBean Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of edu-it Show documentation
Show all versions of edu-it Show documentation
Shared integration test definitions
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