KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ist > coach > coachEmfServicesComponents > AlarmChannelProviderComposition > objectCreationSegImpl


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.coachEmfServicesComponents.AlarmChannelProviderComposition;
30
31 import ist.coach.coachEmfCommon.Utils;
32 import ist.coach.coachEmfServices.EmfBasicLog.*;
33 /**
34  * This is the CIDL-based implementation of the
35  * OMG IDL3 CIDL:coach.ist/coachEmfServicesComponents/AlarmChannelProviderComposition/AlarmChannelProviderHome_impl/AlarmChannelProvider_impl/objectCreationSeg:1.0 segment type.
36  *
37  * @author OpenCCM CIF_Jimpl Compiler.
38  */

39 public class objectCreationSegImpl
40      extends ist.coach.coachEmfServicesComponents.AlarmChannelProviderComposition.objectCreationSeg
41 {
42     // ==================================================================
43
//
44
// Internal states.
45
//
46
// ==================================================================
47

48     // ==================================================================
49
//
50
// Constructors.
51
//
52
// ==================================================================
53

54     public objectCreationSegImpl()
55     {
56     }
57
58     // ==================================================================
59
//
60
// Methods.
61
//
62
// ==================================================================
63

64     /**
65      * Implementation of the ::itut_q816Components::CCM_ObjectCreationConsumer::push operation.
66      */

67     public void
68     push(ist.coach.itut_q816Components.ObjectCreation event)
69     {
70         //
71
// DONE : Implement
72
//
73
//System.err.println("Object creation event received for " + event.sourceClass);
74
String JavaDoc[] excludedEventTypes = get_main_segment().excludedeventTypes();
75         for (int i = 0; i < excludedEventTypes.length; i++) {
76                 if (excludedEventTypes[i].equals("ObjectCreation"))
77                     return;
78         }
79         String JavaDoc[] excludedEventSources = get_main_segment().excludedSourceClasses();
80         for (int i = 0; i < excludedEventSources.length; i++) {
81                 if (excludedEventSources[i].equals(event.sourceClass))
82                     return;
83         }
84         String JavaDoc[] eventTypes = get_main_segment().eventTypes();
85         boolean eventSupported = false;
86         for (int i = 0; i < eventTypes.length; i++) {
87                 if (eventTypes[i].equals("ObjectCreation")) {
88                     eventSupported = true;
89                     break;
90                 }
91         }
92         if (! eventSupported) return;
93
94         String JavaDoc[] eventSources = get_main_segment().sourceClasses();
95         boolean eventSourceSupported = false;
96         for (int i = 0; i < eventSources.length; i++) {
97                 if (eventSources[i].equals(event.sourceClass)) {
98                     eventSourceSupported = true;
99                     break;
100                 }
101         }
102         if (!eventSourceSupported) return;
103
104         get_context().push_objectCreation_alarm(event);
105         BasicLog logSupport = get_context().get_connection_basic_log();
106         Utils.pretty_log(logSupport, Utils.name2string(event.source),
107                 event.sourceClass,
108             (short) LogSeverity._Info,
109             "ObjectCreation " + event.notificationIdentifier);
110     }
111
112 }
113
Popular Tags