/*
 * 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): ______________________________________.
 *  Jeff Mesnil: for JORAM 3.0 integration
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */


package org.objectweb.jonas_jms.api;

import javax.jms.Queue;
import javax.jms.QueueConnectionFactory;
import javax.jms.XAQueueConnectionFactory;
import javax.jms.Topic;
import javax.jms.TopicConnectionFactory;
import javax.jms.XATopicConnectionFactory;


/**
 * JMS Administration interface.
 * must be implemented for each jms provider
 * JOnAS uses this interface to access the JMS provider.
 */
public interface JmsAdministration {

    /**
     * Jms Administrator is created with newInstance().
     * initialization is done later with this method.
     * The MOM will be started if collocated.
     * This method should create an XATopicConnectionFactory and
     * an XAQueueConnectionFactory
     * @param boolean true for if the MOM in run in the current JVM
     * @param String url connexion that must be used.
     */
    public void start(boolean collocated, String url) throws Exception;

    /**
     * Stop the Jms Administrator
     */
    public void stop();

    /**
     * Get the XATopicConnectionFactory
     */
    public XATopicConnectionFactory getXATopicConnectionFactory();

    /**
     * Get the XAQueueConnectionFactory
     */
    public XAQueueConnectionFactory getXAQueueConnectionFactory();

    /**
     * Create a Topic
     */
    public Topic createTopic(String name) throws Exception;

    /**
     * Create a Queue
     */
    public Queue createQueue(String name) throws Exception;
}
