本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例9: sessionScope
import lucee.runtime.type.scope.Session; //导入依赖的package包/类
/**
* @return session scope
* @throws PageException
*/
public abstract Session sessionScope() throws PageException;
示例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);
}