1 23 package fr.dyade.aaa.jndi2.server; 24 25 import fr.dyade.aaa.agent.*; 26 import fr.dyade.aaa.jndi2.msg.*; 27 28 import org.objectweb.util.monolog.api.BasicLevel; 29 import org.objectweb.util.monolog.api.Logger; 30 31 public class TcpEntryPoint implements EntryPoint { 32 33 private RequestManager manager; 34 35 public void setRequestManager(RequestManager manager) { 36 this.manager = manager; 37 } 38 39 public boolean accept(AgentId from, Notification not) throws Exception { 40 if (not instanceof TcpRequestNot) { 41 doReact((TcpRequestNot)not); 42 } else return false; 43 return true; 44 } 45 46 52 private void doReact(TcpRequestNot not) throws Exception { 53 if (Trace.logger.isLoggable(BasicLevel.DEBUG)) 54 Trace.logger.log(BasicLevel.DEBUG, 55 "JndiServer.doReact((TcpRequestNot)" + 56 not + ')'); 57 RequestContext reqCtx = not.getRequestContext(); 58 JndiReply reply = manager.invoke(reqCtx); 59 if (reply != null) { 60 reqCtx.reply(reply); 61 } 62 } 63 } 64 | Popular Tags |