📄 rmiserver.java
字号:
/******************************************************************************* * Copyright (C) 2002, 2003 * ingenieurbuero fuer innovative informationstechnik (iiit) * Dipl.-Ing. Joerg Beckmann, Dortmund, Germany * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * or look at http://www.gnu.org/copleft/lesser.html. * * version $Id: RMIServer.java,v 1.7 2003/04/13 21:13:38 joerg Exp $ ******************************************************************************/package de.iiit.access.common.rmi;import de.iiit.access.common.api.*;import de.iiit.access.server.*;import de.iiit.access.server.api.*;import de.iiit.xmlconfig.*;import org.apache.log4j.Logger;import java.rmi.*;import java.rmi.server.*;import java.rmi.registry.*;/** Implements a RMI server for requesting the AccessServer * @version $Revision: 1.7 $ $Date: 2003/04/13 21:13:38 $ */public class RMIServer extends UnicastRemoteObject implements RMIServerIf{ /** CVS Version Tag */ private static final String vcid = "$Id: RMIServer.java,v 1.7 2003/04/13 21:13:38 joerg Exp $"; private Logger logger = Logger.getLogger(this.getClass()); private boolean verifyUser = true; private ResolverPluginIf resolver = null; /** Creates a new instance of RmiServer * @throws RemoteException when anything goes wrong */ public RMIServer() throws RemoteException { logger.info("RMIServer intantiated."); verifyUser = AccessServer.getVerifyUser(); resolver = AccessServer.getResolverPlugin(); } /** Shuts down the server. * @throws RemoteException when anything goes wrong */ public void serverShutdown() throws RemoteException { logger.info("Shutdown command recognized"); AccessServer.shutDown(); } /** Returns a new RMI session for a distinct user. * @param user the name of the for whom the session will be used. * @throws RemoteException if there are any RMI errors. * @return the newly created session */ public RMISessionIf getSession(String user) throws RemoteException { RMISession result = null; boolean flag = true; if (verifyUser) { long t = System.currentTimeMillis(); flag = resolver.verifyUser(user); t = System.currentTimeMillis() - t; logger.info("User <" + user + "> verified, ellapsed Time = " + t + "ms"); } if (flag) { result = new RMISession(user); } return result; } }/** * $Log: RMIServer.java,v $ * Revision 1.7 2003/04/13 21:13:38 joerg * Copyright statements changed to LGPL * * Revision 1.6 2003/04/13 20:49:09 joerg * Package structure modified * * Revision 1.5 2003/04/13 20:28:01 joerg * Package structure modified * * Revision 1.4 2003/04/13 20:16:42 joerg * Package structure modified * * Revision 1.3 2003/04/07 20:08:49 joerg * Improved JavaDoc. * * Revision 1.2 2003/03/30 20:44:16 joerg * Ongoing development * * Revision 1.1 2003/03/27 20:39:46 joerg * New class RMIServer * */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -