KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > ir3 > EventPortDef_impl


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

26
27 package org.objectweb.openccm.ir3;
28
29 /**
30  * Implementation of the CORBA::ComponentIR::EventPortDef interface.
31  *
32  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
33  * <a HREF="mailto:Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
34  *
35  * @version 0.5
36  */

37
38 public abstract class EventPortDef_impl
39               extends FeatureContained
40            implements org.omg.CORBA.ComponentIR.EventPortDefOperations
41 {
42     // ==================================================================
43
//
44
// Internal state.
45
//
46
// ==================================================================
47

48     /** The event value type. */
49     protected EventDef_ref event_;
50
51     // ==================================================================
52
//
53
// Constructor.
54
//
55
// ==================================================================
56

57     /** Default constructor. */
58     public
59     EventPortDef_impl(IFR ifr,
60                       Container_impl container)
61     {
62         // Calls the FeatureContained contructor.
63
super(ifr, container);
64
65         // Inits internal state.
66
event_ = new EventDef_ref(this);
67     }
68
69     // ==================================================================
70
//
71
// Public methods.
72
//
73
// ==================================================================
74

75     /**
76      * Obtain the CORBA::ComponentIR::EventPortDescription of the declaration.
77      */

78     public org.omg.CORBA.ComponentIR.EventPortDescription
79     describe_event_port()
80     {
81         // create the CORBA::EventDescription.
82
org.omg.CORBA.ComponentIR.EventPortDescription description = new org.omg.CORBA.ComponentIR.EventPortDescription();
83         description.name = name();
84         description.id = id();
85         description.defined_in = getContainerID();
86         description.version = version();
87         description.event = event().id();
88
89         return description;
90     }
91
92
93     // ==================================================================
94
//
95
// For Contained_impl class.
96
//
97
// ==================================================================
98

99     /**
100      * To set the value field of the CORBA::Contained::Description struct.
101      */

102     public void
103     setDescriptionValue(org.omg.CORBA.Any JavaDoc any)
104     {
105         // insert it into the any.
106
org.omg.CORBA.ComponentIR.EventPortDescriptionHelper.insert(any, describe_event_port());
107     }
108
109     // ==================================================================
110
//
111
// Internal methods for managing dependencies.
112
//
113
// ==================================================================
114

115     /**
116      * Cuts dependencies to other objects.
117      */

118     protected void
119     cutDependencies()
120     {
121         // Cuts the dependency to the event type.
122
event_.cutDependency();
123         event_ = null;
124
125         // Calls the Container_impl::cutDependencies operation.
126
super.cutDependencies();
127     }
128
129     // ==================================================================
130
//
131
// For CORBA::IRObject interface.
132
//
133
// ==================================================================
134

135     // ==================================================================
136
//
137
// For CORBA::ComponentIR::EventPortDef interface.
138
//
139
// ==================================================================
140

141     /**
142      * IDL:omg.org/CORBA/ComponentIR/EventPortDef/is_a:1.0
143      */

144     public boolean
145     is_a(String JavaDoc event_id)
146     {
147         // delegate to the ValueDef event.
148
return event_.getImpl().is_a(event_id);
149     }
150
151     /**
152      * IDL:omg.org/CORBA/ComponentIR/EventPortDef/event:1.0
153      */

154     public org.omg.CORBA.ComponentIR.EventDef
155     event()
156     {
157         // delegate to the ValueDef reference.
158
return event_.asEventDef();
159     }
160
161     // Warning: event is a readonly attribute!
162
//
163
// Here, this allows us to implement the CORBA::Component::create_provides()
164
// operation in the same way that other create_* operations.
165
//
166
/**
167      * IDL:omg.org/CORBA/ComponentIR/EventPortDef/event:1.0
168      */

169     public void
170     event(org.omg.CORBA.ComponentIR.EventDef val)
171     {
172         // try to cast val to a local ValueDef object
173
// and delegate to the IDLType reference.
174
event_.setDependency(castToLocal(val));
175     }
176 }
177
Popular Tags