KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > Containers > ComponentCallContext


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2001-2003 INRIA - USTL - LIFL - GOAL
5 Contact: openccm@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): Philippe Merle.
24
25 ====================================================================*/

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

36
37 public class ComponentCallContext
38        extends CallContextBase
39 {
40     // ==================================================================
41
//
42
// Internal state.
43
//
44
// ==================================================================
45

46 // Added for Bug #466.
47
// Contributor: Philippe Merle
48

49     /** To store a reference to the associated component. */
50     protected org.objectweb.openccm.Components.CCMObjectImpl the_component_ = null;
51
52 // Add end.
53

54     // ==================================================================
55
//
56
// Constructor.
57
//
58
// ==================================================================
59

60     /**
61      ** The constructor.
62      **
63      **/

64     public
65     ComponentCallContext(HomeServant home_servant,
66              java.lang.String JavaDoc uid)
67     {
68         super(home_servant, uid);
69     }
70
71 // Added for Bug #466.
72
// Contributor: Philippe Merle
73

74     /**
75      * The constructor.
76      *
77      * TODO: Add Javadoc comments.
78      */

79     public
80     ComponentCallContext(ComponentServant component_servant,
81                          HomeServant home_servant,
82              java.lang.String JavaDoc uid)
83     {
84         super(home_servant, uid);
85         the_component_ = ((org.objectweb.openccm.Components.CCMObjectImpl)component_servant.the_component_executor());
86     }
87
88 // Add end.
89

90     // ==================================================================
91
//
92
// Internal methods.
93
//
94
// ==================================================================
95

96     /**
97      **
98      **/

99     protected SystemConfiguration
100     getConfiguration()
101     {
102         return the_home_servant_.the_component_configuration();
103     }
104
105 // Added for Bug #466.
106
// Contributor: Philippe Merle
107

108     // ==================================================================
109
//
110
// Public methods for the CallContext interface.
111
//
112
// ==================================================================
113

114     /**
115      *
116      */

117     public CallContext
118     duplicate(java.lang.String JavaDoc op_name)
119     {
120         // If this context is not the context of the main component interface
121
// then this is the context of a facet or event sink port.
122
//
123
String JavaDoc the_component_uid = the_home_servant_.the_home_executor()._the_component_uid();
124         if(!the_component_uid.equals(the_uid_))
125         {
126             // Then waits until configuration_complete is called on the component.
127
if(the_component_ != null)
128                 the_component_.wait_until_configuration_complete();
129         }
130
131         return super.duplicate(op_name);
132     }
133
134 // Add end.
135

136 }
137
Popular Tags