1 23 package com.scalagent.joram.mom.dest.scheduler; 24 25 import java.util.Properties ; 26 27 import org.objectweb.joram.mom.dest.DestinationImpl; 28 import org.objectweb.joram.mom.dest.Queue; 29 import org.objectweb.util.monolog.api.BasicLevel; 30 31 import com.scalagent.scheduler.Condition; 32 33 import fr.dyade.aaa.agent.AgentId; 34 import fr.dyade.aaa.agent.Notification; 35 36 public class SchedulerQueue extends Queue { 37 public static final String QUEUE_SCHEDULER_TYPE = "queue_scheduler"; 38 39 public static String getDestinationType() { 40 return QUEUE_SCHEDULER_TYPE; 41 } 42 43 public static void init(String args, boolean firstTime) throws Exception { 44 if (! firstTime) return; 45 } 46 47 50 public SchedulerQueue() {} 51 52 58 public DestinationImpl createsImpl(AgentId adminId, Properties prop) { 59 return new SchedulerQueueImpl(getId(), adminId, prop); 60 } 61 62 public void react(AgentId from, Notification not) 63 throws Exception { 64 if (logger.isLoggable(BasicLevel.DEBUG)) 65 logger.log(BasicLevel.DEBUG, 66 "SchedulerQueue.react(" + from + ',' + not + ')'); 67 if (not instanceof Condition) { 68 ((SchedulerQueueImpl) destImpl).condition((Condition) not); 69 } else 70 super.react(from, not); 71 } 72 } 73 74 | Popular Tags |