1 31 package org.objectweb.proactive.core.event; 32 33 import org.objectweb.proactive.core.runtime.ProActiveRuntime; 34 35 public class RuntimeRegistrationEventProducerImpl 36 37 38 39 extends AbstractEventProducer 40 implements RuntimeRegistrationEventProducer 41 { 42 43 44 45 51 public void addRuntimeRegistrationEventListener(RuntimeRegistrationEventListener listener){ 52 addListener(listener); 53 } 54 55 56 59 public void removeRuntimeRegistrationEventListener(RuntimeRegistrationEventListener listener){ 60 removeListener(listener); 61 } 62 63 69 protected void notifyOneListener(ProActiveListener proActiveListener, ProActiveEvent event){ 70 RuntimeRegistrationEvent runtimeRegistrationEvent = (RuntimeRegistrationEvent) event; 71 RuntimeRegistrationEventListener runtimeRegistrationEventListener = (RuntimeRegistrationEventListener)proActiveListener; 72 runtimeRegistrationEventListener.runtimeRegistered(runtimeRegistrationEvent); 74 } 75 76 protected void notifyListeners(ProActiveRuntime proActiveRuntime,int type,String registeredRuntimeName, String creatorID, String protocol,String vmName){ 80 if (hasListeners()){ 81 notifyAllListeners(new RuntimeRegistrationEvent(proActiveRuntime, type, registeredRuntimeName, creatorID, protocol,vmName)); 82 } 83 84 else { 85 if (logger.isDebugEnabled()) { 86 logger.debug("no listener"); 87 } 88 } 89 } 90 } 91 | Popular Tags |