当前位置: 首页>>代码示例>>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;未经允许,请勿转载。