KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ist > coach > itut_q816Components > FactoryFinderProviderComposition > querySegImpl


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

28
29 package ist.coach.itut_q816Components.FactoryFinderProviderComposition;
30
31 import intt.itu.itut_x780.ApplicationError;
32 import intt.itu.itut_q816.FactoryInfoType;
33 /**
34  * This is the CIDL-based implementation of the
35  * OMG IDL3 CIDL:coach.ist/itut_q816Components/FactoryFinderProviderComposition/FactoryFinderProviderHome_impl/FactoryFinderProvider_impl/querySeg:1.0 segment type.
36  *
37  * @author OpenCCM CIF_Jimpl Compiler.
38  */

39 public class querySegImpl
40      extends ist.coach.itut_q816Components.FactoryFinderProviderComposition.querySeg
41 {
42     // ==================================================================
43
//
44
// Internal states.
45
//
46
// ==================================================================
47

48     // ==================================================================
49
//
50
// Constructors.
51
//
52
// ==================================================================
53

54     public querySegImpl()
55     {
56     }
57
58     // ==================================================================
59
//
60
// Methods.
61
//
62
// ==================================================================
63

64     /**
65      * Implementation of the ::itut_q816::FactoryFinder::find operation.
66      */

67     public intt.itu.itut_x780.ManagedObjectFactory
68     find(String JavaDoc factoryClass)
69     throws intt.itu.itut_q816.FactoryNotFound,
70
71            intt.itu.itut_x780.ApplicationError
72     {
73         //
74
// DONE : implement
75
//
76
if (! FactoryFinderProviderImpl.factories.containsKey(factoryClass))
77             throw new intt.itu.itut_q816.FactoryNotFound(factoryClass +
78                 " has not been registered");
79
80         FactoryInfoType f_info =
81                 (FactoryInfoType) FactoryFinderProviderImpl.factories.get(factoryClass);
82
83
84         return f_info.factoryRef;
85     }
86
87     /**
88      * Implementation of the ::itut_q816::FactoryFinder::list operation.
89      */

90     public intt.itu.itut_q816.FactoryInfoType[]
91     list()
92     throws intt.itu.itut_x780.ApplicationError
93     {
94         //
95
// DONE : implement
96
//
97
int f_size = FactoryFinderProviderImpl.factories.size();
98         if (f_size <= 0)
99             return new FactoryInfoType[0];
100
101         FactoryInfoType[] factories_list =
102         new FactoryInfoType[f_size];
103
104         factories_list =
105             (FactoryInfoType[]) FactoryFinderProviderImpl.factories.values().toArray(factories_list);
106
107         return factories_list;
108     }
109
110 }
111
Popular Tags