KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > util > monolog > provider > lib > TopicProviderSingleton


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2003 USTL - LIFL - GOAL
5 Contact: openccm-team@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Jerome Offroy.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.util.monolog.provider.lib;
28
29 import org.objectweb.util.monolog.provider.api.TopicProvider;
30
31 /**
32  * @author Jerome Offroy
33  *
34  * Singleton class for TopicProviderImpl
35  */

36 public final class TopicProviderSingleton{
37     private static TopicProvider unique;
38
39     /**
40      * Method getTopicProvider.
41      * @return TopicProviderImpl
42      */

43     static public TopicProvider getTopicProvider(){
44         if (unique == null) {
45             unique = new TopicProviderImpl();
46         }
47         return unique;
48     }
49     
50     /**
51      * Method createTopic.
52      * @param name
53      * @param ref
54      * @param description
55      * @return String
56      */

57     static public String JavaDoc createTopic(String JavaDoc name, Class JavaDoc ref, String JavaDoc[] description) {
58         return getTopicProvider().createTopic(name, ref, description);
59     }
60 }
61
Popular Tags