00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 package com.scalagent.joram.mom.dest.scheduler;
00024
00025 import java.util.Properties;
00026
00027 import org.objectweb.joram.mom.dest.DestinationImpl;
00028 import org.objectweb.joram.mom.dest.Queue;
00029 import org.objectweb.util.monolog.api.BasicLevel;
00030 import org.objectweb.util.monolog.api.Logger;
00031
00032 import com.scalagent.scheduler.Condition;
00033
00034 import fr.dyade.aaa.agent.AgentId;
00035 import fr.dyade.aaa.agent.Debug;
00036 import fr.dyade.aaa.agent.Notification;
00037
00038 public class SchedulerQueue extends Queue {
00040 private static final long serialVersionUID = 1L;
00041
00042 public static Logger logger = Debug.getLogger(SchedulerQueue.class.getName());
00043
00044 public static final String QUEUE_SCHEDULER_TYPE = "queue_scheduler";
00045
00046 public static String getDestinationType() {
00047 return QUEUE_SCHEDULER_TYPE;
00048 }
00049
00050 public static void init(String args, boolean firstTime) throws Exception {
00051 if (! firstTime) return;
00052 }
00053
00057 public SchedulerQueue() {}
00058
00065 public DestinationImpl createsImpl(AgentId adminId, Properties prop) {
00066 return new SchedulerQueueImpl(adminId, prop);
00067 }
00068
00069 public void react(AgentId from, Notification not)
00070 throws Exception {
00071 if (logger.isLoggable(BasicLevel.DEBUG))
00072 logger.log(BasicLevel.DEBUG,
00073 "SchedulerQueue.react(" + from + ',' + not + ')');
00074 if (not instanceof Condition) {
00075 ((SchedulerQueueImpl) destImpl).condition((Condition) not);
00076 } else
00077 super.react(from, not);
00078 }
00079 }
00080