⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sessionmap.java

📁 struts 2 核心包 的源码 有错误是难免的
💻 JAVA
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   SessionMap.java

package org.apache.struts2.dispatcher;

import java.io.Serializable;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class SessionMap extends AbstractMap
	implements Serializable
{

	private static final long serialVersionUID = 0x40ee97238192ac86L;
	protected HttpSession session;
	protected Set entries;
	protected HttpServletRequest request;

	public SessionMap(HttpServletRequest request)
	{
		this.request = request;
		session = request.getSession(false);
	}

	public void invalidate()
	{
		if (session == null)
			return;
		synchronized (session)
		{
			session.invalidate();
			session = null;
			entries = null;
		}
	}

	public void clear()
	{
		if (session == null)
			return;
		synchronized (session)
		{
			entries = null;
			for (Enumeration attributeNamesEnum = session.getAttributeNames(); attributeNamesEnum.hasMoreElements(); session.removeAttribute((String)attributeNamesEnum.nextElement()));
		}
	}

	public Set entrySet()
	{
		if (session == null)
			return Collections.EMPTY_SET;
		synchronized (session)
		{
			if (entries == null)
			{
				entries = new HashSet();
				final String key;
				final Object value;
				for (Enumeration enumeration = session.getAttributeNames(); enumeration.hasMoreElements(); entries.add(new java.util.Map.Entry() {

		final String val$key;
		final Object val$value;
		final SessionMap this$0;

		public boolean equals(Object obj)
		{
			java.util.Map.Entry entry = (java.util.Map.Entry)obj;
			return (key != null ? key.equals(entry.getKey()) : entry.getKey() == null) && (value != null ? value.equals(entry.getValue()) : entry.getValue() == null);
		}

		public int hashCode()
		{
			return (key != null ? key.hashCode() : 0) ^ (value != null ? value.hashCode() : 0);
		}

		public Object getKey()
		{
			return key;
		}

		public Object getValue()
		{
			return value;
		}

		public Object setValue(Object obj)
		{
			session.setAttribute(key.toString(), obj);
			return value;
		}

			
			{
				this$0 = SessionMap.this;
				key = s;
				value = obj;
				super();
			}
	}))
				{
					key = enumeration.nextElement().toString();
					value = session.getAttribute(key);
				}

			}
		}
		return entries;
	}

	public Object get(Object key)
	{
		if (session == null)
			return null;
		HttpSession httpsession = session;
		JVM INSTR monitorenter ;
		return session.getAttribute(key.toString());
		Exception exception;
		exception;
		throw exception;
	}

	public Object put(Object key, Object value)
	{
		synchronized (this)
		{
			if (session == null)
				session = request.getSession(true);
		}
		HttpSession httpsession = session;
		JVM INSTR monitorenter ;
		entries = null;
		session.setAttribute(key.toString(), value);
		return get(key);
		Exception exception1;
		exception1;
		throw exception1;
	}

	public Object remove(Object key)
	{
		if (session == null)
			return null;
		HttpSession httpsession = session;
		JVM INSTR monitorenter ;
		Object value;
		entries = null;
		value = get(key);
		session.removeAttribute(key.toString());
		return value;
		Exception exception;
		exception;
		throw exception;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -