/*

 * Fecha: 15-abr-04

 */

package q02b.action;

  

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;



import org.apache.struts.action.ActionErrors;

import org.apache.struts.action.ActionForm;

import org.apache.struts.action.ActionForward;

import org.apache.struts.action.ActionMapping;



import es.ejie.frmk.infraestructura.traza.Q70TraceLevel;

import es.ejie.frmk.infraestructura.traza.Q70Traza;



import es.ejie.frmk.listeners.base.Q70ListenerUtils;

import es.ejie.frmk.presentacion.operacion.paso.Q70ActionPasoOP;

import es.ejie.frmk.presentacion.sesiondatos.Q70ContextoEJIE;



/**

 * @version 1.0

 * Fecha: 15-abr-04

 */  

public class Q02bActionSalirAplicacion extends Q70ActionPasoOP {

	private static Q70Traza tr = Q70Traza.getSingleton();

	private static final String COMPONENTE = "Q70ActionPasoOP";

	//Variables que no se modifican

	final static String MAPPING = "ok";



	/**

	 * @see es.ejie.frmk.presentacion.operacion.paso.ActionPasoOP#processOP(es.ejie.frmk.presentacion.sesiondatos.ContextoEJIE, org.apache.struts.action.ActionErrors, org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

	 */

	protected void processOP(

		Q70ContextoEJIE contexto,

		ActionErrors errores,

		ActionMapping mapping,

		ActionForm form,  

		HttpServletRequest request,

		HttpServletResponse response)

		throws Exception {

		

    	if (tr.isTraceActive()){

			tr.trace(COMPONENTE, Q70TraceLevel.INFO, this.getClass().getName() + ":processOP: entrando");

		}

    	

		try

		{  

			//Se libera la información almacenada en memoria de los Servidores

			//de Aplicaciones de Geremua

			try{

				Q70ListenerUtils.desconectarUsuario(contexto);

			}catch(Exception ex){}

				   

		}

		catch(Exception ex)

		{

			java.io.StringWriter sw = new java.io.StringWriter();

			java.io.PrintWriter pw = new java.io.PrintWriter(sw);

			ex.printStackTrace(pw);

			if (tr.isTraceActive()){

				tr.trace(COMPONENTE, Q70TraceLevel.ERROR, this.getClass().getName() + ":processOP " + sw.getBuffer ().toString());

			}

			throw ex;

		}

		finally{

			 if (tr.isTraceActive()){

					tr.trace(COMPONENTE, Q70TraceLevel.INFO, this.getClass().getName() + ":processOP: saliendo");

			 }

		 }	

	}

	

	/**

	 * @see es.ejie.frmk.presentacion.operacion.paso.ActionPasoOP#processForward(es.ejie.frmk.presentacion.sesiondatos.ContextoEJIE, org.apache.struts.action.ActionErrors, org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

	 */

	protected ActionForward processForward(

		Q70ContextoEJIE contexto,

		ActionErrors errores,

		ActionMapping mapping,

		ActionForm form,

		HttpServletRequest request,

		HttpServletResponse response)

		throws Exception {

		//Se indica el mapping de retorno

		return mapping.findForward(MAPPING);

	}

	 

}

