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

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

本文整理了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

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

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

private synchronized void unhook()
{
  try
  {
    _hooked=false;
    Runtime.getRuntime().removeShutdownHook(this);
  }
  catch(Exception e)
  {
    LOG.ignore(e);
    LOG.debug("shutdown already commenced");
  }
}

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

private void verifyIndirectTypes(Class<?> superClazz, Class<?> clazz, String typeName)
{
  try
  {
    // Report on super class deprecation too
    while (superClazz != null && superClazz != Object.class)
    {
      Deprecated supDepr = superClazz.getAnnotation(Deprecated.class);
      if (supDepr != null)
      {
        LOG.warn("Using indirect @Deprecated {} {} - (seen from {})",typeName,superClazz.getName(),clazz);
      }
      superClazz = superClazz.getSuperclass();
    }
  }
  catch (Throwable t)
  {
    LOG.ignore(t);
  }
}

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

/**
   * Close an existing connection
   */
  private void closeConnection ()
  {
    if (_con != null)
    {
      if (LOG.isDebugEnabled()) LOG.debug("Closing db connection for JDBCUserRealm");
      try { _con.close(); }catch (Exception e) {LOG.ignore(e);}
    }
    _con = null;
  }
}

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

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

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

/** 
 * @see org.eclipse.jetty.util.preventers.AbstractLeakPreventer#prevent(java.lang.ClassLoader)
 */
@Override
public void prevent(ClassLoader loader)
{
  try
  {
    Class<?> clazz = Class.forName("sun.misc.GC");
    Method requestLatency = clazz.getMethod("requestLatency", new Class[] {long.class});
    requestLatency.invoke(null, Long.valueOf(Long.MAX_VALUE-1));
  }
  catch (ClassNotFoundException e)
  {
    LOG.ignore(e);
  }
  catch (Exception e)
  {
    LOG.warn(e);
  }
}

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

private void startReservedThread()
{
  try
  {
    while (true)
    {
      // Not atomic, but there is a re-check in ReservedThread.run().
      int pending = _pending.get();
      int size = _size.get();
      if (pending + size >= _capacity)
        return;
      if (_pending.compareAndSet(pending, pending + 1))
      {
        if (LOG.isDebugEnabled())
          LOG.debug("{} startReservedThread p={}", this, pending + 1);
        _executor.execute(new ReservedThread());
        return;
      }
    }
  }
  catch(RejectedExecutionException e)
  {
    LOG.ignore(e);
  }
}

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

JLOG.warn(msg,cause);
  JLOG.warn(msg);
  JLOG.debug(msg,cause);
  JLOG.debug(msg);
JLOG.ignore(cause);
return;

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

private void execute(Runnable task)
{
  try
  {
    _executor.execute(task);
  }
  catch (RejectedExecutionException e)
  {
    if (isRunning())
      LOG.warn(e);
    else
      LOG.ignore(e);
    if (task instanceof Closeable)
    {
      try
      {
        ((Closeable)task).close();
      }
      catch (Throwable e2)
      {
        LOG.ignore(e2);
      }
    }
  }
}

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

@Override
public synchronized void close()
{
  _exists=false;
  _list=null;
  _entry=null;
  _file=null;
  //if the jvm is not doing url caching, then the JarFiles will not be cached either,
  //and so they are safe to close
  if (!getUseCaches())
  {
    if ( _jarFile != null )
    {
      try
      {
        if (LOG.isDebugEnabled())
          LOG.debug("Closing JarFile "+_jarFile.getName());
        _jarFile.close();
      }
      catch ( IOException ioe )
      {
        LOG.ignore(ioe);
      }
    }
  }
  _jarFile=null;
  super.close();
}

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

LOG.debug("run {}", job);
    runJob(job);
    if (LOG.isDebugEnabled())
      LOG.debug("ran {}", job);
    if (Thread.interrupted())
LOG.ignore(e);
LOG.warn(e);
    LOG.warn("Unexpected thread death: {} in {}", this, QueuedThreadPool.this);

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

@Override
public <T> T decorate(T o)
{
  if (o == null)
  {
    return null;
  }
  Class<?> clazz = o.getClass();
  try
  {
    Deprecated depr = clazz.getAnnotation(Deprecated.class);
    if (depr != null)
    {
      LOG.warn("Using @Deprecated Class {}",clazz.getName());
    }
  }
  catch (Throwable t)
  {
    LOG.ignore(t);
  }
  verifyIndirectTypes(clazz.getSuperclass(),clazz,"Class");
  for (Class<?> ifaceClazz : clazz.getInterfaces())
  {
    verifyIndirectTypes(ifaceClazz,clazz,"Interface");
  }
  return o;
}

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

private Runnable reservedWait()
    LOG.debug("{} waiting", this);
          LOG.ignore(e);
        LOG.debug("{} IDLE", this);
      tryExecute(STOP);
    LOG.debug("{} task={}", this, task);

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

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

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

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

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

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

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

@Override
protected void onException(Throwable ex)
{
  if (ex instanceof EofException)
  {
    _log.ignore(ex);
    return;
  }
  _log.warn(ex.toString());
  _log.debug(ex);
  if (!response.isCommitted())
  {
    response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
  }
}

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

private void verifyIndirectTypes(Class<?> superClazz, Class<?> clazz, String typeName)
{
  try
  {
    // Report on super class deprecation too
    while (superClazz != null && superClazz != Object.class)
    {
      Deprecated supDepr = superClazz.getAnnotation(Deprecated.class);
      if (supDepr != null)
      {
        LOG.warn("Using indirect @Deprecated {} {} - (seen from {})",typeName,superClazz.getName(),clazz);
      }
      superClazz = superClazz.getSuperclass();
    }
  }
  catch (Throwable t)
  {
    LOG.ignore(t);
  }
}

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

private synchronized void unhook()
{
  try
  {
    _hooked=false;
    Runtime.getRuntime().removeShutdownHook(this);
  }
  catch(Exception e)
  {
    LOG.ignore(e);
    LOG.debug("shutdown already commenced");
  }
}

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

@Override
public void beanRemoved(Container parent, Object obj)
{
  LOG.debug("beanRemoved {}",obj);
  ObjectName bean = _beans.remove(obj);
  if (bean != null)
  {
    try
    {
      _mbeanServer.unregisterMBean(bean);
      LOG.debug("Unregistered {}", bean);
    }
    catch (javax.management.InstanceNotFoundException e)
    {
      LOG.ignore(e);
    }
    catch (Exception e)
    {
      LOG.warn(e);
    }
  }
}

相关文章