com/scalagent/joram/mom/dest/ftp/FtpQueue.java

00001 /*
00002  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
00003  * Copyright (C) 2001 - 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): Nicolas Tachker (ScalAgent)
00021  * Contributor(s): 
00022  */
00023 package com.scalagent.joram.mom.dest.ftp;
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 fr.dyade.aaa.agent.AgentId;
00033 import fr.dyade.aaa.agent.Debug;
00034 import fr.dyade.aaa.agent.Notification;
00035 
00042 public class FtpQueue extends Queue {
00044   private static final long serialVersionUID = 1L;
00045 
00046   public static Logger logger = Debug.getLogger(FtpQueue.class.getName());
00047 
00048   public static final String FTP_QUEUE_TYPE = "queue.ftp";
00049 
00050   public static String getDestinationType() {
00051     return FTP_QUEUE_TYPE;
00052   }
00053 
00057   public FtpQueue() {}
00058 
00065   public DestinationImpl createsImpl(AgentId adminId, Properties prop) {
00066     return new FtpQueueImpl(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           "FtpQueue.react(" + from + ',' + not + ')');
00074     if (not instanceof FtpNot) {
00075       ((FtpQueueImpl) destImpl).ftpNot((FtpNot) not);
00076     } else
00077       super.react(from, not);
00078   }
00079 }

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