KickJava   Java API By Example, From Geeks To Geeks.

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


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): Raphael Marvie, Philippe Merle.
23 Contributor(s): Mathieu Vadet, Briclet Fr?d?ric______________________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.Deployment;
28
29 /**
30  * This class implements the OMG IDL
31  * OpenCCM::ComponentServer::Server interface.
32  *
33  * @author <a HREF="mailto:Raphael.Marvie@lifl.fr">Raphael Marvie</a>
34  * <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
35  * <a HREF="mailto:Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
36  * <a HREF="mailto:Frederic.Briclet@lifl.fr">Fr?d?ric Briclet</a>
37  * @version 0.3
38  */

39
40 public class ServerImpl
41        extends ServerPOA
42 {
43     // ==================================================================
44
//
45
// Internal state.
46
//
47
// ==================================================================
48

49     /**
50      ** The class loader used by the two facets.
51      **/

52     protected org.objectweb.ccm.util.URLClassLoader class_loader_;
53
54     /**
55      ** The ComponentServer facet.
56      **/

57     protected ComponentServerImpl component_server_facet_;
58
59     /**
60      ** The ComponentServer reference.
61      **/

62     protected org.omg.Components.Deployment.ComponentServer component_server_ref_;
63
64     /**
65      ** The ComponentInstallation facet.
66      **/

67     protected ComponentInstallationImpl install_facet_;
68
69     /**
70      ** The ComponentInstallation reference.
71      **/

72     protected org.omg.Components.Deployment.ComponentInstallation install_ref_;
73
74     // ==================================================================
75
//
76
// Constructor.
77
//
78
// ==================================================================
79

80     /**
81      ** The constructor.
82      **/

83     public
84     ServerImpl()
85     {
86     // Create the ComponentServer facet.
87
component_server_facet_ = new ComponentServerImpl();
88
89     // Activate the ComponentServer facet.
90
// TODO: Must be changed!!!
91
org.omg.CORBA.Object JavaDoc ref = component_server_facet_._this_object(org.objectweb.openccm.corba.TheORB.getORB());
92     component_server_ref_ = org.omg.Components.Deployment.ComponentServerHelper.narrow(ref);
93
94     // Obtain the path where archives are stored.
95
String JavaDoc path = System.getProperties().getProperty ("OpenCCM.ComponentServer.archive_cache", ".");
96
97     // Create the install facet.
98
install_facet_ = new ComponentInstallationImpl(path);
99
100     // Activate the install facet.
101
// TODO: Must be changed!!!
102
ref = install_facet_._this_object(org.objectweb.openccm.corba.TheORB.getORB());
103     install_ref_ = org.omg.Components.Deployment.ComponentInstallationHelper.narrow(ref);
104         TheComponentInstallation.setComponentInstallation(install_ref_);
105     }
106
107     // ==================================================================
108
//
109
// Internal methods.
110
//
111
// ==================================================================
112

113     // ==================================================================
114
//
115
// Public methods.
116
//
117
// ==================================================================
118

119     // ==================================================================
120
//
121
// Methods for the OpenCCM::Shutdownable interface.
122
//
123
// ==================================================================
124

125     //
126
// IDL:goal.lifl.fr/OpenCCM/Shutdownable/shutdown:1.0
127
//
128
/**
129      ** Shutdown an OpenCCM server.
130      **/

131     public void
132     shutdown()
133     {
134     org.objectweb.openccm.corba.TheORB.shutdown(false);
135     }
136
137     // ==================================================================
138
//
139
// Methods for the OpenCCM::ComponentServer::Server interface.
140
//
141
// ==================================================================
142

143     //
144
// IDL:goal.lifl.fr/OpenCCM/ComponentServer/Server/provide_component_server:1.0
145
//
146
/**
147      ** Obtains the component server reference.
148      **
149      ** @return The reference to the ComponentServer object.
150      **/

151     public org.omg.Components.Deployment.ComponentServer
152     provide_component_server()
153     {
154     return component_server_ref_;
155     }
156
157     //
158
// IDL:goal.lifl.fr/OpenCCM/ComponentServer/Server/provide_install:1.0
159
//
160
/**
161      ** Obtains the component installation reference.
162      **
163      ** @return The reference to the component installation.
164      **/

165     public org.omg.Components.Deployment.ComponentInstallation
166     provide_install()
167     {
168     return install_ref_;
169     }
170 }
171
Popular Tags