本文整理匯總了Java中org.apache.wicket.Session.get方法的典型用法代碼示例。如果您正苦於以下問題:Java Session.get方法的具體用法?Java Session.get怎麽用?Java Session.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.Session
的用法示例。
在下文中一共展示了Session.get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: acquireLock
import org.apache.wicket.Session; //導入方法依賴的package包/類
protected boolean acquireLock() {
// create lock id and lock key
OntopolySession session = (OntopolySession)Session.get();
String lockerId = session.getLockerId(getRequest());
LockManager.Lock lock = session.lock((Topic)getDefaultModelObject(), lockerId);
this.lockedBy = lock.getLockedBy();
this.lockedAt = new Date(lock.getLockTime()).toString();
this.lockKey = lock.getLockKey();
if (!lock.ownedBy(lockerId)) {
this.lockedByOther = true;
//! System.out.println("Got lock: false: " + lock);
return false;
} else {
//! System.out.println("Got lock: true" + lock);
return true;
}
}
示例2: getLocale
import org.apache.wicket.Session; //導入方法依賴的package包/類
protected Locale getLocale() {
try {
final Session session = Session.get();
if (session != null) {
return session.getLocale();
}
} catch (WicketRuntimeException ex) {
logger.info("No session available, falling back to JVM default locale");
}
return Locale.getDefault();
}
示例3: getUserDisplayName
import org.apache.wicket.Session; //導入方法依賴的package包/類
protected String getUserDisplayName() {
Session session = Session.get();
if (session instanceof SingularSession) {
return SingularSession.get().getUserDetails().getDisplayName();
}
return "";
}
示例4: getSelectedCategoryOrAll
import org.apache.wicket.Session; //導入方法依賴的package包/類
protected List<ModuleEntity> getSelectedCategoryOrAll() {
if (SingularSession.exists() && Session.get() instanceof SingularSession) {
final ModuleEntity categoriaSelecionada = SingularSession.get().getCategoriaSelecionada();
if (categoriaSelecionada == null && menuService != null) {
return menuService.getCategories();
} else {
return Collections.singletonList(categoriaSelecionada);
}
}
return Collections.emptyList();
}
示例5: open
import org.apache.wicket.Session; //導入方法依賴的package包/類
@Override
public ITearDownHandle open() {
Session session = Session.get();
final Locale oldLocale = session.getLocale();
if (locale == null || locale.equals(oldLocale)) {
return ExecutionContexts.noOp().open();
}
ITearDownHandle handle = new ITearDownHandle() {
@Override
public void close() {
Session.get().setLocale(oldLocale);
}
};
try {
session.setLocale(locale);
return handle;
} catch (RuntimeException e) {
try {
handle.close();
} catch (RuntimeException e2) {
e.addSuppressed(e2);
}
throw e;
}
}
示例6: onBeginRequest
import org.apache.wicket.Session; //導入方法依賴的package包/類
/**
* Init of user for wdm-core ActionContext and call parentMethod
*/
@Override
public void onBeginRequest(RequestCycle cycle) {
if (manageStatistics != null && manageStatistics.isStatEnable() && isRequestAMainPage(cycle)) {
statsSnapshotId = manageStatistics.startSnapshot(cycle.getRequest().getUrl().getPath()); // request.getPath());
}
if (cycle.getRequest() != null) {
try {
WicketSession wicketSession = (WicketSession) Session.get();
if (wicketSession.getPaasUser() != null) {
MDC.put(LOG_KEY_USER, wicketSession.getPaasUser().getSsoId().getValue());
MDC.put(LOG_KEY_USERNAME, wicketSession.getPaasUser().getFirstName());
MDC.put(LOG_KEY_SESSION, wicketSession.getId());
}
} catch (Exception e) {
// Ignore it
}
final int requestId = nextRequestId();
logger.trace("Setting MDC-requestId param to {}", requestId);
MDC.put("requestId", requestId + "");
if (cycle.getRequest().getUrl() != null) {
String urlPath = cycle.getRequest().getUrl().getPath();
logger.trace("Setting MDC-page param to {}", urlPath);
MDC.put("page", urlPath);
String url = cycle.getRequest().getUrl().toString();
logger.trace("Setting MDC-url param to {}", url);
MDC.put("url", url);
}
}
}
示例7: getSession
import org.apache.wicket.Session; //導入方法依賴的package包/類
public static MidPointAuthWebSession getSession() {
return (MidPointAuthWebSession) Session.get();
}
示例8: get
import org.apache.wicket.Session; //導入方法依賴的package包/類
public static SingularSession get() {
return (SingularSession) Session.get();
}
示例9: get
import org.apache.wicket.Session; //導入方法依賴的package包/類
public static IntercloudWebSession get() {
return (IntercloudWebSession) Session.get();
}
示例10: get
import org.apache.wicket.Session; //導入方法依賴的package包/類
public static BasicApplicationSession get() {
return (BasicApplicationSession) Session.get();
}
示例11: get
import org.apache.wicket.Session; //導入方法依賴的package包/類
public static ShowcaseSession get() {
return (ShowcaseSession) Session.get();
}
示例12: get
import org.apache.wicket.Session; //導入方法依賴的package包/類
public static AbstractCoreSession<?> get() {
return (AbstractCoreSession<?>) Session.get();
}
示例13: get
import org.apache.wicket.Session; //導入方法依賴的package包/類
public static SyncopeSession get() {
return (SyncopeSession) Session.get();
}
示例14: get
import org.apache.wicket.Session; //導入方法依賴的package包/類
/**
* @return Current WebAnno web session
*/
public static ApplicationSession get()
{
return (ApplicationSession) Session.get();
}
示例15: get
import org.apache.wicket.Session; //導入方法依賴的package包/類
public static MySession get()
{
return (MySession) Session.get();
}