1 26 package org.objectweb.openccm.explorer.Components; 27 28 import org.objectweb.util.explorer.api.DropAction; 29 import org.objectweb.util.explorer.api.DropTreeView; 30 import org.omg.Components.PublisherDescription; 31 import org.omg.Components.CCMObject; 32 import org.omg.Components.ConsumerDescription; 33 34 35 43 public class SubscribeOnDropAction 44 implements DropAction { 45 46 52 58 64 70 73 public void execute(DropTreeView dropTreeView) throws Exception { 74 if(dropTreeView!=null){ 75 ConsumerDescription consumer = (ConsumerDescription) dropTreeView.getDragSourceObject(); 76 PublisherContainer pc = (PublisherContainer) dropTreeView.getSelectedObject(); 77 PublisherDescription publisher = pc.getPublisher(); 78 CCMObject component = pc.getComponent(); 79 if (component != null && publisher != null && consumer != null) { 80 component.subscribe(publisher.name, consumer.consumer); 81 } 82 } 83 } 84 85 } | Popular Tags |