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

com.github.jhonyscamacho.cdi.ViewContextExtension Maven / Gradle / Ivy

package com.github.jhonyscamacho.cdi;

import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.enterprise.inject.spi.BeforeBeanDiscovery;
import javax.enterprise.inject.spi.Extension;
import javax.faces.bean.ViewScoped;

/**
 * Copied from Seam Faces 3.1.0.
 *
 * @author Steve Taylor
 */
public class ViewContextExtension implements Extension {
	public void addScope(@Observes final BeforeBeanDiscovery event) {
		event.addScope(ViewScoped.class, true, true);
	}

	public void registerContext(@Observes final AfterBeanDiscovery event) {
		event.addContext(new ViewScopedContext());
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy