/**
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 2005 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 1any 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
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.objectweb.jonas.jonasadmin.test.util;

import com.meterware.httpunit.WebConversation;

/**
 * Class shares the connexion object
 * Needs to use the same JVM => fork=no
 * @author kemlerp
 *
 */
public class JonasAdminConnexion {

    /**
     * Conversation used for HttpUnit
     */
    private static WebConversation wc = null;

    /**
     * Constructor
     *
     */
    private JonasAdminConnexion() {
        super();
    }


    /**
     * Get the connexion object, wc
     * @return null or a WebConversation to JonasAdmin
     */
    public static WebConversation getWc() {
        return wc;
    }


    /**
     * Set the connexion object, wc
     * @param wc a WebConversation to JonasAdmin
     */
    public static void setWc(WebConversation wc) {
        JonasAdminConnexion.wc = wc;
    }

    /**
     * Create the connexion object, wc
     * @return JonasAdminConnexion.wc
     */
    public static WebConversation createWc() {
        JonasAdminConnexion.wc = new WebConversation();
        return JonasAdminConnexion.wc;
    }

}
