1 24 25 package queues; 26 27 import java.util.Map ; 28 29 import org.objectweb.dream.AbstractComponent; 30 import org.objectweb.dream.Push; 31 import org.objectweb.dream.PushException; 32 import org.objectweb.dream.message.Message; 33 import org.objectweb.dream.message.manager.MessageManager; 34 import org.objectweb.fractal.api.NoSuchInterfaceException; 35 import org.objectweb.fractal.api.control.IllegalBindingException; 36 import org.objectweb.fractal.api.control.IllegalLifeCycleException; 37 import org.objectweb.util.monolog.api.BasicLevel; 38 39 42 public class PushSinkImpl extends AbstractComponent implements Push 43 { 44 45 MessageManager messageManagerItf; 46 47 51 55 public void push(Message message, Map context) throws PushException 56 { 57 logger.log(BasicLevel.INFO, "received message " + message); 58 messageManagerItf.deleteMessage(message); 59 60 } 61 62 66 70 public synchronized void bindFc(String clientItfName, Object serverItf) 71 throws NoSuchInterfaceException, IllegalBindingException, 72 IllegalLifeCycleException 73 { 74 super.bindFc(clientItfName, serverItf); 75 if (clientItfName.equals(MessageManager.ITF_NAME)) 76 { 77 messageManagerItf = (MessageManager) serverItf; 78 } 79 } 80 81 84 public String [] listFc() 85 { 86 return new String []{MessageManager.ITF_NAME}; 87 } 88 89 } | Popular Tags |