public DelegatingEtmRenderKitFactory(RenderKitFactory aKitFactory) { // default value, may be overridden delegate = aKitFactory; if (!isEnabled()) { LOG.info("JSF component monitoring disabled."); } else if (isCglibAvailable()) { try { Class<RenderKitFactory> aClass = (Class<RenderKitFactory>) Class.forName(CGLIB_DELEGATE_CLASS_NAME); Constructor<RenderKitFactory> constructor = aClass.getConstructor(new Class[]{RenderKitFactory.class}); delegate = constructor.newInstance(aKitFactory); LOG.debug("Activated JSF component monitoring."); } catch (Exception e) { LOG.warn("Unable to create CGLIB proxy for " + aKitFactory.getClass() + ". Component monitoring disabled: " + e.getMessage()); } } else { LOG.warn("CGLIB not found. Component monitoring disabled."); } }
public void start() { if (mbeanServer == null) { try { ArrayList mbeanServers = MBeanServerFactory.findMBeanServer(mbeanServerName); if (mbeanServers.size() > 0) { mbeanServer = (MBeanServer) mbeanServers.get(0); ObjectName objectName = new ObjectName(monitorObjectName); monitorMBean = new EtmMonitorMBean(etmMonitor, measurementDomain); registerMBean(mbeanServer, objectName, monitorMBean, overwrite); isStopping = false; } else { log.warn("Unable to locate a valid MBeanServer. Disable JMX support."); } } catch (Exception e) { log.error("Error while registering EtmMonitorMBean ", e); } } }
public void run() { try { buffer.flush(); } catch (Throwable t) { if (t instanceof ThreadDeath) { started = false; cancel(); log.warn("Error occured in BufferedTimedAggregator. Disable collection to prevent memory leak."); throw (ThreadDeath) t; } if (t instanceof Error) { started = false; cancel(); log.warn("Error occured in BufferedTimedAggregator. Disable collection to prevent memory leak."); throw (Error) t; } log.fatal("Error in aggregation buffer.", t); } } }, sleepInterval, sleepInterval);
private void showMonitorNotStartedMessage() { log.warn("Warning - Performance Monitoring currently disabled. " + "If you did not start the current EtmMonitor on purpose, " + "you may ignore this warning. Otherwhise ensure to call EtmMonitor.start() " + "at some point in your application."); noStartedErrorMessageFlag = true; }
public void start() { // validate whether we find required aggregator doValidateChain(); RrdDestination[] tmp = getDestinations(); List dest = new ArrayList(); for (int i = 0; i < tmp.length; i++) { RrdDestination rrdDestination = tmp[i]; try { rrdDestination.start(); dest.add(rrdDestination); LOG.debug("Added RRD destination " + rrdDestination); } catch (Exception e) { LOG.warn("Error activation RRD destination " + rrdDestination, e); } } destinations = (RrdDestination[]) dest.toArray(new RrdDestination[dest.size()]); }
public JsfPerformancePhaseListener() { LOG.debug("Activated JSF phase performance monitoring."); }
public void stop() { LOG.info("Shutting down JETM."); if (!started) { collecting = false; return; } collecting = false; started = false; scheduler.cancel(); aggregator.stop(); shutdownPlugins(); dispatcher.deregister(this); }
public void parse(File aFile) throws IOException { LOG.info("Parsing " + aFile.getAbsolutePath()); DecimalFormatSymbols symbols = numberFormat.getDecimalFormatSymbols(); if (matcher.group(4).indexOf(symbols.getDecimalSeparator()) < 0) { LOG.warn("Possibly precision loss detected. Expected decimal separator '" + symbols.getDecimalSeparator() + "', but found " + LOG.warn("Error reading line " + line, e); in.close(); LOG.info("Finished parsing " + aFile.getAbsolutePath() + ". Processed " + processedLines + " out of " + totalLines + " lines.");
private void showMonitorNotStartedMessage() { LOG.warn("Warning - Performance Monitoring currently disabled. " + "If you did not start the current EtmMonitor on purpose, " + "you may ignore this warning. Otherwhise ensure to call EtmMonitor.start() " + "at some point in your application."); noStartedErrorMessageFlag = true; }
public void run() { while (shouldRun) { try { Socket clientSocket = socket.accept(); ConsoleWorker worker = getWorker(); if (worker != null) { worker.setClientSocket(clientSocket); } else { // process in current thread new ConsoleWorker().process(clientSocket); } } catch (Exception e) { if (shouldRun) { LOG.warn("Error processing HTTP request", e); } else { // don't do anything. we are shutting down probably // so there is no need to LOG the exception LOG.debug("Error during shutdown" + e.toString()); } } } }
private Method getGenerateBeanNameMethodSinceSpring11() throws NoSuchMethodException { LOG.debug("Using BeanDefinitionReaderUtils.generateBeanName() method for spring < 2.5 and >= 1.1"); return BeanDefinitionReaderUtils.class.getMethod("generateBeanName", new Class[] {AbstractBeanDefinition.class, BeanDefinitionRegistry.class, Boolean.TYPE}); }
protected boolean registerApplyToIfAppropriate(String packageName, ApplyTo annotation) { if (annotation != null) { LOG.info("Using " + annotation + " for " + packageName + " and above."); cache.put(packageName, annotation); Package[] packages = Package.getPackages(); for (Package pkg : packages) { String name = pkg.getName(); if (!name.equals(packageName) && name.startsWith(packageName) && !cache.containsKey(name)) { if (pkg.isAnnotationPresent(ApplyTo.class)) { registerApplyToIfAppropriate(name, pkg.getAnnotation(ApplyTo.class)); } else { cache.put(name, annotation); } } } return true; } return false; }
private void showWarning() { log.warn("Warning - NullMonitor active. Performance results are discarded." + "This usually happens if you used EtmManager.getEtmMonitor() to retrieve " + "the current EtmMonitor instance and did not configure the Performance " + "sub system before. For further details see EtmManager documentation at " + "http://jetm.void.fm/howto/etm_manager_configuration.html"); notCollectionWarningFlag = true; }
private Method getGenerateBeanNameMethodSinceSpring25() throws NoSuchMethodException { LOG.debug("Using BeanDefinitionReaderUtils.generateBeanName() method for spring >= 2.5"); return BeanDefinitionReaderUtils.class.getMethod("generateBeanName", new Class[] {BeanDefinition.class, BeanDefinitionRegistry.class, Boolean.TYPE}); }
public void stop() { log.info("Shutting down JETM."); if (!started) { collecting = false; return; } collecting = false; started = false; scheduler.cancel(); aggregator.stop(); shutdownPlugins(); dispatcher.deregister(this); }
public void start() { if (mbeanServer == null) { try { ArrayList mbeanServers = MBeanServerFactory.findMBeanServer(mbeanServerName); if (!mbeanServers.isEmpty()) { mbeanServer = (MBeanServer) mbeanServers.get(0); ObjectName objectName = new ObjectName(monitorObjectName); monitorMBean = new EtmMonitorMBean(etmMonitor, measurementDomain); registerMBean(mbeanServer, objectName, monitorMBean, overwrite); isStopping = false; } else { LOG.warn("Unable to locate a valid MBeanServer. Disable JMX support."); } } catch (Exception e) { LOG.error("Error while registering EtmMonitorMBean ", e); } } }
public void run() { try { buffer.flush(); } catch (Throwable t) { if (t instanceof ThreadDeath) { started = false; cancel(); LOG.warn("Error occured in BufferedTimedAggregator. Disable collection to prevent memory leak."); throw (ThreadDeath) t; } if (t instanceof Error) { started = false; cancel(); LOG.warn("Error occured in BufferedTimedAggregator. Disable collection to prevent memory leak."); throw (Error) t; } LOG.fatal("Error in aggregation buffer.", t); } } }, sleepInterval, sleepInterval);
private void showWarning() { LOG.warn("Warning - NullMonitor active. Performance results are discarded." + "This usually happens if you used EtmManager.getEtmMonitor() to retrieve " + "the current EtmMonitor instance and did not configure the Performance " + "sub system before. For further details see EtmManager documentation at " + "http://jetm.void.fm/howto/etm_manager_configuration.html"); notCollectionWarningFlag = true; }