Refine search
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[] {}); } }
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[] {}); } } }
/** * 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() }); } }
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; }
/** * 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() }); } }
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; }
/** * 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() }); } }
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); } } }
/** * 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() }); } }
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); } }
/** * 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() }); } }
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)
/** * 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() }); } }
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); } } }
/** * 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; } }
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); } }
/** * 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() }); } }
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; }