当前位置: 首页>>代码示例>>Java>>正文


Java Session类代码示例

本文整理汇总了Java中lucee.runtime.type.scope.Session的典型用法代码示例。如果您正苦于以下问题:Java Session类的具体用法?Java Session怎么用?Java Session使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Session类属于lucee.runtime.type.scope包,在下文中一共展示了Session类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getInstance

import lucee.runtime.type.scope.Session; //导入依赖的package包/类
/**
 * load an new instance of the client datasource scope
 * @param cacheName 
 * @param appName
 * @param pc
 * @return client datasource scope
 * @throws PageException
 */
public synchronized static Session getInstance(String cacheName, String appName, PageContext pc, Session existing, Log log) throws PageException {
	StorageValue sv = _loadData(pc, cacheName, appName,"session", log);
	if(appName!=null && appName.startsWith("no-in-memory-cache-")) existing=null;
	if(sv!=null) {
		long time = sv.lastModified();
		
		if(existing instanceof StorageScopeCache) {
			if(((StorageScopeCache)existing).lastModified()>=time) {
				return existing;
			}
		}
		return new SessionCache(pc,cacheName,appName,sv.getValue(),time);
	}
	else if(existing!=null) {
		return  existing;
	}
	
	SessionCache session = new SessionCache(pc,cacheName,appName,new StructImpl(),0);
	session.store(pc.getConfig());
	return session;
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:30,代码来源:SessionCache.java

示例2: getInstance

import lucee.runtime.type.scope.Session; //导入依赖的package包/类
/**
 * load an new instance of the client datasource scope
 * @param cacheName 
 * @param appName
 * @param pc
 * @return client datasource scope
 * @throws PageException
 */
public synchronized static Session getInstance(String cacheName, String appName, PageContext pc, Session existing, Log log) throws PageException {
	StorageValue sv = _loadData(pc, cacheName, appName,"session", log);
	if(appName!=null && appName.startsWith("no-in-memory-cache-")) existing=null;
	if(sv!=null) {
		long time = sv.lastModified();
		
		if(existing instanceof StorageScopeCache) {
			if(((StorageScopeCache)existing).lastModified()>=time) {
				return existing;
			}
		}
		return new SessionCache(pc,cacheName,appName,sv.getValue(),time);
	}
	else if(existing!=null) {
		return  existing;
	}

	SessionCache session = new SessionCache(pc,cacheName,appName,new StructImpl(),0);
	session.store(pc);
	return session;
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:30,代码来源:SessionCache.java

示例3: getInstance

import lucee.runtime.type.scope.Session; //导入依赖的package包/类
public static Session getInstance(String datasourceName, PageContext pc, Log log,Session defaultValue) {
	try {
		return getInstance(datasourceName, pc,log);
	}
	catch (PageException e) {}
	return defaultValue;
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:8,代码来源:SessionDatasource.java

示例4: getInstance

import lucee.runtime.type.scope.Session; //导入依赖的package包/类
/**
 * load new instance of the class
 * @param name
 * @param pc
 * @return
 */
public static Session getInstance(String name, PageContext pc,Log log) {
	if(!StringUtil.isEmpty(name))
		name=StringUtil.toUpperCase(StringUtil.toVariableName(name));
	String cookieName="CF_"+TYPE+"_"+name;
	return new SessionCookie(pc,cookieName, _loadData(pc,cookieName,SCOPE_SESSION,"session",log));
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:13,代码来源:SessionCookie.java

示例5: sessionScope

import lucee.runtime.type.scope.Session; //导入依赖的package包/类
public Session sessionScope(boolean checkExpires) throws PageException {
	if(session==null)	{
		checkSessionContext();
		session=scopeContext.getSessionScope(this,DUMMY_BOOL);
	}
	return session;
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:8,代码来源:PageContextImpl.java

示例6: getInstance

import lucee.runtime.type.scope.Session; //导入依赖的package包/类
public static Scope getInstance(int scope, IKHandler handler, String appName, String name, PageContext pc, Session existing, Log log, Session defaultValue) {
	try {
		return getInstance(scope, handler, appName, name, pc,existing, log);
	}
	catch (PageException e) {}
	return defaultValue;
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:8,代码来源:IKStorageScopeSupport.java

示例7: getStorageScope

import lucee.runtime.type.scope.Session; //导入依赖的package包/类
public static StorageScope getStorageScope(PageContext pc) throws PageException {
	Session session = pc.sessionScope();
	if(!(session instanceof StorageScope))
		throw new ExpressionException("this function only works with CF Sessions");
	return (StorageScope) session;
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:7,代码来源:CSRFGenerateToken.java

示例8: getInstance

import lucee.runtime.type.scope.Session; //导入依赖的package包/类
/**
 * load new instance of the class
 * @param name
 * @param pc
 * @param checkExpires 
 * @return
 */
public static Session getInstance(String name, PageContext pc,Log log) {

	Resource res=_loadResource(pc.getConfig(),SCOPE_SESSION,name,pc.getCFID());
	Struct data=_loadData(pc,res,log);
	return new SessionFile(pc,res,data);
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:14,代码来源:SessionFile.java

示例9: sessionScope

import lucee.runtime.type.scope.Session; //导入依赖的package包/类
/**
 * @return session scope
 * @throws PageException
 */
public abstract Session sessionScope() throws PageException;
 
开发者ID:lucee,项目名称:Lucee4,代码行数:6,代码来源:PageContext.java

示例10: getInstance

import lucee.runtime.type.scope.Session; //导入依赖的package包/类
/**
 * load a new instance of the class
 * @param pc
 * @param isNew 
 * @return
 */
public static Session getInstance(PageContext pc, RefBoolean isNew, Log log) {
	isNew.setValue(true);
	return new SessionMemory(pc,log);
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:11,代码来源:SessionMemory.java


注:本文中的lucee.runtime.type.scope.Session类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。