/*
 * 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): ____________________________________.
 * Contributor(s): ______________________________________.
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.objectweb.jonas.container;

import java.util.Set;
import org.objectweb.jonas.service.Service;
import org.objectweb.jonas_ejb.container.Container;
import javax.naming.Context;

/**
 * EJB Service interface.
 */
public interface EJBService extends Service {

    /**
     * Create a JOnAS Container for all beans that are described in a .xml file 
     * or belong to .jar file.
     * @param ctx JNDI contect in which are found the container configuration.
     */
    public Container createContainer(Context ctx) throws Exception;

    /**
     * Get the Container by its file name (.xml or .jar)
     */
    public Container getContainer(String fileName);

    /**
     * Remove a  JOnAS Container.
     * @param cont JOnAS container to remove.
     * @return Container object
     */
    public void removeContainer(Container cont);

    /**
     * List of all JOnAS Containers
     * @return an array of Container objects
     */
    public Container[] listContainers();

    /**
     * Synchronized all entity bean containers
     */
    public void syncAllEntities();



    /**
     * MBean method
     * @return Integer Total Number of Container currently in JOnAS
     */ 
    public Integer getCurrentNumberOfContainer();

    /**
     * MBean method
     * @return Integer Total Number of Bean Type currently in JOnAS
     */ 
    public Integer getTotalCurrentNumberOfBeanType();

    /**
     * MBean method
     * @return Integer Total Number of Bmp Type currently in JOnAS
     */
    public Integer getTotalCurrentNumberOfBMPType();

    /**
     * MBean method
     * @return Integer Total Number of Cmp Type currently in JOnAS
     */
    public Integer getTotalCurrentNumberOfCMPType();

    /**
     * MBean method
     * @return Integer Total Number of Sbf Type currently in JOnAS
     */
    public Integer getTotalCurrentNumberOfSBFType();

    /**
     * MBean method
     * @return Integer Total Number of Sbl Type currently in JOnAS
     */
    public Integer getTotalCurrentNumberOfSBLType();

    /**
     * MBean method
     * @return Integer Total Number of Mdb Type currently in JOnAS
     */
    public Integer getTotalCurrentNumberOfMDBType();

    /**
     * Management method
     * @return all ejb ObjectName using this datasource (with  there container name)
     */
    public Set getDataSourceDependence(String dsName);

    /**
     * Management method
     * @return all ejb ObjectName using this destination (with  there container name)
     */
    public Set getJmsDestinationDependence(String dsName);

    /**
     * Management method
     * @return all ejb ObjectName using this Connection Factory (with  there container name)
     */
    public Set getJmsConnectionFactoryDependence(String cfName);
    

}

