/**
 * 
 */
package org.ajax4jsf.portlet.context;

import java.util.Iterator;
import javax.el.ELContext;
import javax.faces.application.Application;
import javax.faces.application.FacesMessage;
import javax.faces.application.FacesMessage.Severity;
import javax.faces.component.UIViewRoot;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseStream;
import javax.faces.context.ResponseWriter;
import javax.faces.render.RenderKit;

/**
 * @author asmirnov
 * 
 */
public class FacesContextWrapper extends FacesContext {
    private FacesContext _wrapped;

    public FacesContextWrapper(FacesContext _wrapped) {
	super();
	this._wrapped = _wrapped;
	setCurrentInstance(this);
    }

    /**
         * @param clientId
         * @param message
         * @see javax.faces.context.FacesContext#addMessage(java.lang.String,
         *      javax.faces.application.FacesMessage)
         */
    public void addMessage(String clientId, FacesMessage message) {
	this._wrapped.addMessage(clientId, message);
    }

    /**
         * @return
         * @see javax.faces.context.FacesContext#getApplication()
         */
    public Application getApplication() {
	return this._wrapped.getApplication();
    }

    /**
         * @return
         * @see javax.faces.context.FacesContext#getClientIdsWithMessages()
         */
    public Iterator getClientIdsWithMessages() {
	return this._wrapped.getClientIdsWithMessages();
    }

    /**
         * @return
         * @see javax.faces.context.FacesContext#getELContext()
         */
    public ELContext getELContext() {
	return this._wrapped.getELContext();
    }

    /**
         * @return
         * @see javax.faces.context.FacesContext#getExternalContext()
         */
    public ExternalContext getExternalContext() {
	return this._wrapped.getExternalContext();
    }

    /**
         * @return
         * @see javax.faces.context.FacesContext#getMaximumSeverity()
         */
    public Severity getMaximumSeverity() {
	return this._wrapped.getMaximumSeverity();
    }

    /**
         * @return
         * @see javax.faces.context.FacesContext#getMessages()
         */
    public Iterator getMessages() {
	return this._wrapped.getMessages();
    }

    /**
         * @param clientId
         * @return
         * @see javax.faces.context.FacesContext#getMessages(java.lang.String)
         */
    public Iterator getMessages(String clientId) {
	return this._wrapped.getMessages(clientId);
    }

    /**
         * @return
         * @see javax.faces.context.FacesContext#getRenderKit()
         */
    public RenderKit getRenderKit() {
	return this._wrapped.getRenderKit();
    }

    /**
         * @return
         * @see javax.faces.context.FacesContext#getRenderResponse()
         */
    public boolean getRenderResponse() {
	return this._wrapped.getRenderResponse();
    }

    /**
         * @return
         * @see javax.faces.context.FacesContext#getResponseComplete()
         */
    public boolean getResponseComplete() {
	return this._wrapped.getResponseComplete();
    }

    /**
         * @return
         * @see javax.faces.context.FacesContext#getResponseStream()
         */
    public ResponseStream getResponseStream() {
	return this._wrapped.getResponseStream();
    }

    /**
         * @return
         * @see javax.faces.context.FacesContext#getResponseWriter()
         */
    public ResponseWriter getResponseWriter() {
	return this._wrapped.getResponseWriter();
    }

    /**
         * @return
         * @see javax.faces.context.FacesContext#getViewRoot()
         */
    public UIViewRoot getViewRoot() {
	return this._wrapped.getViewRoot();
    }

    /**
         * 
         * @see javax.faces.context.FacesContext#release()
         */
    public void release() {
	this._wrapped.release();
	this._wrapped = null;
    }

    /**
         * 
         * @see javax.faces.context.FacesContext#renderResponse()
         */
    public void renderResponse() {
	this._wrapped.renderResponse();
    }

    /**
         * 
         * @see javax.faces.context.FacesContext#responseComplete()
         */
    public void responseComplete() {
	this._wrapped.responseComplete();
    }

    /**
         * @param responseStream
         * @see javax.faces.context.FacesContext#setResponseStream(javax.faces.context.ResponseStream)
         */
    public void setResponseStream(ResponseStream responseStream) {
	this._wrapped.setResponseStream(responseStream);
    }

    /**
         * @param responseWriter
         * @see javax.faces.context.FacesContext#setResponseWriter(javax.faces.context.ResponseWriter)
         */
    public void setResponseWriter(ResponseWriter responseWriter) {
	this._wrapped.setResponseWriter(responseWriter);
    }

    /**
         * @param root
         * @see javax.faces.context.FacesContext#setViewRoot(javax.faces.component.UIViewRoot)
         */
    public void setViewRoot(UIViewRoot root) {
	this._wrapped.setViewRoot(root);
    }
}
