KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2001-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.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 abstract class CallContextBase
38                 extends org.omg.CORBA.LocalObject JavaDoc
39                 implements CallContext
40 {
41     // ==================================================================
42
//
43
// Internal state.
44
//
45
// ==================================================================
46

47     /**
48      **
49      **/

50     protected HomeServant the_home_servant_;
51
52     /**
53      **
54      **/

55     protected java.lang.String JavaDoc the_uid_;
56
57     // ==================================================================
58
//
59
// Constructor.
60
//
61
// ==================================================================
62

63     /**
64      ** The constructor.
65      **
66      **/

67     public
68     CallContextBase(HomeServant servant,
69                     java.lang.String JavaDoc uid)
70     {
71         the_home_servant_ = servant;
72         the_uid_ = uid;
73     }
74
75     // ==================================================================
76
//
77
// Internal methods.
78
//
79
// ==================================================================
80

81     /**
82      **
83      **/

84     protected abstract SystemConfiguration
85     getConfiguration();
86
87     // ==================================================================
88
//
89
// Public methods for the CallContext interface.
90
//
91
// ==================================================================
92

93     //
94
// IDL:goal.lifl.fr/OpenCCM/Containers/CallContext/get_call_coordinator:1.0
95
//
96
/**
97      **
98      **/

99     public CallCoordinator
100     get_call_coordinator(java.lang.String JavaDoc op_name)
101     {
102         SystemConfiguration config = getConfiguration();
103
104         if (config == null)
105           return new org.objectweb.openccm.Containers.Plugins.EmptyCoordinator();
106
107         SystemHomeFinder finder = the_home_servant_.the_home_finder();
108         CallCoordinator coord = config.create_call_coordinator(the_uid_, op_name, finder);
109         CallController[] crtls = config.create_call_controllers(the_uid_, op_name, finder);
110         for (int i=0;i<crtls.length;i++)
111             coord.add(crtls[i]);
112
113         return coord;
114     }
115
116     //
117
// IDL:goal.lifl.fr/OpenCCM/Containers/CallContext/duplicate:1.0
118
//
119
/**
120      **
121      **/

122     public CallContext
123     duplicate(java.lang.String JavaDoc op_name)
124     {
125         CallContext child = new OperationCallContext(this, op_name);
126         return child;
127     }
128
129     //
130
// IDL:goal.lifl.fr/OpenCCM/Containers/CallContext/uid:1.0
131
//
132
/**
133      **
134      **/

135     public java.lang.String JavaDoc
136     uid()
137     {
138         return the_uid_;
139     }
140
141     //
142
// IDL:goal.lifl.fr/OpenCCM/Containers/CallContext/operation_name:1.0
143
//
144
/**
145      **
146      **/

147     public java.lang.String JavaDoc
148     operation_name()
149     {
150         // not implemented by this class
151
// call this operation only on a duplicated context.
152
throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
153     }
154 }
155
Popular Tags