📄 rmisession.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: RMISession.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 java.io.*;import java.rmi.*;import java.rmi.server.*;import org.apache.log4j.Logger;/** This class implements a RMI connection to the AccessServer. * @version $Revision: 1.7 $ $Date: 2003/04/13 21:13:38 $ */public class RMISession extends UnicastRemoteObject implements RMISessionIf{ /** CVS Version Tag */ private static final String vcid = "$Id: RMISession.java,v 1.7 2003/04/13 21:13:38 joerg Exp $"; private Logger logger = Logger.getLogger(this.getClass()); private boolean verifyUser = true; private String user = null; private ExpressionEvaluator evaluator = new ExpressionEvaluator(); /** Creates a new instance of RMISession * @param user the name of the for whom the the new session will be used. * @throws RemoteException if an RMI error occurs. */ public RMISession(String user) throws RemoteException { this.user = user; } /** Evaluates one expression. * @param expr the expression to evaluate * @throws RemoteException if an RMI error occurs. * @throws RMIParserException if a ParserException occurs on the server side. * @return true if the user is member of the set described by the expression and false * otherwise. */ public boolean resolveExpr(String expr) throws RemoteException, ParserException { boolean answer = false; logger.info("Evaluating <" + expr + "> for user <" + user + ">"); long t = System.currentTimeMillis(); answer = evaluator.evaluateExpression(user, expr); t = System.currentTimeMillis() - t; logger.info("Answer = <" + answer + ">, ellapsed Time = " + t + "ms"); return answer; }}/** * $Log: RMISession.java,v $ * Revision 1.7 2003/04/13 21:13:38 joerg * Copyright statements changed to LGPL * * Revision 1.6 2003/04/13 21:09:56 joerg * Package structure modified * * Revision 1.5 2003/04/13 20:49:09 joerg * Package structure modified * * Revision 1.4 2003/04/13 20:28:01 joerg * Package structure modified * * Revision 1.3 2003/04/13 20:16:42 joerg * Package structure modified * * Revision 1.2 2003/04/07 20:08:49 joerg * Improved JavaDoc. * * Revision 1.1 2003/03/30 20:44:16 joerg * Ongoing development * */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -