com.google.gwt.user.server.rpc.RPC.formatIllegalAccessErrorMessage()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(245)

本文整理了Java中com.google.gwt.user.server.rpc.RPC.formatIllegalAccessErrorMessage方法的一些代码示例,展示了RPC.formatIllegalAccessErrorMessage的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RPC.formatIllegalAccessErrorMessage方法的具体详情如下:
包路径:com.google.gwt.user.server.rpc.RPC
类名称:RPC
方法名:formatIllegalAccessErrorMessage

RPC.formatIllegalAccessErrorMessage介绍

暂无

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. public static String invokeAndEncodeResponse(Object target, Method serviceMethod, Object[] args,
  2. SerializationPolicy serializationPolicy, int flags) throws SerializationException {
  3. if (serviceMethod == null) {
  4. throw new NullPointerException("serviceMethod");
  5. }
  6. if (serializationPolicy == null) {
  7. throw new NullPointerException("serializationPolicy");
  8. }
  9. String responsePayload;
  10. try {
  11. Object result = serviceMethod.invoke(target, args);
  12. responsePayload = encodeResponseForSuccess(serviceMethod, result, serializationPolicy, flags);
  13. } catch (IllegalAccessException e) {
  14. SecurityException securityException =
  15. new SecurityException(formatIllegalAccessErrorMessage(target, serviceMethod));
  16. securityException.initCause(e);
  17. throw securityException;
  18. } catch (IllegalArgumentException e) {
  19. SecurityException securityException =
  20. new SecurityException(formatIllegalArgumentErrorMessage(target, serviceMethod, args));
  21. securityException.initCause(e);
  22. throw securityException;
  23. } catch (InvocationTargetException e) {
  24. // Try to encode the caught exception
  25. //
  26. Throwable cause = e.getCause();
  27. responsePayload = encodeResponseForFailure(serviceMethod, cause, serializationPolicy, flags);
  28. }
  29. return responsePayload;
  30. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. public static String invokeAndEncodeResponse(Object target, Method serviceMethod, Object[] args,
  2. SerializationPolicy serializationPolicy, int flags) throws SerializationException {
  3. if (serviceMethod == null) {
  4. throw new NullPointerException("serviceMethod");
  5. }
  6. if (serializationPolicy == null) {
  7. throw new NullPointerException("serializationPolicy");
  8. }
  9. String responsePayload;
  10. try {
  11. Object result = serviceMethod.invoke(target, args);
  12. responsePayload = encodeResponseForSuccess(serviceMethod, result, serializationPolicy, flags);
  13. } catch (IllegalAccessException e) {
  14. SecurityException securityException =
  15. new SecurityException(formatIllegalAccessErrorMessage(target, serviceMethod));
  16. securityException.initCause(e);
  17. throw securityException;
  18. } catch (IllegalArgumentException e) {
  19. SecurityException securityException =
  20. new SecurityException(formatIllegalArgumentErrorMessage(target, serviceMethod, args));
  21. securityException.initCause(e);
  22. throw securityException;
  23. } catch (InvocationTargetException e) {
  24. // Try to encode the caught exception
  25. //
  26. Throwable cause = e.getCause();
  27. responsePayload = encodeResponseForFailure(serviceMethod, cause, serializationPolicy, flags);
  28. }
  29. return responsePayload;
  30. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. public static String invokeAndEncodeResponse(Object target, Method serviceMethod, Object[] args,
  2. SerializationPolicy serializationPolicy, int flags) throws SerializationException {
  3. if (serviceMethod == null) {
  4. throw new NullPointerException("serviceMethod");
  5. }
  6. if (serializationPolicy == null) {
  7. throw new NullPointerException("serializationPolicy");
  8. }
  9. String responsePayload;
  10. try {
  11. Object result = serviceMethod.invoke(target, args);
  12. responsePayload = encodeResponseForSuccess(serviceMethod, result, serializationPolicy, flags);
  13. } catch (IllegalAccessException e) {
  14. SecurityException securityException =
  15. new SecurityException(formatIllegalAccessErrorMessage(target, serviceMethod));
  16. securityException.initCause(e);
  17. throw securityException;
  18. } catch (IllegalArgumentException e) {
  19. SecurityException securityException =
  20. new SecurityException(formatIllegalArgumentErrorMessage(target, serviceMethod, args));
  21. securityException.initCause(e);
  22. throw securityException;
  23. } catch (InvocationTargetException e) {
  24. // Try to encode the caught exception
  25. //
  26. Throwable cause = e.getCause();
  27. responsePayload = encodeResponseForFailure(serviceMethod, cause, serializationPolicy, flags);
  28. }
  29. return responsePayload;
  30. }

相关文章