1 28 29 package ist.coach.coachEmfServicesComponents.AlarmChannelProviderComposition; 30 31 import ist.coach.coachEmfCommon.Utils; 32 import ist.coach.coachEmfServices.EmfBasicLog.*; 33 39 public class stateChangedSegImpl 40 extends ist.coach.coachEmfServicesComponents.AlarmChannelProviderComposition.stateChangedSeg 41 { 42 private BasicLog logSupport = null; 48 49 55 public stateChangedSegImpl() 56 { 57 } 58 59 65 68 public void 69 push(ist.coach.itut_q816Components.StateChangedEvent event) 70 { 71 System.err.println("AlarmChannelProvider>Must determine if event is supported..."); 75 String [] excludedEventTypes = get_main_segment().excludedeventTypes(); 76 for (int i = 0; i < excludedEventTypes.length; i++) { 77 if (excludedEventTypes[i].equals("StateChangedEvent")) 78 return; 79 } 80 String [] excludedEventSources = get_main_segment().excludedSourceClasses(); 81 for (int i = 0; i < excludedEventSources.length; i++) { 82 if (excludedEventSources[i].equals(event.sourceClass)) 83 return; 84 } 85 String [] eventTypes = get_main_segment().eventTypes(); 86 boolean eventSupported = false; 87 for (int i = 0; i < eventTypes.length; i++) { 88 if (eventTypes[i].equals("StateChangedEvent")) { 89 eventSupported = true; 90 break; 91 } 92 } 93 if (! eventSupported) return; 94 95 String [] eventSources = get_main_segment().sourceClasses(); 96 boolean eventSourceSupported = false; 97 for (int i = 0; i < eventSources.length; i++) { 98 if (eventSources[i].equals(event.sourceClass)) { 99 eventSourceSupported = true; 100 break; 101 } 102 } 103 if (!eventSourceSupported) return; 104 105 System.err.println("AlarmChannelProvider> Ready to push events to clients..."); 106 get_context().push_stateChanged_alarm(event); 107 108 if (logSupport == null) 110 logSupport = get_context().get_connection_basic_log(); 111 112 Utils.pretty_log(logSupport, Utils.name2string(event.source), 113 event.sourceClass, 114 (short) LogSeverity._Info, 115 "StateChangedEvent " + event.notificationIdentifier); 116 } 117 118 } 119 | Popular Tags |