001: /*
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: JmsAdministration.java 4408 2004-03-19 14:31:54Z sauthieg $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas_jms.api;
027:
028: import javax.jms.Queue;
029: import javax.jms.Topic;
030: import javax.jms.XAConnectionFactory;
031: import javax.jms.XAQueueConnectionFactory;
032: import javax.jms.XATopicConnectionFactory;
033:
034: /**
035: * JMS Administration interface.
036: * must be implemented for each jms provider
037: * JOnAS uses this interface to access the JMS provider.
038: * @author Philippe Coq
039: * Contributor(s):
040: * Jeff Mesnil: for JORAM 3.0 integration
041: * Frederic Maistre: for JORAM 3.4 (JMS 1.1) integration
042: * 03/05/25 : Adriana Danes : add JMS resource monitoring
043: */
044: public interface JmsAdministration {
045:
046: /**
047: * Jms Administrator is created with newInstance().
048: * initialization is done later with this method.
049: * The MOM will be started if collocated.
050: * This method should create an XAConnectionFactory,
051: * a XATopicConnectionFactory and a XAQueueConnectionFactory
052: * @param boolean true for if the MOM in run in the current JVM
053: * @param String url connexion that must be used.
054: */
055: public void start(boolean collocated, String url) throws Exception;
056:
057: /**
058: * Stop the Jms Administrator
059: */
060: public void stop();
061:
062: /**
063: * Get the XAConnectionFactory
064: */
065: public XAConnectionFactory getXAConnectionFactory();
066:
067: /**
068: * Get the XATopicConnectionFactory
069: */
070: public XATopicConnectionFactory getXATopicConnectionFactory();
071:
072: /**
073: * Get the XAQueueConnectionFactory
074: */
075: public XAQueueConnectionFactory getXAQueueConnectionFactory();
076:
077: /**
078: * Create a Topic
079: */
080: public Topic createTopic(String name) throws Exception;
081:
082: /**
083: * Create a Queue
084: */
085: public Queue createQueue(String name) throws Exception;
086:
087: /**
088: * Delete a destination.
089: */
090: public void deleteDestination(String name) throws Exception;
091:
092: /**
093: * Get number of pending messages on a queue
094: */
095: public int getPendingMessages(javax.jms.Queue queue)
096: throws Exception;
097:
098: /**
099: * Get number of pending requests on a queue
100: */
101: public int getPendingRequests(javax.jms.Queue queue)
102: throws Exception;
103:
104: /**
105: * Get number of subscriptions on a topic
106: */
107: public int getSubscriptions(javax.jms.Topic topic) throws Exception;
108: }
|