KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > Deployment > SystemHomeManagerImpl


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2002 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): Mathieu Vadet.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.Deployment;
28
29 /**
30  * ?????????.
31  *
32  * @author <a HREF="mailto:Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
33  *
34  * @version 0.3
35  */

36
37 public class SystemHomeManagerImpl
38        extends org.omg.CORBA.LocalObject JavaDoc
39        implements org.objectweb.openccm.Containers.SystemHomeManager
40 {
41     // ==================================================================
42
//
43
// Internal state.
44
//
45
// ==================================================================
46

47     /**
48      **
49      **/

50     protected org.objectweb.ccm.util.Table system_homes_;
51
52     // ==================================================================
53
//
54
// Constructor.
55
//
56
// ==================================================================
57

58     /**
59      **
60      **/

61     public
62     SystemHomeManagerImpl()
63     {
64         system_homes_ = new org.objectweb.ccm.util.Table();
65     }
66
67     // ==================================================================
68
//
69
// Methods for the OpenCCM::Containers::SystemHomeManager interface.
70
//
71
// ==================================================================
72

73     /**
74      **
75      **/

76     public org.objectweb.openccm.Containers.SystemHome
77     create_system_home(java.lang.String JavaDoc implUUID,
78                        java.lang.String JavaDoc alias,
79                        java.lang.String JavaDoc entrypt)
80     throws org.objectweb.openccm.Containers.CreationFailed
81     {
82         try
83         {
84             TheComponentInstallation.getComponentInstallation().get_implementation(implUUID);
85
86         // Call the static 'create' method of the 'clazz' class.
87
java.lang.Object JavaDoc obj =
88                 TheURLClassLoader.getURLClassLoader().callStaticClassMethod(entrypt, new Object JavaDoc[0]);
89
90         // Check that the result is a SystemHome.
91
org.objectweb.openccm.Containers.SystemHome home = (org.objectweb.openccm.Containers.SystemHome)obj;
92             system_homes_.put(alias, home);
93             return home;
94         }
95         catch(org.omg.Components.Deployment.UnknownImplId ex)
96         {
97             throw new org.objectweb.openccm.Containers.CreationFailed();
98         }
99         catch(org.omg.Components.Deployment.InstallationFailure ex)
100         {
101             throw new org.objectweb.openccm.Containers.CreationFailed();
102         }
103         catch(java.lang.ClassNotFoundException JavaDoc ex)
104         {
105             throw new org.objectweb.openccm.Containers.CreationFailed();
106         }
107         catch(java.lang.NoSuchMethodException JavaDoc ex)
108         {
109             throw new org.objectweb.openccm.Containers.CreationFailed();
110         }
111         catch(java.lang.reflect.InvocationTargetException JavaDoc ex)
112         {
113             throw new org.objectweb.openccm.Containers.CreationFailed();
114         }
115         catch(java.lang.IllegalAccessException JavaDoc ex)
116         {
117             throw new org.objectweb.openccm.Containers.CreationFailed();
118         }
119         catch(java.lang.ClassCastException JavaDoc ex)
120         {
121             throw new org.objectweb.openccm.Containers.CreationFailed();
122     }
123     }
124
125     /**
126      **
127      **/

128     public org.objectweb.openccm.Containers.SystemHome
129     find_system_home(java.lang.String JavaDoc alias)
130     throws org.objectweb.openccm.Containers.HomeNotFound
131     {
132         java.lang.Object JavaDoc home = system_homes_.get(alias);
133         if (home==null)
134             throw new org.objectweb.openccm.Containers.HomeNotFound();
135
136         return (org.objectweb.openccm.Containers.SystemHome)home;
137     }
138 }
139
Popular Tags