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

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

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

  1. public void errMsgPosted(String errMsg) {
  2. UIMAFramework.getLogger(PackageInstaller.class).logrb(Level.SEVERE,
  3. "PackageInstaller", "installPackage",
  4. PEAR_MESSAGE_RESOURCE_BUNDLE, "package_installer_error",
  5. errMsg);
  6. }

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

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

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

  1. protected void acquireCpcReadySemaphore() {
  2. try {
  3. // Acquire cpcReady semaphore to block sending CPC request until
  4. // ALL outstanding CASes are received.
  5. cpcReadySemaphore.acquire();
  6. } catch (InterruptedException e) {
  7. if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
  8. UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
  9. "collectionProcessingComplete", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
  10. "UIMAJMS_client_interrupted_while_acquiring_cpcReadySemaphore__WARNING", new Object[] {});
  11. }
  12. }
  13. }

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

  1. public void outMsgPosted(String outMsg) {
  2. UIMAFramework.getLogger(PackageInstaller.class).logrb(Level.INFO,
  3. "PackageInstaller", "installPackage",
  4. PEAR_MESSAGE_RESOURCE_BUNDLE, "package_installer_message",
  5. outMsg);
  6. }
  7. };

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

  1. /**
  2. * Stops the checkpoint thread.
  3. */
  4. public void stop() {
  5. stop = true;
  6. // isRunning = false;
  7. if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {
  8. UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),
  9. "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_stop_checkpoint_thread__INFO",
  10. new Object[] { Thread.currentThread().getName() });
  11. }
  12. }

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

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

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

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

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

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

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

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

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

  1. public void onBeforeProcessCAS(UimaASProcessStatus status, String nodeIP, String pid) {
  2. for (int i = 0; listeners != null && i < listeners.size(); i++) {
  3. UimaAsBaseCallbackListener statCL = (UimaAsBaseCallbackListener) listeners.get(i);
  4. try {
  5. statCL.onBeforeProcessCAS(status, nodeIP, pid);
  6. } catch( Throwable t) {
  7. UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(),
  8. "onBeforeProcessCAS", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
  9. "UIMAEE_exception__WARNING", t);
  10. }
  11. }
  12. }

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

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

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

  1. public void onBeforeMessageSend(UimaASProcessStatus status) {
  2. try {
  3. for (int i = 0; listeners != null && i < listeners.size(); i++) {
  4. UimaAsBaseCallbackListener statCL = (UimaAsBaseCallbackListener) listeners.get(i);
  5. statCL.onBeforeMessageSend(status);
  6. }
  7. } catch( Throwable t) {
  8. UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(),
  9. "onBeforeMessageSend", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
  10. "UIMAEE_exception__WARNING", t);
  11. }
  12. }

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

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

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

  1. public void onBeforeProcessMeta(String nodeIP, String pid) {
  2. for (int i = 0; listeners != null && i < listeners.size(); i++) {
  3. UimaAsBaseCallbackListener statCL = (UimaAsBaseCallbackListener) listeners
  4. .get(i);
  5. try {
  6. statCL.onBeforeProcessMeta(nodeIP, pid);
  7. } catch (Throwable t) {
  8. UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING,
  9. getClass().getName(), "onBeforeProcessMeta",
  10. UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
  11. "UIMAEE_exception__WARNING", t);
  12. }
  13. }
  14. }
  15. public synchronized void setCollectionReader(CollectionReader aCollectionReader)

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

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

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

  1. public void unregisterMBean(ObjectName anMBeanToUnregister) {
  2. // use class level locking to make sure one thread at time executes the code
  3. synchronized(JmxManager.class) {
  4. if (!isInitialized()) {
  5. return;
  6. }
  7. try {
  8. // System.out.println("Service .................. Unregister MBean:"+anMBeanToUnregister);
  9. if (((MBeanServer) platformMBeanServer).isRegistered(anMBeanToUnregister)) {
  10. ((MBeanServer) platformMBeanServer).unregisterMBean(anMBeanToUnregister);
  11. }
  12. } catch (Exception e) {
  13. UIMAFramework.getLogger()
  14. .logrb(Level.WARNING, JmxMBeanAgent.class.getName(), "registerMBean",
  15. LOG_RESOURCE_BUNDLE, "UIMA_JMX_failed_to_register_mbean__WARNING", e);
  16. }
  17. }
  18. }

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

  1. /**
  2. * Pauses this thread.
  3. */
  4. public void pauseIt() {
  5. if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
  6. UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
  7. "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_pause_cpe__FINEST",
  8. new Object[] { Thread.currentThread().getName() });
  9. }
  10. synchronized (lockForPause) {
  11. pause = true;
  12. }
  13. }

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

  1. public void registerMBean(Object anMBeanToRegister, ObjectName aName) throws Exception {
  2. if (!isInitialized()) {
  3. return;
  4. }
  5. try {
  6. // use class level locking to make sure one thread at time executes the code
  7. synchronized(JmxManager.class) {
  8. if (((MBeanServer) platformMBeanServer).isRegistered(aName)) {
  9. ((MBeanServer) platformMBeanServer).unregisterMBean(aName);
  10. }
  11. ObjectInstance oi =
  12. ((MBeanServer) platformMBeanServer).registerMBean(anMBeanToRegister, aName);
  13. mbeanList.add(oi.getObjectName());
  14. // System.out.println("Service ...................... Registered MBean "+oi.getObjectName());
  15. }
  16. } catch (Exception e) {
  17. UIMAFramework.getLogger()
  18. .logrb(Level.WARNING, JmxMBeanAgent.class.getName(), "registerMBean",
  19. LOG_RESOURCE_BUNDLE, "UIMA_JMX_failed_to_register_mbean__WARNING", e);
  20. }
  21. }

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

  1. /**
  2. * Plugs in custom timer used by the PU for getting time.
  3. *
  4. * @param aTimer -
  5. * custom timer to use
  6. */
  7. public void setUimaTimer(UimaTimer aTimer) {
  8. timer = aTimer;
  9. if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
  10. UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
  11. "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_timer_class__FINEST",
  12. new Object[] { Thread.currentThread().getName(), timer.getClass().getName() });
  13. }
  14. }

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

  1. private Exception retrieveExceptionFromMessage(Message message) throws Exception {
  2. Exception exception = null;
  3. try {
  4. if (message instanceof ObjectMessage
  5. && ((ObjectMessage) message).getObject() instanceof Exception) {
  6. exception = (Exception) ((ObjectMessage) message).getObject();
  7. } else if (message instanceof TextMessage) {
  8. exception = new UimaEEServiceException(((TextMessage) message).getText());
  9. }
  10. } catch( Exception e) {
  11. UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(),
  12. "retrieveExceptionFromMessage", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
  13. "UIMAEE_exception__WARNING", e);
  14. exception = new UimaEEServiceException("UIMA AS client is unable to de-serialize Exception from a remote service",e);
  15. }
  16. return exception;
  17. }

相关文章