本文整理匯總了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);
}