org.glassfish.grizzly.utils.Exceptions类的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(201)

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

Exceptions介绍

[英]Exceptions utilities.
[中]例外情况和实用程序。

代码示例

代码示例来源:origin: com.ning/async-http-client

@Override
  public void onError(Throwable t) {
    future.failure(makeIOException(t));
  }
});

代码示例来源:origin: idekerlab/cyREST

@Override
  public Response toResponse(InternalServerErrorException ex) {
    return Response.status(500).entity(Exceptions.getStackTraceAsString(ex)).type(MediaType.APPLICATION_JSON)
        .build();
  }
}

代码示例来源:origin: com.ning/async-http-client

@Override
public void onFailure(final Connection connection, final Throwable t) {
  connection.closeWithReason(Exceptions.makeIOException(t));
}

代码示例来源:origin: com.ning/async-http-client

@Override
public void exceptionOccurred(final FilterChainContext ctx,
    final Throwable error) {
  ctx.getCloseable().closeWithReason(Exceptions.makeIOException(error));
}

代码示例来源:origin: com.ning/async-http-client

@Override
public void onError(Throwable t) {
  c.setMaxAsyncWriteQueueSize(feedableBodyGenerator.origMaxPendingBytes);
  c.closeWithReason(Exceptions.makeIOException(t));
}

代码示例来源:origin: com.ning/async-http-client

private static void block(final Connection c,
             final FutureImpl<Boolean> future) {
  try {
    final long writeTimeout =
        c.getTransport().getWriteTimeout(MILLISECONDS);
    if (writeTimeout != -1) {
      future.get(writeTimeout, MILLISECONDS);
    } else {
      future.get();
    }
  } catch (ExecutionException e) {
    c.closeWithReason(Exceptions.makeIOException(e.getCause()));
  } catch (Exception e) {
    c.closeWithReason(Exceptions.makeIOException(e));
  }
}

代码示例来源:origin: com.ning/async-http-client

@Override
public void ready() {
  try {
    flush();
  } catch (IOException e) {
    final Connection c = feedableBodyGenerator.context.getConnection();
    c.setMaxAsyncWriteQueueSize(feedableBodyGenerator.origMaxPendingBytes);
    c.closeWithReason(Exceptions.makeIOException(e));
  }
}

代码示例来源:origin: com.ning/async-http-client

: future.get();
} catch (ExecutionException ee) {
  throw Exceptions.makeIOException(ee.getCause());
} catch (Exception e) {
  throw Exceptions.makeIOException(e);
} finally {
  future.cancel(false);

代码示例来源:origin: javaee/grizzly

private static Object invoke(final Object object, final Method method,
    final Object... params) throws IOException {
  try {
    return method.invoke(object, params);
  } catch (InvocationTargetException e) {
    final Throwable t = e.getCause();
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    } else {
      throw Exceptions.makeIOException(t);
    }
  } catch (Throwable t) {
    throw Exceptions.makeIOException(t);
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

private static Object invoke(final Object object, final Method method,
    final Object... params) throws IOException {
  try {
    return method.invoke(object, params);
  } catch (InvocationTargetException e) {
    final Throwable t = e.getCause();
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    } else {
      throw Exceptions.makeIOException(t);
    }
  } catch (Throwable t) {
    throw Exceptions.makeIOException(t);
  }
}

代码示例来源:origin: javaee/grizzly

private static Object invoke(final Object object, final Method method,
    final Object... params) throws IOException {
  try {
    return method.invoke(object, params);
  } catch (InvocationTargetException e) {
    final Throwable t = e.getCause();
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    } else {
      throw Exceptions.makeIOException(t);
    }
  } catch (Throwable t) {
    throw Exceptions.makeIOException(t);
  }
}

代码示例来源:origin: javaee/grizzly

private static Object invoke(final Object object, final Method method,
    final Object... params) throws IOException {
  try {
    return method.invoke(object, params);
  } catch (InvocationTargetException e) {
    final Throwable t = e.getCause();
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    } else {
      throw Exceptions.makeIOException(t);
    }
  } catch (Throwable t) {
    throw Exceptions.makeIOException(t);
  }
}

代码示例来源:origin: javaee/grizzly

private static Object invoke(final Object object, final Method method,
    final Object... params) throws IOException {
  try {
    return method.invoke(object, params);
  } catch (InvocationTargetException e) {
    final Throwable t = e.getCause();
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    } else {
      throw Exceptions.makeIOException(t);
    }
  } catch (Throwable t) {
    throw Exceptions.makeIOException(t);
  }
}

代码示例来源:origin: javaee/grizzly

private static Object invoke(final Object object, final Method method,
    final Object... params) throws IOException {
  try {
    return method.invoke(object, params);
  } catch (InvocationTargetException e) {
    final Throwable t = e.getCause();
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    } else {
      throw Exceptions.makeIOException(t);
    }
  } catch (Throwable t) {
    throw Exceptions.makeIOException(t);
  }
}

代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-framework

private static Object invoke(final Object object, final Method method,
    final Object... params) throws IOException {
  try {
    return method.invoke(object, params);
  } catch (InvocationTargetException e) {
    final Throwable t = e.getCause();
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    } else {
      throw Exceptions.makeIOException(t);
    }
  } catch (Throwable t) {
    throw Exceptions.makeIOException(t);
  }
}

代码示例来源:origin: javaee/grizzly

private static Object invoke(final Object object, final Method method,
    final Object... params) throws IOException {
  try {
    return method.invoke(object, params);
  } catch (InvocationTargetException e) {
    final Throwable t = e.getCause();
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    } else {
      throw Exceptions.makeIOException(t);
    }
  } catch (Throwable t) {
    throw Exceptions.makeIOException(t);
  }
}

代码示例来源:origin: javaee/grizzly

private static Object invoke(final Object object, final Method method,
    final Object... params) throws IOException {
  try {
    return method.invoke(object, params);
  } catch (InvocationTargetException e) {
    final Throwable t = e.getCause();
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    } else {
      throw Exceptions.makeIOException(t);
    }
  } catch (Throwable t) {
    throw Exceptions.makeIOException(t);
  }
}

代码示例来源:origin: javaee/grizzly

private static Object invoke(final Object object, final Method method,
    final Object... params) throws IOException {
  try {
    return method.invoke(object, params);
  } catch (InvocationTargetException e) {
    final Throwable t = e.getCause();
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    } else {
      throw Exceptions.makeIOException(t);
    }
  } catch (Throwable t) {
    throw Exceptions.makeIOException(t);
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-core

private static Object invoke(final Object object, final Method method,
    final Object... params) throws IOException {
  try {
    return method.invoke(object, params);
  } catch (InvocationTargetException e) {
    final Throwable t = e.getCause();
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    } else {
      throw Exceptions.makeIOException(t);
    }
  } catch (Throwable t) {
    throw Exceptions.makeIOException(t);
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core

private static Object invoke(final Object object, final Method method,
    final Object... params) throws IOException {
  try {
    return method.invoke(object, params);
  } catch (InvocationTargetException e) {
    final Throwable t = e.getCause();
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    } else {
      throw Exceptions.makeIOException(t);
    }
  } catch (Throwable t) {
    throw Exceptions.makeIOException(t);
  }
}

相关文章

Exceptions类方法