br.gov.frameworkdemoiselle.internal.proxy.FacesContextProxy Maven / Gradle / Ivy
package br.gov.frameworkdemoiselle.internal.proxy;
import java.io.Serializable;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.el.ELContext;
import javax.enterprise.context.ContextNotActiveException;
import javax.enterprise.inject.Default;
import javax.faces.application.Application;
import javax.faces.application.FacesMessage;
import javax.faces.application.FacesMessage.Severity;
import javax.faces.application.ProjectStage;
import javax.faces.component.UIViewRoot;
import javax.faces.context.ExceptionHandler;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.PartialViewContext;
import javax.faces.context.ResponseStream;
import javax.faces.context.ResponseWriter;
import javax.faces.event.PhaseId;
import javax.faces.render.RenderKit;
import javax.inject.Inject;
import br.gov.frameworkdemoiselle.annotation.Name;
import br.gov.frameworkdemoiselle.util.ResourceBundle;
@Default
public class FacesContextProxy extends FacesContext implements Serializable {
private static final long serialVersionUID = 1L;
@Inject
@Name("demoiselle-jsf-bundle")
private ResourceBundle bundle;
@PostConstruct
protected void initialize() {
getDelegate();
}
public FacesContext getDelegate() {
FacesContext facesContext = FacesContext.getCurrentInstance();
if (facesContext == null) {
throw new ContextNotActiveException(bundle.getString("faces-context-not-available"));
}
return facesContext;
}
public int hashCode() {
return getDelegate().hashCode();
}
public boolean equals(Object obj) {
return getDelegate().equals(obj);
}
public Application getApplication() {
return getDelegate().getApplication();
}
public Map