当前位置: 首页 > news >正文

关于做女装的网站西地那非片有依赖性吗

关于做女装的网站,西地那非片有依赖性吗,定制高端网站建设企业,网站制作有限做web开发的肯定都知道#xff0c;cookie和session。不过刚开始#xff0c;很多人都只是停留在概念上的理解。今天就以看得见的方式再理解一下session。通过查看tomcat源码#xff0c;可以发现sessions就是一个ConcurrentHashMap。 StandardManger负责管理session的生命周期… 做web开发的肯定都知道cookie和session。不过刚开始很多人都只是停留在概念上的理解。今天就以看得见的方式再理解一下session。通过查看tomcat源码可以发现sessions就是一个ConcurrentHashMap。 StandardManger负责管理session的生命周期。如session过期了就把它清除掉。tomcat关闭时把session信息持久化到硬盘上。tomcat启动时就把session信息加载进内存。StandardManager.doUnload方法在tomcat关闭时被调用看一下方法的逻辑 /*** Save any currently active sessions in the appropriate persistence* mechanism, if any. If persistence is not supported, this method* returns without doing anything.** exception IOException if an input/output error occurs*/protected void doUnload() throws IOException {if (log.isDebugEnabled())log.debug(Unloading persisted sessions);// Open an output stream to the specified pathname, if anyFile file file();if (file null)return;if (log.isDebugEnabled())log.debug(sm.getString(standardManager.unloading, pathname));FileOutputStream fos null;ObjectOutputStream oos null;try {fos new FileOutputStream(file.getAbsolutePath());oos new ObjectOutputStream(new BufferedOutputStream(fos));} catch (IOException e) {log.error(sm.getString(standardManager.unloading.ioe, e), e);if (oos ! null) {try {oos.close();} catch (IOException f) {;}oos null;}throw e;}// Write the number of active sessions, followed by the detailsArrayList list new ArrayList();synchronized (sessions) {if (log.isDebugEnabled())log.debug(Unloading sessions.size() sessions);try {oos.writeObject(new Integer(sessions.size()));Iterator elements sessions.values().iterator();while (elements.hasNext()) {StandardSession session (StandardSession) elements.next();list.add(session);((StandardSession) session).passivate();session.writeObjectData(oos);}} catch (IOException e) {log.error(sm.getString(standardManager.unloading.ioe, e), e);if (oos ! null) {try {oos.close();} catch (IOException f) {;}oos null;}throw e;}}// Flush and close the output streamtry {oos.flush();oos.close();oos null;} catch (IOException e) {if (oos ! null) {try {oos.close();} catch (IOException f) {;}oos null;}throw e;}// Expire all the sessions we just wroteif (log.isDebugEnabled())log.debug(Expiring list.size() persisted sessions);Iterator expires list.iterator();while (expires.hasNext()) {StandardSession session (StandardSession) expires.next();try {session.expire(false);} catch (Throwable t) {;} finally {session.recycle();}}if (log.isDebugEnabled())log.debug(Unloading complete);} 逻辑很简单就是通过文件流将sessions写到硬盘上。这个文件到底是什么样子的呢可以通过tomcat自带的host-manager来看一下打开${tomcat_root}/work/Catalina/${host}/host-manager路径SESSIONS.ser就存储着session中的数据。tomcat启动完成后会自动删除这个文件。如下图 tomcat启动的时候会把读取这个文件恢复sessions。 /*** Load any currently active sessions that were previously unloaded* to the appropriate persistence mechanism, if any. If persistence is not* supported, this method returns without doing anything.** exception ClassNotFoundException if a serialized class cannot be* found during the reload* exception IOException if an input/output error occurs*/protected void doLoad() throws ClassNotFoundException, IOException {if (log.isDebugEnabled())log.debug(Start: Loading persisted sessions);// Initialize our internal data structuressessions.clear();// Open an input stream to the specified pathname, if anyFile file file();if (file null)return;if (log.isDebugEnabled())log.debug(sm.getString(standardManager.loading, pathname));FileInputStream fis null;ObjectInputStream ois null;Loader loader null;ClassLoader classLoader null;try {fis new FileInputStream(file.getAbsolutePath());BufferedInputStream bis new BufferedInputStream(fis);if (container ! null)loader container.getLoader();if (loader ! null)classLoader loader.getClassLoader();if (classLoader ! null) {if (log.isDebugEnabled())log.debug(Creating custom object input stream for class loader );ois new CustomObjectInputStream(bis, classLoader);} else {if (log.isDebugEnabled())log.debug(Creating standard object input stream);ois new ObjectInputStream(bis);}} catch (FileNotFoundException e) {if (log.isDebugEnabled())log.debug(No persisted data file found);return;} catch (IOException e) {log.error(sm.getString(standardManager.loading.ioe, e), e);if (ois ! null) {try {ois.close();} catch (IOException f) {;}ois null;}throw e;}// Load the previously unloaded active sessionssynchronized (sessions) {try {Integer count (Integer) ois.readObject();int n count.intValue();if (log.isDebugEnabled())log.debug(Loading n persisted sessions);for (int i 0; i n; i) {StandardSession session getNewSession();session.readObjectData(ois);session.setManager(this);sessions.put(session.getIdInternal(), session);session.activate();session.endAccess();}} catch (ClassNotFoundException e) {log.error(sm.getString(standardManager.loading.cnfe, e), e);if (ois ! null) {try {ois.close();} catch (IOException f) {;}ois null;}throw e;} catch (IOException e) {log.error(sm.getString(standardManager.loading.ioe, e), e);if (ois ! null) {try {ois.close();} catch (IOException f) {;}ois null;}throw e;} finally {// Close the input streamtry {if (ois ! null)ois.close();} catch (IOException f) {// ignored}// Delete the persistent storage fileif (file ! null file.exists() )file.delete();}}if (log.isDebugEnabled())log.debug(Finish: Loading persisted sessions);} 以上整体的逻辑就是通过文件流读取SESSIONS.ser并恢复sessions。我这里提到的启动、关闭tomcat是指通过startup、shutdown命令。如果直接kill掉tomcat进程以上操作还没来得及执行进程就挂掉了。
http://www.hkea.cn/news/14463023/

相关文章:

  • 企业网站建设用什么电子商务网站建设与维护pdf
  • 夫妻性做受视频什么网站德州市市政工程建设总公司网站
  • 网站建设与推广员岗位职责技能网站建设项目需求
  • 湘潭企业网站建设给自己的网站做镜像网站
  • 可以做商品砍价的网站网站建设的公司上海
  • 郑州直播网站建设公司网站开发竞争性谈判
  • 成都电子商务平台网站制作报价旅游网站的后台管理系统怎么做
  • 代做网站名称优化wordpress 上传漏洞
  • 国外网站大牛不懂英语可以做吗wordpress弹窗登入
  • 福建省 园区网互联及网站建设 网络部分题目标书制作教程
  • wordpress两侧有空白夫唯老师seo
  • 建站宝盒里的手机网站用猴子做标志起网站名叫什么好
  • 北京网站建设w亿玛酷1订制wordpress html地图
  • 东莞微信网站建设报价做做网站需要多少钱
  • 网站建设的项目描述企业管理培训课程名称
  • 企业品牌网站建设定制开发广西网站建设设计
  • 宁波高端网站建设推广北京快速建站模板
  • 免费云服务器网站有哪些嘉峪关市建设局建管科资质网站
  • 网站建设的出路wordpress加载js代码
  • 保健品网站设计机构wordpress免费主题库
  • 最快网站备案可以免费发布信息的网站有哪些
  • phpcms v9 网站建设设计制作网络科技模板网站开发学习课程
  • 东莞网站建设地点优化深圳罗湖企业网站建设报价
  • 南京网站排名网站建站是什么
  • 网站推广论坛wordpress authentication key
  • vultr 做网站空间优化设计英语
  • 国内网站有哪些wordpress茶叶模板
  • 网站开发机构wordpress会话已过期
  • 网站服务器物理地址怎么查泰兴做网站
  • 中国建设银行安徽分行网站自适应网站做1920的