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


Java ClientDetailsException類代碼示例

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


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

示例1: generateErrorResult

import org.red5.server.exception.ClientDetailsException; //導入依賴的package包/類
/**
 * Generate error object to return for given exception.
 * 
 * @param code
 *            call
 * @param error
 *            error
 * @return status object
 */
protected StatusObject generateErrorResult(String code, Throwable error) {
    // Construct error object to return
    String message = "";
    while (error != null && error.getCause() != null) {
        error = error.getCause();
    }
    if (error != null && error.getMessage() != null) {
        message = error.getMessage();
    }
    StatusObject status = new StatusObject(code, "error", message);
    if (error instanceof ClientDetailsException) {
        // Return exception details to client
        status.setApplication(((ClientDetailsException) error).getParameters());
        if (((ClientDetailsException) error).includeStacktrace()) {
            List<String> stack = new ArrayList<String>();
            for (StackTraceElement element : error.getStackTrace()) {
                stack.add(element.toString());
            }
            status.setAdditional("stacktrace", stack);
        }
    } else if (error != null) {
        status.setApplication(error.getClass().getCanonicalName());
    }
    return status;
}
 
開發者ID:Red5,項目名稱:red5-server,代碼行數:35,代碼來源:RemotingProtocolEncoder.java

示例2: returnError

import org.red5.server.exception.ClientDetailsException; //導入依賴的package包/類
/**
 * Construct error message from exception.
 * 
 * @param request
 *            request
 * @param faultCode
 *            fault code
 * @param faultString
 *            fautl string
 * @param error
 *            error
 * @return message
 */
public static ErrorMessage returnError(AbstractMessage request, String faultCode, String faultString, Throwable error) {
    ErrorMessage result = returnError(request, faultCode, faultString, "");
    if (error instanceof ClientDetailsException) {
        result.extendedData = ((ClientDetailsException) error).getParameters();
        if (((ClientDetailsException) error).includeStacktrace()) {
            StringBuilder stack = new StringBuilder();
            for (StackTraceElement element : error.getStackTrace()) {
                stack.append(element.toString()).append('\n');
            }
            result.faultDetail = stack.toString();
        }
    }
    result.rootCause = error;
    return result;
}
 
開發者ID:Red5,項目名稱:red5-server,代碼行數:29,代碼來源:FlexMessagingService.java

示例3: generateErrorResult

import org.red5.server.exception.ClientDetailsException; //導入依賴的package包/類
/**
 * Generate error object to return for given exception.
 * 
 * @param code call
 * @param error error
 * @return status object
 */
protected StatusObject generateErrorResult(String code, Throwable error) {
	// Construct error object to return
	String message = "";
	while (error != null && error.getCause() != null) {
		error = error.getCause();
	}
	if (error != null && error.getMessage() != null) {
		message = error.getMessage();
	}
	StatusObject status = new StatusObject(code, "error", message);
	if (error instanceof ClientDetailsException) {
		// Return exception details to client
		status.setApplication(((ClientDetailsException) error).getParameters());
		if (((ClientDetailsException) error).includeStacktrace()) {
			List<String> stack = new ArrayList<String>();
			for (StackTraceElement element : error.getStackTrace()) {
				stack.add(element.toString());
			}
			status.setAdditional("stacktrace", stack);
		}
	} else if (error != null) {
		status.setApplication(error.getClass().getCanonicalName());
	}
	return status;
}
 
開發者ID:cwpenhale,項目名稱:red5-mobileconsole,代碼行數:33,代碼來源:RTMPProtocolEncoder.java

示例4: generateErrorResult

import org.red5.server.exception.ClientDetailsException; //導入依賴的package包/類
/**
 * Generate error object to return for given exception.
 * 
 * @param code call
 * @param error error
 * @return status object
 */
protected StatusObject generateErrorResult(String code, Throwable error) {
	// Construct error object to return
	String message = "";
	while (error != null && error.getCause() != null) {
		error = error.getCause();
	}
	if (error != null && error.getMessage() != null) {
		message = error.getMessage();
	}
	StatusObject status = new StatusObject(code, "error", message);
	if (error instanceof ClientDetailsException) {
		// Return exception details to client
		status.setApplication(((ClientDetailsException) error).getParameters());
		if (((ClientDetailsException) error).includeStacktrace()) {
			List<String> stack = new ArrayList<String>();
			for (StackTraceElement element: error.getStackTrace()) {
				stack.add(element.toString());
			}
			status.setAdditional("stacktrace", stack);
		}
	} else if (error != null) {
		status.setApplication(error.getClass().getCanonicalName());
	}
	return status;
}
 
開發者ID:cwpenhale,項目名稱:red5-mobileconsole,代碼行數:33,代碼來源:RemotingProtocolEncoder.java

示例5: returnError

import org.red5.server.exception.ClientDetailsException; //導入依賴的package包/類
/**
 * Construct error message from exception.
 * 
 * @param request request
 * @param faultCode fault code
 * @param faultString fautl string
 * @param error error
 * @return message
 */
public static ErrorMessage returnError(AbstractMessage request, String faultCode, String faultString,
		Throwable error) {
	ErrorMessage result = returnError(request, faultCode, faultString, "");
	if (error instanceof ClientDetailsException) {
		result.extendedData = ((ClientDetailsException) error).getParameters();
		if (((ClientDetailsException) error).includeStacktrace()) {
			StringBuilder stack = new StringBuilder();
			for (StackTraceElement element : error.getStackTrace()) {
				stack.append(element.toString()).append('\n');
			}
			result.faultDetail = stack.toString();
		}
	}
	result.rootCause = error;
	return result;
}
 
開發者ID:cwpenhale,項目名稱:red5-mobileconsole,代碼行數:26,代碼來源:FlexMessagingService.java


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