org.apache.uima.util.Logger.logrb()方法的使用及代码示例

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

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

Logger.logrb介绍

[英]Logs a message with a message key. The real message is extracted from a resource bundle.
[中]使用消息键记录消息。真正的消息是从资源包中提取的。

代码示例

代码示例来源:origin: apache/uima-uimaj

public void errMsgPosted(String errMsg) {
 UIMAFramework.getLogger(PackageInstaller.class).logrb(Level.SEVERE,
    "PackageInstaller", "installPackage",
    PEAR_MESSAGE_RESOURCE_BUNDLE, "package_installer_error",
    errMsg);
}

代码示例来源:origin: org.apache.uima/uimaj-as-core

public void onNewSamplingInterval() {
 if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
  UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(), "run",
      UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_marker_INFO", new Object[] {});
 }
}

代码示例来源:origin: org.apache.uima/uimaj-as-jms

protected void acquireCpcReadySemaphore() {
 try {
  // Acquire cpcReady semaphore to block sending CPC request until
  // ALL outstanding CASes are received.
  cpcReadySemaphore.acquire();
 } catch (InterruptedException e) {
   if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
     UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
         "collectionProcessingComplete", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
         "UIMAJMS_client_interrupted_while_acquiring_cpcReadySemaphore__WARNING", new Object[] {});
    }
 }
}

代码示例来源:origin: apache/uima-uimaj

public void outMsgPosted(String outMsg) {
   UIMAFramework.getLogger(PackageInstaller.class).logrb(Level.INFO,
      "PackageInstaller", "installPackage",
      PEAR_MESSAGE_RESOURCE_BUNDLE, "package_installer_message",
      outMsg);
  }
};

代码示例来源:origin: org.apache.uima/uimaj-cpe

/**
 * Stops the checkpoint thread.
 */
public void stop() {
 stop = true;
 // isRunning = false;
 if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {
  UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),
      "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_stop_checkpoint_thread__INFO",
      new Object[] { Thread.currentThread().getName() });
 }
}

代码示例来源:origin: org.apache.uima/uimaj-as-core

private boolean isInitialized() {
 if (!jmxAvailable || platformMBeanServer == null) // means we couldn't find the required classes
                          // and methods
 {
  UIMAFramework.getLogger().logrb(Level.CONFIG, JmxManager.class.getName(), "isInitialized",
      LOG_RESOURCE_BUNDLE, "UIMA_JMX_platform_mbean_server_not_available__CONFIG");
  return false;
 }
 return true;
}

代码示例来源:origin: org.apache.uima/uimaj-cpe

/**
 * Called when the initialization is completed.
 * 
 * @see org.apache.uima.collection.processing.StatusCallbackListener#initializationComplete()
 */
public void initializationComplete() {
 if (UIMAFramework.getLogger().isLoggable(Level.CONFIG)) {
  UIMAFramework.getLogger(this.getClass()).logrb(Level.CONFIG, this.getClass().getName(),
      "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_cpm_init_complete__CONFIG",
      new Object[] { Thread.currentThread().getName() });
 }
}

代码示例来源:origin: apache/uima-uimaj

private Map<StringPair, ResourceManager> createRMmap(StringPair sp, ResourceManager rm) {
 Map<StringPair, ResourceManager> result = new HashMap<StringPair, ResourceManager>(4);
 result.put(sp, rm);
 UIMAFramework.getLogger(this.getClass()).logrb(Level.CONFIG,
    this.getClass().getName(), "createRMmap", LOG_RESOURCE_BUNDLE,
    "UIMA_pear_runtime_create_RM_map",
    new Object[] { sp.classPath, sp.dataPath });
 return result;
}

代码示例来源:origin: org.apache.uima/uimaj-cpe

/**
 * Called when the collection processing is completed.
 * 
 * @see org.apache.uima.collection.processing.StatusCallbackListener#collectionProcessComplete()
 */
public synchronized void collectionProcessComplete() {
 if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
  UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
      "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_method_ping__FINEST",
      new Object[] { Thread.currentThread().getName() });
 }
}

代码示例来源:origin: org.apache.uima/uimaj-as-jms

public void onBeforeProcessCAS(UimaASProcessStatus status, String nodeIP, String pid) {
 for (int i = 0; listeners != null && i < listeners.size(); i++) {
  UimaAsBaseCallbackListener statCL = (UimaAsBaseCallbackListener) listeners.get(i);
  try {
    statCL.onBeforeProcessCAS(status, nodeIP, pid);
    
  } catch( Throwable t) {
     UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(),
         "onBeforeProcessCAS", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
         "UIMAEE_exception__WARNING", t);
  }
 }
}

代码示例来源:origin: org.apache.uima/uimaj-cpe

/**
 * Called when the CPM is paused.
 * 
 * @see org.apache.uima.collection.processing.StatusCallbackListener#paused()
 */
public synchronized void paused() {
 if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
  UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
      "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_paused__FINEST",
      new Object[] { Thread.currentThread().getName() });
 }
}

代码示例来源:origin: org.apache.uima/uimaj-as-jms

public void onBeforeMessageSend(UimaASProcessStatus status) {
  try {
     for (int i = 0; listeners != null && i < listeners.size(); i++) {
       UimaAsBaseCallbackListener statCL = (UimaAsBaseCallbackListener) listeners.get(i);
       statCL.onBeforeMessageSend(status);
     }
  } catch( Throwable t) {
     UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(),
         "onBeforeMessageSend", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
         "UIMAEE_exception__WARNING", t);
  }      
}

代码示例来源:origin: org.apache.uima/uimaj-cpe

/**
 * Called when the CPM is resumed after a pause.
 * 
 * @see org.apache.uima.collection.processing.StatusCallbackListener#resumed()
 */
public synchronized void resumed() {
 if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
  UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
      "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_resumed__FINEST",
      new Object[] { Thread.currentThread().getName() });
 }
}

代码示例来源:origin: org.apache.uima/uimaj-as-jms

public void onBeforeProcessMeta(String nodeIP, String pid) {
  for (int i = 0; listeners != null && i < listeners.size(); i++) {
    UimaAsBaseCallbackListener statCL = (UimaAsBaseCallbackListener) listeners
        .get(i);
    try {
      statCL.onBeforeProcessMeta(nodeIP, pid);
    } catch (Throwable t) {
      UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING,
          getClass().getName(), "onBeforeProcessMeta",
          UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
          "UIMAEE_exception__WARNING", t);
    }
  }
}
public synchronized void setCollectionReader(CollectionReader aCollectionReader)

代码示例来源:origin: org.apache.uima/uimaj-cpe

/**
 * Called when the CPM is stopped abruptly due to errors.
 * 
 * @see org.apache.uima.collection.processing.StatusCallbackListener#aborted()
 */
public void aborted() {
 if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
  UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
      "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_stopped__FINEST",
      new Object[] { Thread.currentThread().getName() });
 }
}

代码示例来源:origin: org.apache.uima/uimaj-as-core

public void unregisterMBean(ObjectName anMBeanToUnregister) {
  //  use class level locking to make sure one thread at time executes the code
  synchronized(JmxManager.class) {
   if (!isInitialized()) {
    return;
   }
   try {
//          System.out.println("Service .................. Unregister MBean:"+anMBeanToUnregister);
    if (((MBeanServer) platformMBeanServer).isRegistered(anMBeanToUnregister)) {
     ((MBeanServer) platformMBeanServer).unregisterMBean(anMBeanToUnregister);
    }
   } catch (Exception e) {
    UIMAFramework.getLogger()
        .logrb(Level.WARNING, JmxMBeanAgent.class.getName(), "registerMBean",
            LOG_RESOURCE_BUNDLE, "UIMA_JMX_failed_to_register_mbean__WARNING", e);
   }
  }
 }

代码示例来源:origin: org.apache.uima/uimaj-cpe

/**
 * Pauses this thread.
 */
public void pauseIt() {
 if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
  UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
      "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_pause_cpe__FINEST",
      new Object[] { Thread.currentThread().getName() });
 }
 synchronized (lockForPause) {
  pause = true;
 }
}

代码示例来源:origin: org.apache.uima/uimaj-as-core

public void registerMBean(Object anMBeanToRegister, ObjectName aName) throws Exception {
  if (!isInitialized()) {
   return;
  }

  try {
   //  use class level locking to make sure one thread at time executes the code
   synchronized(JmxManager.class) {
    if (((MBeanServer) platformMBeanServer).isRegistered(aName)) {
     ((MBeanServer) platformMBeanServer).unregisterMBean(aName);
    }
    ObjectInstance oi =
        ((MBeanServer) platformMBeanServer).registerMBean(anMBeanToRegister, aName);
    mbeanList.add(oi.getObjectName());
//        System.out.println("Service ...................... Registered MBean "+oi.getObjectName());
   }
  } catch (Exception e) {
   UIMAFramework.getLogger()
       .logrb(Level.WARNING, JmxMBeanAgent.class.getName(), "registerMBean",
           LOG_RESOURCE_BUNDLE, "UIMA_JMX_failed_to_register_mbean__WARNING", e);
  }
 }

代码示例来源:origin: org.apache.uima/uimaj-cpe

/**
 * Plugs in custom timer used by the PU for getting time.
 *
 * @param aTimer -
 *          custom timer to use
 */
public void setUimaTimer(UimaTimer aTimer) {
 timer = aTimer;
 if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
  UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
      "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_timer_class__FINEST",
      new Object[] { Thread.currentThread().getName(), timer.getClass().getName() });
 }
}

代码示例来源:origin: org.apache.uima/uimaj-as-jms

private Exception retrieveExceptionFromMessage(Message message) throws Exception {
 Exception exception = null;
 try {
  if (message instanceof ObjectMessage
      && ((ObjectMessage) message).getObject() instanceof Exception) {
   exception = (Exception) ((ObjectMessage) message).getObject();
  } else if (message instanceof TextMessage) {
   exception = new UimaEEServiceException(((TextMessage) message).getText());
  }
 } catch( Exception e) {
  UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(),
      "retrieveExceptionFromMessage", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
      "UIMAEE_exception__WARNING", e);   
  exception = new UimaEEServiceException("UIMA AS client is unable to de-serialize Exception from a remote service",e);
 }
 return exception;
}

相关文章