org.teiid.logging.LogManager.logWarning()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(102)

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

LogManager.logWarning介绍

[英]Send a warning message to the log. Warning messages generally described expected errors from which the system should recover. However, this level is used to record the fact that such an error or event did occur.

Only if the log manager is configured to send such messages to the destination will the message be recorded.
[中]向日志发送警告消息。警告消息通常描述系统应该从中恢复的预期错误。但是,该级别用于记录此类错误或事件确实发生的事实。
只有将日志管理器配置为将此类消息发送到目标时,才会记录该消息。

代码示例

代码示例来源:origin: teiid/teiid

protected void logWaitMessage(long warnTime, int maximumPoolSize, String poolName, int highestQueueSize) {
  LogManager.logWarning(LogConstants.CTX_RUNTIME, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30009, maximumPoolSize, poolName, highestQueueSize, warnTime));
}

代码示例来源:origin: org.teiid/teiid-engine

protected void logWaitMessage(long warnTime, int maximumPoolSize, String poolName, int highestQueueSize) {
  LogManager.logWarning(LogConstants.CTX_RUNTIME, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30009, maximumPoolSize, poolName, highestQueueSize, warnTime));
}

代码示例来源:origin: org.teiid/teiid-engine

private boolean addLibrary(String className, String prefix) {
  try {
    Class<?> osdqFunctions = Class.forName(className, false, 
        this.getClass().getClassLoader());
    addFunctions(osdqFunctions, prefix);
    return true;
  } catch (ClassNotFoundException|NoClassDefFoundError e) {
    // ignore the add
    LogManager.logWarning(LogConstants.CTX_DQP, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31263, className, e.getMessage()));
  }
  return false;
}

代码示例来源:origin: teiid/teiid

private boolean addLibrary(String className, String prefix) {
  try {
    Class<?> osdqFunctions = Class.forName(className, false, 
        this.getClass().getClassLoader());
    addFunctions(osdqFunctions, prefix);
    return true;
  } catch (ClassNotFoundException|NoClassDefFoundError e) {
    // ignore the add
    LogManager.logWarning(LogConstants.CTX_DQP, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31263, className, e.getMessage()));
  }
  return false;
}

代码示例来源:origin: org.jboss.teiid/teiid-engine

private boolean addLibrary(String className, String prefix) {
  try {
    Class<?> osdqFunctions = Class.forName(className, false, 
        this.getClass().getClassLoader());
    addFunctions(osdqFunctions, prefix);
    return true;
  } catch (ClassNotFoundException|NoClassDefFoundError e) {
    // ignore the add
    LogManager.logWarning(LogConstants.CTX_DQP, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31263, className, e.getMessage()));
  }
  return false;
}

代码示例来源:origin: org.teiid/teiid-runtime

private void logProcessingException(Throwable e, String context) {
    Throwable cause = e;
    while (cause.getCause() != null && cause != cause.getCause()) {
      cause = cause.getCause();
    }
    StackTraceElement elem = cause.getStackTrace()[0];
    String msg = RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40011, e.getMessage(), this.socketClientInstance.getWorkContext().getSessionId(), e.getClass().getName(), elem);
    if (LogManager.isMessageToBeRecorded(context, MessageLevel.DETAIL)) {
      LogManager.logWarning(context, e, msg);
    } else {
      LogManager.logWarning(context, msg + QueryPlugin.Util.getString("stack_info")); ////$NON-NLS-1$
    }
  }
}

代码示例来源:origin: org.teiid/teiid-runtime

public int resetPendingJob(final VDBMetaData vdb, final Table table, String nodeName){
  try {
    String statusTable = table.getProperty(MaterializationMetadataRepository.MATVIEW_STATUS_TABLE, false);
    String updateStatusTable = "UPDATE "+statusTable+" SET LOADSTATE='NEEDS_LOADING' "
        + "WHERE LOADSTATE = 'LOADING' AND NODENAME = '"+nodeName+"' "
        + "AND NAME = '"+table.getName()+"'";
    List<Map<String, String>> results = executeQuery(vdb, updateStatusTable);
    String count = results.get(0).get("update-count");
    return Integer.parseInt(count);
  } catch (SQLException e) {
    LogManager.logWarning(LogConstants.CTX_MATVIEWS, e, e.getMessage());
  }
  return 0;
}

代码示例来源:origin: org.jboss.teiid/teiid-engine

@Override
public void release() {
  try {
    requestCancel();
  } catch (TeiidComponentException e) {
    LogManager.logWarning(LogConstants.CTX_DQP, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30026,requestID));
  }
}

代码示例来源:origin: org.jboss.teiid/teiid-engine

public String toString() {
  try{
    return "XMLPlan:\n" + ProgramUtil.programToString(this.originalProgram); //$NON-NLS-1$
  } catch (Exception e){
    LogManager.logWarning(LogConstants.CTX_XML_PLAN, e, QueryPlugin.Util.getString("ERR.015.006.0001")); //$NON-NLS-1$
  }
  return "XMLPlan"; //$NON-NLS-1$
}

代码示例来源:origin: org.jboss.teiid/teiid-engine

@Override
public void run() {
  int count = runs.incrementAndGet();
  try {
    defrag(false);
    if ((count%truncateInterval)==0) {
      truncate(false);
    }
  } catch (Throwable t) {
    LogManager.logWarning(LogConstants.CTX_BUFFER_MGR, t, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30022));
  } finally {
    defragRunning.set(false);
  }
}

代码示例来源:origin: teiid/teiid

@Override
public void run() {
  int count = runs.incrementAndGet();
  try {
    defrag(false);
    if ((count%truncateInterval)==0) {
      truncate(false);
    }
  } catch (Throwable t) {
    LogManager.logWarning(LogConstants.CTX_BUFFER_MGR, t, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30022));
  } finally {
    defragRunning.set(false);
  }
}

代码示例来源:origin: org.teiid/teiid-engine

@Override
public void run() {
  int count = runs.incrementAndGet();
  try {
    defrag(false);
    if ((count%truncateInterval)==0) {
      truncate(false);
    }
  } catch (Throwable t) {
    LogManager.logWarning(LogConstants.CTX_BUFFER_MGR, t, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30022));
  } finally {
    defragRunning.set(false);
  }
}

代码示例来源:origin: org.teiid/teiid-runtime

public void setEncoding(String value, boolean init) {
  if (value == null || value.equals(this.clientEncoding)) {
    return;
  }
  this.clientEncoding = value;
  Charset cs = PGCharsetConverter.getCharset(value);
  if (cs != null) {
    this.encoding = cs;
    if (!init) {
      sendParameterStatus(CLIENT_ENCODING, value);
    }
  } else {
    LogManager.logWarning(LogConstants.CTX_ODBC, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40105, value));
  }
}

代码示例来源:origin: org.teiid.connectors/translator-ldap

public void close() {
  try {
    if(ldapCtx != null) {
      ldapCtx.close();
    }
  } catch (NamingException ne) {
    LogManager.logWarning(LogConstants.CTX_CONNECTOR, LDAPPlugin.Util.gs(LDAPPlugin.Event.TEIID12003, ne.getExplanation()));
  }
}

代码示例来源:origin: org.jboss.teiid/teiid-engine

private static void setSupports(Object connectorID, BasicSourceCapabilities tgtCaps, Capability cap, boolean supports, Capability... required) {
  if (!supports) {
    return;
  }
  for (Capability capability : required) {
    if (!tgtCaps.supportsCapability(capability)) {
      LogManager.logWarning(LogConstants.CTX_CONNECTOR, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30003, cap, capability, connectorID));
      supports = false;
    }
  }
  tgtCaps.setCapabilitySupport(cap, supports);
}

代码示例来源:origin: org.teiid/teiid-engine

private static void setSupports(Object connectorID, BasicSourceCapabilities tgtCaps, Capability cap, boolean supports, Capability... required) {
  if (!supports) {
    return;
  }
  for (Capability capability : required) {
    if (!tgtCaps.supportsCapability(capability)) {
      LogManager.logWarning(LogConstants.CTX_CONNECTOR, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30003, cap, capability, connectorID));
      supports = false;
    }
  }
  tgtCaps.setCapabilitySupport(cap, supports);
}

代码示例来源:origin: teiid/teiid

private static void setSupports(Object connectorID, BasicSourceCapabilities tgtCaps, Capability cap, boolean supports, Capability... required) {
  if (!supports) {
    return;
  }
  for (Capability capability : required) {
    if (!tgtCaps.supportsCapability(capability)) {
      LogManager.logWarning(LogConstants.CTX_CONNECTOR, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30003, cap, capability, connectorID));
      supports = false;
    }
  }
  tgtCaps.setCapabilitySupport(cap, supports);
}

代码示例来源:origin: org.teiid/teiid-olingo

@Override
public void doFilter(ServletRequest request, ServletResponse response,
    FilterChain chain) throws IOException, ServletException {
  try {
    internalDoFilter(request, response, chain);
  } catch (TeiidProcessingException e) {
    //TODO: use engine style logic to determine if the stack should be logged
    LogManager.logWarning(LogConstants.CTX_ODATA, e, ODataPlugin.Util.gs(ODataPlugin.Event.TEIID16047, e.getMessage()));
    HttpServletResponse httpResponse = (HttpServletResponse)response;
    writeError(request, e, httpResponse, 404);
  }
}

代码示例来源:origin: org.teiid/teiid-runtime

public synchronized void registerBeans() {
  try {
    register(new Teiid(dqp, sessionService, bufferService), TEIID);
    register(new Cache(dqp.getPrepPlanCache()),
        CACHE_PREFIX + "PreparedPlan"); //$NON-NLS-1$
    register(new Cache(dqp.getResltSetCache()),
        CACHE_PREFIX + "ResultSet"); //$NON-NLS-1$
  } catch (MBeanRegistrationException | OperationsException e) {
    LogManager.logWarning(LogConstants.CTX_RUNTIME, e,
        "JMX Registration Exception - it's likely another Teiid instance is running in this VM"); //$NON-NLS-1$
  }
}

代码示例来源:origin: org.teiid/teiid-runtime

private void sendErrorResponse(String message) {
  LogManager.logWarning(LogConstants.CTX_ODBC, message); //$NON-NLS-1$
  startMessage('E');
  write('S');
  writeString("ERROR");
  write('C');
  // PROTOCOL VIOLATION
  writeString("08P01");
  write('M');
  writeString(message);
  write(0);
  sendMessage();
}

相关文章