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


Java UIDetachedException類代碼示例

本文整理匯總了Java中com.vaadin.ui.UIDetachedException的典型用法代碼示例。如果您正苦於以下問題:Java UIDetachedException類的具體用法?Java UIDetachedException怎麽用?Java UIDetachedException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UIDetachedException類屬於com.vaadin.ui包,在下文中一共展示了UIDetachedException類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateUI

import com.vaadin.ui.UIDetachedException; //導入依賴的package包/類
/**
 * Thread safe UI updates
 * 
 * Execute UI changes in a runnable after attaining the applications's lock.
 * Runnable won't be run, if the view isn't anymore active. 
 * 
 * Make sure this method won't get called before the UI is ready. In 
 * practice the easiest way to ensure this is to start data queries only 
 * after the UI is initialized and visible.
 * 
 * @param runnable
 */
public void updateUI(Runnable runnable) {
	
	try {
		ui.access(runnable);
		
		// this is needed, because the ChipsterAdminUI is configured
		// for manual push
		ui.accessSynchronously(new Runnable() {
			public void run() {
				ui.push();			
			}
		});
	} catch (UIDetachedException e) {
		// user reloaded the page during the update
	}		
}
 
開發者ID:chipster,項目名稱:chipster,代碼行數:29,代碼來源:AsynchronousView.java

示例2: configError

import com.vaadin.ui.UIDetachedException; //導入依賴的package包/類
/**
 * Configure la gestion des erreurs
 */
private void configError(){
	/* Log les erreurs non gerees */
	VaadinSession.getCurrent().setErrorHandler(e -> {
		Throwable cause = e.getThrowable();
		while (cause instanceof Throwable) {
			/* Gère les accès non autorisés */
			if (cause instanceof AccessDeniedException) {
				navigateToView(ErreurView.NAME);
				return;
			}
			/* Gère les UIs détachées pour les utilisateurs déconnectés */
			if (cause instanceof AuthenticationCredentialsNotFoundException || cause instanceof UIDetachedException 
				|| cause instanceof UploadException || cause instanceof IllegalStateException
				|| cause instanceof SocketTimeoutException
				|| MethodUtils.checkCause(cause,"SocketTimeoutException")
				|| MethodUtils.checkCause(cause,"ClientAbortException")					
				|| cause instanceof EOFException
				|| cause instanceof URISyntaxException
				|| cause instanceof UIException) {
				sendError();
				cause.printStackTrace();
				return;
			}
			if (MethodUtils.checkCauseByStackTrace(cause,"FileUploadHandler", 0)
				||
				MethodUtils.checkCauseByStackTrace(cause,"OnDemandPdfBrowserOpener", 1)
				||
				MethodUtils.checkCauseByStackTrace(cause,"DownloadStream", 3)
				||
				MethodUtils.checkCauseByStackTrace(cause,"AtmosphereRequest", 7)
				||
				MethodUtils.checkCauseByStackTrace(cause,"AbstractTextField", 0)
				||
				MethodUtils.checkCauseByStackTrace(cause,"SocketChannelImpl", 4)
				|| 
				MethodUtils.checkCauseEmpty(cause)
				){
					sendError();
					cause.printStackTrace();
					return;
			}				
			cause = cause.getCause();
		}
		sendError();
		logger.error("Erreur inconnue", e.getThrowable());
	});
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:51,代碼來源:MainUI.java


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