fr/dyade/aaa/jndi2/server/AgentRequestContext.java

00001 /*
00002  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
00003  * Copyright (C) 2001 - 2003 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): Sofiane Chibani
00021  * Contributor(s): David Feliot, Nicolas Tachker
00022  */
00023 package fr.dyade.aaa.jndi2.server;
00024 
00025 import fr.dyade.aaa.agent.*;
00026 import fr.dyade.aaa.jndi2.msg.*;
00027 
00028 public class AgentRequestContext 
00029     extends RequestContext {
00030 
00034   private static final long serialVersionUID = 1L;
00035 
00036   private JndiRequest request;
00037 
00038   private AgentId from;
00039 
00040   private boolean doReply;
00041 
00042   public AgentRequestContext(JndiRequest request,
00043                              AgentId from,
00044                              boolean doReply) {
00045     this.request = request;
00046     this.from = from;
00047     this.doReply = doReply;
00048   }
00049 
00050   public AgentId getFrom() {
00051     return from;
00052   }
00053 
00054   public JndiRequest getRequest() {
00055     return request;
00056   }
00057 
00058   public void reply(JndiReply reply) {
00059     if (doReply) {
00060       Channel.sendTo(
00061         from, new JndiReplyNot(request, reply));
00062     }
00063   }
00064 }

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