1 24 25 package org.objectweb.dream.exception; 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.fractal.api.NoSuchInterfaceException; 34 import org.objectweb.fractal.api.control.IllegalBindingException; 35 import org.objectweb.fractal.api.control.IllegalLifeCycleException; 36 import org.objectweb.util.monolog.api.BasicLevel; 37 38 43 public class RetryPushImpl extends AbstractComponent implements Push 44 { 45 46 50 protected Push outPushItf; 51 52 56 59 public void push(Message message, Map context) throws PushException 60 { 61 try 62 { 63 outPushItf.push(message, context); 64 } 65 catch (PushException e) 66 { 67 logger.log(BasicLevel.INFO, "Catched Push Exception retry immediatly. ", 68 e); 69 outPushItf.push(message, context); 70 } 71 } 72 73 77 80 public String [] listFc() 81 { 82 return new String []{Push.OUT_PUSH_ITF_NAME}; 83 } 84 85 89 public void bindFc(String clientItfName, Object serverItf) 90 throws NoSuchInterfaceException, IllegalBindingException, 91 IllegalLifeCycleException 92 { 93 super.bindFc(clientItfName, serverItf); 94 if (clientItfName.equals(Push.OUT_PUSH_ITF_NAME)) 95 { 96 outPushItf = (Push) serverItf; 97 } 98 } 99 } | Popular Tags |