/**
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 2007 Bull S.A.
 * Contact: jonas-team@ow2.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
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.ow2.jonas.lib.management.tools;

//import org.ow2.jonas.lib.management.extensions.base.BaseManagement;

/*
import javax.management.ObjectName;

import org.objectweb.util.monolog.api.Logger;
import org.ow2.jonas.lib.management.extensions.base.BaseManagement;
import org.ow2.jonas.lib.management.javaee.J2eeObjectName;
import org.ow2.jonas.lib.util.Log;


/**
 * Implements management operations to administer a JOnAS server instance in the domain.
 * The managed server can be the current server, or another server in the domain
 * if the current server is a master server.
 */
public class ServerManagement {// extends BaseManagement {
/*
    private final static String serverVersionAttribute = "serverVersion";
    private final static String currentUsedMemoryAttribute = "currentUsedMemory";
    /**
     * The current J2EEServer MBean's ObjectName.
     *//*
    private ObjectName serverOn = null;
    /**
     * Logger for traces.
     */
  /*  protected static Logger serverManagement = Log.getLogger("org.ow2.jonas.management");
    /**
     * Constructor.
     */
    /*public ServerManagement() {
        super();
        serverOn = J2eeObjectName.J2EEServer(getDomainName(), getServerName());
    }

    /**
     * Get the version of a server in the domain.
     * @param pServer managed server's name.
     * @return the "serverVersion" attribute of the corresponding J2EEServer MBean.
     * @throws ManagementException management exception
     */
    /*public String getServerVersion(final String pServer) throws ManagementException {
        // Current domain name
        String pDomain = getDomainName();
        // Managed server's MBean ObjectName
        ObjectName serverOn = getServerOn(pServer, pDomain);
        return (String) ManagementRepr.getAttribute(serverOn, serverVersionAttribute, pServer);
    }

    /**
     * Get the current server's version.
     * @return the "serverVersion" attribute of the current server's J2EEServer MBean.
     * @throws ManagementException management exception
     */
    /*public String getServerVersion() throws ManagementException {
        return (String) ManagementRepr.getAttribute(serverOn, serverVersionAttribute, getServerName());
    }

    /**
     * Get the memory used by the current server.
     * @return the amount of memory used by the current server
     * @throws ManagementException management exception
     */
    /*public long currentUsedMemory() throws ManagementException {
        Long usedMemory = (Long) ManagementRepr.getAttribute(serverOn, currentUsedMemoryAttribute, getServerName());
        return usedMemory.longValue();

    }
    /**
     * Get the memory used by a server in the domain
     * @return the amount of memory used by a server in the domain
     * @param pServer managed server's name.
     * @throws ManagementException management exception
     */
    /*public long currentUsedMemory(final String pServer) throws ManagementException {
        // Current domain name
        String pDomain = getDomainName();
        // Managed server's MBean ObjectName
        ObjectName serverOn = getServerOn(pServer, pDomain);
        Long usedMemory = (Long) ManagementRepr.getAttribute(serverOn, currentUsedMemoryAttribute, getServerName());
        return usedMemory.longValue();

    }
    /**
     * @return The ObjectName for the J2EEServer MBean associated to the managed server.
     * @param pServer managed server's name.
     * @param pDomain domain name
     */
/*    private ObjectName getServerOn(final String pServer, final String pDomain) throws ManagementException {
        return J2eeObjectName.J2EEServer(pDomain, pServer);
    }
  */
}
