/*
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 1999 Bull S.A.
 * Contact: jonas-team@objectweb.org
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * Initial developer(s): Adriana Danes
 * Contributor(s): ______________________________________.
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.objectweb.jonas.jmx.vjadmin.servlet;

// servlet imports
import javax.servlet.*;

import java.util.Set;
import java.util.Vector;
import java.util.Iterator;

import org.apache.velocity.servlet.VelocityServlet;
import org.apache.velocity.context.Context;

// JOnAS JMX imports
import org.objectweb.jonas.jmx.*;
// JMX
import javax.management.ObjectName;
import javax.management.MalformedObjectNameException;

// Jadmin imports
import org.objectweb.jonas.jmx.vjadmin.*;

public class SessionServletHelper extends EjbServletHelper {

    public void init(ServletConfig config ) throws ServletException {
	super.init(config);
    }

    void getSessionBeanInfo(Context context, ObjectName MBeanName, String sessionInfo_error,
			   String timeOut_name) {
	try {
	    // get current timeout
	    Integer timeout = (Integer)JonasManagementRepr.getAttribute(MBeanName, "SessionTimeOut");
	    context.put(timeOut_name, timeout);
	} catch (Exception e) {
	    sessionInfo_error = "Error while getting attribute:" + e.getMessage();
	}
	context.put("info_error", sessionInfo_error);
    }
}
