org.eclipse.jetty.util.log.Logger.ignore()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(194)

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

Logger.ignore介绍

[英]Ignore an exception.

This should be used rather than an empty catch block.
[中]忽略异常。
应该使用该块,而不是空的catch块。

代码示例

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

  1. LOG.warn(new Throwable()); // TODO throw ISE?
  2. LOG.warn(new Throwable()); // TODO throw ISE?
  3. if (s.startsWith("t"))
  4. LOG.warn("Deprecated boolean load-on-startup. Please use integer");
  5. order = 1;
  6. LOG.warn("Cannot parse load-on-startup " + s + ". Please use integer");
  7. LOG.ignore(e);
  8. if (roleName != null && roleName.length() > 0 && roleLink != null && roleLink.length() > 0)
  9. if (LOG.isDebugEnabled()) LOG.debug("link role " + roleName + " to " + roleLink + " for " + this);
  10. switch (context.getMetaData().getOrigin(name+".servlet.role-name."+roleName))

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. private synchronized void unhook()
  2. {
  3. try
  4. {
  5. _hooked=false;
  6. Runtime.getRuntime().removeShutdownHook(this);
  7. }
  8. catch(Exception e)
  9. {
  10. LOG.ignore(e);
  11. LOG.debug("shutdown already commenced");
  12. }
  13. }

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. private void verifyIndirectTypes(Class<?> superClazz, Class<?> clazz, String typeName)
  2. {
  3. try
  4. {
  5. // Report on super class deprecation too
  6. while (superClazz != null && superClazz != Object.class)
  7. {
  8. Deprecated supDepr = superClazz.getAnnotation(Deprecated.class);
  9. if (supDepr != null)
  10. {
  11. LOG.warn("Using indirect @Deprecated {} {} - (seen from {})",typeName,superClazz.getName(),clazz);
  12. }
  13. superClazz = superClazz.getSuperclass();
  14. }
  15. }
  16. catch (Throwable t)
  17. {
  18. LOG.ignore(t);
  19. }
  20. }

代码示例来源:origin: org.eclipse.jetty/jetty-security

  1. /**
  2. * Close an existing connection
  3. */
  4. private void closeConnection ()
  5. {
  6. if (_con != null)
  7. {
  8. if (LOG.isDebugEnabled()) LOG.debug("Closing db connection for JDBCUserRealm");
  9. try { _con.close(); }catch (Exception e) {LOG.ignore(e);}
  10. }
  11. _con = null;
  12. }
  13. }

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. LOG.debug("ALIAS abs={} can={}",abs,can);
  2. LOG.warn("bad alias for {}: {}",file,e.toString());
  3. LOG.debug(e);
  4. try
  5. LOG.ignore(e2);
  6. throw new RuntimeException(e);

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. /**
  2. * @see org.eclipse.jetty.util.preventers.AbstractLeakPreventer#prevent(java.lang.ClassLoader)
  3. */
  4. @Override
  5. public void prevent(ClassLoader loader)
  6. {
  7. try
  8. {
  9. Class<?> clazz = Class.forName("sun.misc.GC");
  10. Method requestLatency = clazz.getMethod("requestLatency", new Class[] {long.class});
  11. requestLatency.invoke(null, Long.valueOf(Long.MAX_VALUE-1));
  12. }
  13. catch (ClassNotFoundException e)
  14. {
  15. LOG.ignore(e);
  16. }
  17. catch (Exception e)
  18. {
  19. LOG.warn(e);
  20. }
  21. }

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. private void startReservedThread()
  2. {
  3. try
  4. {
  5. while (true)
  6. {
  7. // Not atomic, but there is a re-check in ReservedThread.run().
  8. int pending = _pending.get();
  9. int size = _size.get();
  10. if (pending + size >= _capacity)
  11. return;
  12. if (_pending.compareAndSet(pending, pending + 1))
  13. {
  14. if (LOG.isDebugEnabled())
  15. LOG.debug("{} startReservedThread p={}", this, pending + 1);
  16. _executor.execute(new ReservedThread());
  17. return;
  18. }
  19. }
  20. }
  21. catch(RejectedExecutionException e)
  22. {
  23. LOG.ignore(e);
  24. }
  25. }

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. JLOG.warn(msg,cause);
  2. JLOG.warn(msg);
  3. JLOG.debug(msg,cause);
  4. JLOG.debug(msg);
  5. JLOG.ignore(cause);
  6. return;

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. private void execute(Runnable task)
  2. {
  3. try
  4. {
  5. _executor.execute(task);
  6. }
  7. catch (RejectedExecutionException e)
  8. {
  9. if (isRunning())
  10. LOG.warn(e);
  11. else
  12. LOG.ignore(e);
  13. if (task instanceof Closeable)
  14. {
  15. try
  16. {
  17. ((Closeable)task).close();
  18. }
  19. catch (Throwable e2)
  20. {
  21. LOG.ignore(e2);
  22. }
  23. }
  24. }
  25. }

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. @Override
  2. public synchronized void close()
  3. {
  4. _exists=false;
  5. _list=null;
  6. _entry=null;
  7. _file=null;
  8. //if the jvm is not doing url caching, then the JarFiles will not be cached either,
  9. //and so they are safe to close
  10. if (!getUseCaches())
  11. {
  12. if ( _jarFile != null )
  13. {
  14. try
  15. {
  16. if (LOG.isDebugEnabled())
  17. LOG.debug("Closing JarFile "+_jarFile.getName());
  18. _jarFile.close();
  19. }
  20. catch ( IOException ioe )
  21. {
  22. LOG.ignore(ioe);
  23. }
  24. }
  25. }
  26. _jarFile=null;
  27. super.close();
  28. }

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. LOG.debug("run {}", job);
  2. runJob(job);
  3. if (LOG.isDebugEnabled())
  4. LOG.debug("ran {}", job);
  5. if (Thread.interrupted())
  6. LOG.ignore(e);
  7. LOG.warn(e);
  8. LOG.warn("Unexpected thread death: {} in {}", this, QueuedThreadPool.this);

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. @Override
  2. public <T> T decorate(T o)
  3. {
  4. if (o == null)
  5. {
  6. return null;
  7. }
  8. Class<?> clazz = o.getClass();
  9. try
  10. {
  11. Deprecated depr = clazz.getAnnotation(Deprecated.class);
  12. if (depr != null)
  13. {
  14. LOG.warn("Using @Deprecated Class {}",clazz.getName());
  15. }
  16. }
  17. catch (Throwable t)
  18. {
  19. LOG.ignore(t);
  20. }
  21. verifyIndirectTypes(clazz.getSuperclass(),clazz,"Class");
  22. for (Class<?> ifaceClazz : clazz.getInterfaces())
  23. {
  24. verifyIndirectTypes(ifaceClazz,clazz,"Interface");
  25. }
  26. return o;
  27. }

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. private Runnable reservedWait()
  2. LOG.debug("{} waiting", this);
  3. LOG.ignore(e);
  4. LOG.debug("{} IDLE", this);
  5. tryExecute(STOP);
  6. LOG.debug("{} task={}", this, task);

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. LOG.debug("Starting java.nio file watching with {}",watchService);
  2. LOG.debug("Waiting for poll({})", wait_time);
  3. key = wait_time<0?watch.take():wait_time>0?watch.poll(wait_time,updateQuietTimeUnit):watch.poll();
  4. LOG.warn(e);
  5. LOG.ignore(e);

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. LOG.ignore(ignored);
  2. LOG.ignore(e);
  3. LOG.warn("bad alias ({} {}) for {}", e.getClass().getName(), e.getMessage(),path);

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. LOG.debug("Constructor has no arguments");
  2. return constructor.newInstance(arguments);
  3. LOG.debug("Constructor has no parameter annotations");
  4. return constructor.newInstance(arguments);
  5. LOG.debug("placing named {} in position {}", param.value(), count);
  6. swizzled[count] = namedArgMap.get(param.value());
  7. LOG.ignore(e);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

  1. @Override
  2. protected void onException(Throwable ex)
  3. {
  4. if (ex instanceof EofException)
  5. {
  6. _log.ignore(ex);
  7. return;
  8. }
  9. _log.warn(ex.toString());
  10. _log.debug(ex);
  11. if (!response.isCommitted())
  12. {
  13. response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
  14. }
  15. }

代码示例来源:origin: jenkinsci/winstone

  1. private void verifyIndirectTypes(Class<?> superClazz, Class<?> clazz, String typeName)
  2. {
  3. try
  4. {
  5. // Report on super class deprecation too
  6. while (superClazz != null && superClazz != Object.class)
  7. {
  8. Deprecated supDepr = superClazz.getAnnotation(Deprecated.class);
  9. if (supDepr != null)
  10. {
  11. LOG.warn("Using indirect @Deprecated {} {} - (seen from {})",typeName,superClazz.getName(),clazz);
  12. }
  13. superClazz = superClazz.getSuperclass();
  14. }
  15. }
  16. catch (Throwable t)
  17. {
  18. LOG.ignore(t);
  19. }
  20. }

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

  1. private synchronized void unhook()
  2. {
  3. try
  4. {
  5. _hooked=false;
  6. Runtime.getRuntime().removeShutdownHook(this);
  7. }
  8. catch(Exception e)
  9. {
  10. LOG.ignore(e);
  11. LOG.debug("shutdown already commenced");
  12. }
  13. }

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

  1. @Override
  2. public void beanRemoved(Container parent, Object obj)
  3. {
  4. LOG.debug("beanRemoved {}",obj);
  5. ObjectName bean = _beans.remove(obj);
  6. if (bean != null)
  7. {
  8. try
  9. {
  10. _mbeanServer.unregisterMBean(bean);
  11. LOG.debug("Unregistered {}", bean);
  12. }
  13. catch (javax.management.InstanceNotFoundException e)
  14. {
  15. LOG.ignore(e);
  16. }
  17. catch (Exception e)
  18. {
  19. LOG.warn(e);
  20. }
  21. }
  22. }

相关文章