00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 package org.objectweb.proactive.core.event;
00032
00033 import org.objectweb.proactive.core.runtime.ProActiveRuntime;
00034
00035
00036 public class RuntimeRegistrationEventProducerImpl extends AbstractEventProducer
00037 implements RuntimeRegistrationEventProducer {
00038
00039
00040
00041
00045 public void addRuntimeRegistrationEventListener(
00046 RuntimeRegistrationEventListener listener) {
00047 addListener(listener);
00048 }
00049
00053 public void removeRuntimeRegistrationEventListener(
00054 RuntimeRegistrationEventListener listener) {
00055 removeListener(listener);
00056 }
00057
00058
00059
00060
00061
00065 protected void notifyOneListener(ProActiveListener proActiveListener,
00066 ProActiveEvent event) {
00067 RuntimeRegistrationEvent runtimeRegistrationEvent = (RuntimeRegistrationEvent) event;
00068 RuntimeRegistrationEventListener runtimeRegistrationEventListener = (RuntimeRegistrationEventListener) proActiveListener;
00069
00070
00071 runtimeRegistrationEventListener.runtimeRegistered(runtimeRegistrationEvent);
00072 }
00073
00074
00075
00076
00077 protected void notifyListeners(ProActiveRuntime proActiveRuntime, int type,
00078 ProActiveRuntime registeredRuntime, String creatorID, String protocol,
00079 String vmName) {
00080 if (hasListeners()) {
00081 notifyAllListeners(new RuntimeRegistrationEvent(proActiveRuntime,
00082 type, registeredRuntime, creatorID, protocol, vmName));
00083 } else {
00084 if (logger.isDebugEnabled()) {
00085 logger.debug("no listener");
00086 }
00087 }
00088 }
00089 }