com/scalagent/joram/mom/dest/scheduler/SchedulerQueue.java

00001 /*
00002  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
00003  * Copyright (C) 2005 - 2008 ScalAgent Distributed Technologies
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2.1 of the License, or any later version.
00009  * 
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00018  * USA.
00019  *
00020  * Initial developer(s): ScalAgent Distributed Technologies
00021  * Contributor(s): 
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 

Generated on Tue Sep 16 16:14:23 2008 for joram by  doxygen 1.5.0