KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > ccm > hello > monolithic > 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): Philippe Merle, Sylvain Leblanc.
23 Contributor(s): Christophe Demarey.
24
25 ====================================================================*/

26
27 package org.objectweb.ccm.hello.monolithic;
28
29 import org.objectweb.ccm.hello.*;
30
31 /**
32  * This is the implementation of the OMG IDL3 hello::Server component type.
33  *
34  * This class inherits from the local CCM_Server interface
35  * generated by the OpenCCM's IDL3 to IDL2 mapping generator.
36  *
37  * The provided for_clients facet is directly implemented by the
38  * component class by implementing the hello::Hello interface.
39  */

40
41 public class ServerImpl
42      extends org.omg.CORBA.LocalObject JavaDoc
43   implements CCM_Server,
44              CCM_HelloWorld,
45              org.omg.Components.SessionComponent
46 {
47     // ==================================================================
48
//
49
// Internal state.
50
//
51
// ==================================================================
52

53     /** To refer to the component context. */
54     private CCM_Server_Context the_context_;
55
56     // ==================================================================
57
//
58
// Constructor.
59
//
60
// ==================================================================
61

62     /** The default constructor. */
63     public
64     ServerImpl()
65     {
66     }
67
68     // ==================================================================
69
//
70
// Internal methods.
71
//
72
// ==================================================================
73

74     // ==================================================================
75
//
76
// Public methods.
77
//
78
// ==================================================================
79

80     // ==================================================================
81
//
82
// Methods for OMG IDL Components::EnterpriseComponent
83
//
84
// ==================================================================
85

86     /**
87      * Complete the component configuration.
88      *
89      * @exception org.omg.Components.InvalidConfiguration
90      * Thrown if the configuration is invalid.
91      */

92     public void
93     configuration_complete ()
94     throws org.omg.Components.InvalidConfiguration
95     {
96         // Nothing to test.
97
}
98
99     // ==================================================================
100
//
101
// Methods for OMG IDL Components::SessionComponent
102
//
103
// ==================================================================
104

105     /**
106      * Set the component context.
107      *
108      * @param context The component context.
109      *
110      * @throw org.omg.Components.CCMException For any problems.
111      */

112     public void
113     set_session_context(org.omg.Components.SessionContext context)
114     throws org.omg.Components.CCMException
115     {
116         the_context_ = (CCM_Server_Context)context;
117     }
118
119     //
120
// IDL:omg.org/Components/SessionComponent/ccm_activate:1.0
121
//
122
/**
123      *
124      * Called by the container when the component will be activated.
125      *
126      * @throws org.omg.Components.CCMException
127      * Thrown if a system level error occured.
128      */

129     public void
130     ccm_activate()
131     throws org.omg.Components.CCMException
132     {
133         // Not implemented
134
}
135
136     //
137
// IDL:omg.org/Components/SessionComponent/ccm_passivate:1.0
138
//
139
/**
140      *
141      * Called by the container when the component will be passivated.
142      *
143      * @throws org.omg.Components.CCMException
144      * Thrown if a system level error occured.
145      */

146     public void
147     ccm_passivate()
148     throws org.omg.Components.CCMException
149     {
150         // Not implemented
151
}
152
153     //
154
// IDL:omg.org/Components/SessionComponent/ccm_remove:1.0
155
//
156
/**
157      *
158      * Called by the container when the component will be removed.
159      *
160      * @throws org.omg.Components.CCMException
161      * Thrown if a system level error occured.
162      */

163     public void
164     ccm_remove()
165     throws org.omg.Components.CCMException
166     {
167         // nothing to do.
168
}
169
170     // ==================================================================
171
//
172
// Methods for OMG IDL hello::CCM_HelloWorld
173
//
174
// ==================================================================
175

176     /**
177      * The say_hello operation of the hello::HelloWorld interface.
178      */

179     public String JavaDoc
180     say_hello()
181     {
182         return "hello world !!";
183     }
184
185     // ==================================================================
186
//
187
// Methods for OMG IDL hello::CCM_Server
188
//
189
// ==================================================================
190

191     /**
192      * Provide the executor for the for_clients facet.
193      *
194      * @return An executor implemening CCM_HelloWorld.
195      */

196     public CCM_HelloWorld
197     get_for_clients()
198     {
199         return this;
200     }
201 }
202
Popular Tags