當前位置: 首頁>>代碼示例>>Java>>正文


Java Session.get方法代碼示例

本文整理匯總了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;
  }
}
 
開發者ID:ontopia,項目名稱:ontopia,代碼行數:18,代碼來源:LockPanel.java

示例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();
}
 
開發者ID:acdh-oeaw,項目名稱:vlo-curation,代碼行數:12,代碼來源:FacetFieldValuesProvider.java

示例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 "";
}
 
開發者ID:opensingular,項目名稱:singular-server,代碼行數:8,代碼來源:AbstractFormPage.java

示例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();
}
 
開發者ID:opensingular,項目名稱:singular-server,代碼行數:12,代碼來源:Menu.java

示例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;
	}
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:29,代碼來源:WicketContextProviderImpl.java

示例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);
		}
	}
}
 
開發者ID:orange-cloudfoundry,項目名稱:elpaaso-core,代碼行數:33,代碼來源:ExecutionHandlerRequestCycle.java

示例7: getSession

import org.apache.wicket.Session; //導入方法依賴的package包/類
public static MidPointAuthWebSession getSession() {
    return (MidPointAuthWebSession) Session.get();
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:4,代碼來源:MidPointAuthWebSession.java

示例8: get

import org.apache.wicket.Session; //導入方法依賴的package包/類
public static SingularSession get() {
    return (SingularSession) Session.get();
}
 
開發者ID:opensingular,項目名稱:singular-server,代碼行數:4,代碼來源:SingularSession.java

示例9: get

import org.apache.wicket.Session; //導入方法依賴的package包/類
public static IntercloudWebSession get() {
    return (IntercloudWebSession) Session.get();
}
 
開發者ID:citlab,項目名稱:Intercloud,代碼行數:4,代碼來源:IntercloudWebSession.java

示例10: get

import org.apache.wicket.Session; //導入方法依賴的package包/類
public static BasicApplicationSession get() {
	return (BasicApplicationSession) Session.get();
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:4,代碼來源:BasicApplicationSession.java

示例11: get

import org.apache.wicket.Session; //導入方法依賴的package包/類
public static ShowcaseSession get() {
	return (ShowcaseSession) Session.get();
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:4,代碼來源:ShowcaseSession.java

示例12: get

import org.apache.wicket.Session; //導入方法依賴的package包/類
public static AbstractCoreSession<?> get() {
	return (AbstractCoreSession<?>) Session.get();
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:4,代碼來源:AbstractCoreSession.java

示例13: get

import org.apache.wicket.Session; //導入方法依賴的package包/類
public static SyncopeSession get() {
    return (SyncopeSession) Session.get();
}
 
開發者ID:ilgrosso,項目名稱:oldSyncopeIdM,代碼行數:4,代碼來源:SyncopeSession.java

示例14: get

import org.apache.wicket.Session; //導入方法依賴的package包/類
/**
 * @return Current WebAnno web session
 */
public static ApplicationSession get()
{
    return (ApplicationSession) Session.get();
}
 
開發者ID:webanno,項目名稱:webanno,代碼行數:8,代碼來源:ApplicationSession.java

示例15: get

import org.apache.wicket.Session; //導入方法依賴的package包/類
public static MySession get()
{
	return (MySession) Session.get();
}
 
開發者ID:sebfz1,項目名稱:wicket-quickstart-cdi-async,代碼行數:5,代碼來源:MySession.java


注:本文中的org.apache.wicket.Session.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。