KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ist > coach > itut_x780Components > ManagedObjectProviderComposition > mgmtSegImpl


1 /*====================================================================
2
3 This file was produced by the OpenCCM CIF_JIMPL generator.
4
5 OpenCCM: The Open CORBA Component Model Platform
6 Copyright (C) 2000-2003 INRIA - USTL - LIFL - GOAL
7 Contact: openccm@objectweb.org
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or any later version.
13
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA
23
24 Initial developer(s): Christophe Demarey.
25 Contributor(s): ______________________________________.
26
27 ====================================================================*/

28
29 package ist.coach.itut_x780Components.ManagedObjectProviderComposition;
30
31 import ist.coach.coachEmfCommon.Utils;
32 import ist.coach.coachEmfCommon.ExceptionMessages;
33 import ist.coach.coachEmfCommon.ManagedObjectValueTypeImpl;
34 import ist.coach.coachEmfCommon.CreateErrorInfoTypeImpl;
35
36
37 import intt.itu.itut_x780.CreateError;
38 import ist.coach.coachEmfCommon.ObjectCreationImpl;
39
40 import intt.itu.itut_x780.UIDType;
41 import intt.itu.itut_x780.AttributeValueType;
42
43 /**
44  * This is the CIDL-based implementation of the
45  * OMG IDL3 CIDL:coach.ist/itut_x780Components/ManagedObjectProviderComposition/ManagedObjectProviderHome_impl/ManagedObjectProvider_impl/mgmtSeg:1.0 segment type.
46  *
47  * @author OpenCCM CIF_Jimpl Compiler.
48  */

49 public class mgmtSegImpl
50      extends ist.coach.itut_x780Components.ManagedObjectProviderComposition.mgmtSeg
51 {
52     // ==================================================================
53
//
54
// Internal states.
55
//
56
// ==================================================================
57

58     // ==================================================================
59
//
60
// Constructors.
61
//
62
// ==================================================================
63

64     public mgmtSegImpl()
65     {
66     }
67
68     // ==================================================================
69
//
70
// Methods.
71
//
72
// ==================================================================
73

74     /**
75      * Implementation of the ::itut_x780Components::ManagedObjectMgmt::create operation.
76      */

77     public void
78     create(org.omg.CosNaming.NameComponent JavaDoc[] name, String JavaDoc objectClass, String JavaDoc[] packages, short deletePolicy, intt.itu.itut_x780.SourceIndicatorType sourceIndicator)
79     throws intt.itu.itut_x780.CreateError,
80            intt.itu.itut_x780.ApplicationError
81     {
82         //
83
// DONE : implement
84
//
85

86         if (ManagedObjectProviderImpl.elements.containsKey(Utils.name2string(name))) {
87             System.err.println(Utils.name2string(name) + " already exists!");
88             CreateErrorInfoTypeImpl error_code = new CreateErrorInfoTypeImpl();
89             error_code.error = new UIDType(
90                 intt.itu.itut_x780.CreateErrorConst.moduleName.value,
91                 intt.itu.itut_x780.CreateErrorConst.duplicateName.value);
92
93             error_code.details = ExceptionMessages.already_exists_error;
94             throw new CreateError(error_code);
95         }
96
97         ManagedObjectValueTypeImpl value_type =
98                 new ManagedObjectValueTypeImpl(name, objectClass, packages,
99                         sourceIndicator, deletePolicy);
100
101         synchronized(ManagedObjectProviderImpl.elements) {
102             ManagedObjectProviderImpl.elements.put(Utils.name2string(name), value_type);
103         }
104
105         org.omg.TimeBase.UtcT eventTime = new org.omg.TimeBase.UtcT(System.currentTimeMillis(),
106                     0,(short) 0,(short) 0);
107
108
109         get_context().push_objectCreation_alarm(new ObjectCreationImpl(eventTime, name,
110                                         objectClass,
111                                         ManagedObjectProviderImpl.getUniqueNotificationIdentifier(),
112                                         sourceIndicator,
113                                         new AttributeValueType[0]));
114
115
116     }
117
118     /**
119      * Implementation of the ::itut_x780Components::ManagedObjectMgmt::facade_name operation.
120      */

121     public String JavaDoc
122     facade_name()
123     {
124               //
125
// DONE : implement
126
//
127
return get_main_segment().facade_name();
128     }
129
130 }
131
Popular Tags