1 24 25 package org.objectweb.dream.queue; 26 27 import java.util.Map ; 28 29 import org.objectweb.dream.AbstractComponent; 30 import org.objectweb.dream.InterruptedPushException; 31 import org.objectweb.dream.Push; 32 import org.objectweb.dream.PushException; 33 import org.objectweb.dream.message.Message; 34 import org.objectweb.fractal.api.NoSuchInterfaceException; 35 import org.objectweb.fractal.api.control.IllegalBindingException; 36 import org.objectweb.fractal.api.control.IllegalLifeCycleException; 37 38 41 public class PushIncomingHandlerImpl extends AbstractComponent implements Push 42 { 43 44 protected Buffer bufferItf; 46 47 51 55 public void push(Message message, Map context) throws PushException 56 { 57 try 58 { 59 bufferItf.add(message); 60 } 61 catch (InterruptedException e) 62 { 63 throw new InterruptedPushException("Interrupted while adding a message", 64 e); 65 } 66 } 67 68 72 76 public synchronized void bindFc(String clientItfName, Object serverItf) 77 throws NoSuchInterfaceException, IllegalBindingException, 78 IllegalLifeCycleException 79 { 80 super.bindFc(clientItfName, serverItf); 81 if (clientItfName.equals(Buffer.ITF_NAME)) 82 { 83 bufferItf = (Buffer) serverItf; 84 } 85 } 86 87 90 public String [] listFc() 91 { 92 return new String []{Buffer.ITF_NAME}; 93 } 94 95 } | Popular Tags |