commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1507950 [1/8] - in /commons/sandbox/monitoring/trunk: ./ aop/ aop/src/main/java/org/apache/commons/monitoring/aop/ aop/src/main/java/org/apache/commons/monitoring/instrumentation/ aop/src/main/resources/ aop/src/test/java/org/ aop/src/test...
Date Mon, 29 Jul 2013 06:20:58 GMT
Author: rmannibucau
Date: Mon Jul 29 06:20:54 2013
New Revision: 1507950

URL: http://svn.apache.org/r1507950
Log:
removing gauge which weren't really gauge, replacing it by a counter in counters, adding basic config, splitting in several modules

Added:
    commons/sandbox/monitoring/trunk/aop/
      - copied from r1506987, commons/sandbox/monitoring/trunk/instrumentation/
    commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/
    commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/AbstractPerformanceInterceptor.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/aop/AbstractPerformanceInterceptor.java
    commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/DefaultMonitorNameExtractor.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/aop/DefaultMonitorNameExtractor.java
    commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/MonitorNameExtractor.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/aop/MonitorNameExtractor.java
    commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/MonitoringProxyFactory.java
    commons/sandbox/monitoring/trunk/aop/src/test/java/org/
    commons/sandbox/monitoring/trunk/aop/src/test/java/org/apache/
    commons/sandbox/monitoring/trunk/aop/src/test/java/org/apache/commons/
    commons/sandbox/monitoring/trunk/aop/src/test/java/org/apache/commons/monitoring/
    commons/sandbox/monitoring/trunk/aop/src/test/java/org/apache/commons/monitoring/aop/
    commons/sandbox/monitoring/trunk/aop/src/test/java/org/apache/commons/monitoring/aop/MonitoringProxyFactoryTest.java
    commons/sandbox/monitoring/trunk/aspectj/
    commons/sandbox/monitoring/trunk/aspectj/pom.xml
    commons/sandbox/monitoring/trunk/aspectj/src/
    commons/sandbox/monitoring/trunk/aspectj/src/main/
    commons/sandbox/monitoring/trunk/aspectj/src/main/java/
    commons/sandbox/monitoring/trunk/aspectj/src/main/java/org/
    commons/sandbox/monitoring/trunk/aspectj/src/main/java/org/apache/
    commons/sandbox/monitoring/trunk/aspectj/src/main/java/org/apache/commons/
    commons/sandbox/monitoring/trunk/aspectj/src/main/java/org/apache/commons/monitoring/
    commons/sandbox/monitoring/trunk/aspectj/src/main/java/org/apache/commons/monitoring/aspectj/
    commons/sandbox/monitoring/trunk/aspectj/src/main/java/org/apache/commons/monitoring/aspectj/CommonsMonitoringAspect.java
    commons/sandbox/monitoring/trunk/aspectj/src/test/
    commons/sandbox/monitoring/trunk/aspectj/src/test/java/
    commons/sandbox/monitoring/trunk/aspectj/src/test/java/org/
    commons/sandbox/monitoring/trunk/aspectj/src/test/java/org/apache/
    commons/sandbox/monitoring/trunk/aspectj/src/test/java/org/apache/commons/
    commons/sandbox/monitoring/trunk/aspectj/src/test/java/org/apache/commons/monitoring/
    commons/sandbox/monitoring/trunk/aspectj/src/test/java/org/apache/commons/monitoring/aspectj/
    commons/sandbox/monitoring/trunk/aspectj/src/test/java/org/apache/commons/monitoring/aspectj/AspectJMonitoringTest.java
    commons/sandbox/monitoring/trunk/aspectj/src/test/resources/
    commons/sandbox/monitoring/trunk/aspectj/src/test/resources/META-INF/
    commons/sandbox/monitoring/trunk/aspectj/src/test/resources/META-INF/aop.xml
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/MonitoringException.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Visitor.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Visitor.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/configuration/
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/configuration/Configuration.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/
      - copied from r1506987, commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/metrics/
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/Counter.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Metric.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/DefaultCounter.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/Unit.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Unit.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/factory/
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/factory/CounterFactory.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/factory/DefaultCounterFactory.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/queuemanager/
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/queuemanager/DefaultMetricQueueManager.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/queuemanager/MetricQueueManager.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/monitors/Monitor.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Monitor.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/repositories/Repository.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Repository.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/stopwatches/CounterStopWatch.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/stopwatches/SimpleStopWatch.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/stopwatches/StopWatch.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/StopWatch.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/util/DaemonThreadFactory.java
    commons/sandbox/monitoring/trunk/core/src/test/java/org/apache/commons/monitoring/counter/
      - copied from r1506987, commons/sandbox/monitoring/trunk/core/src/test/java/org/apache/commons/monitoring/metrics/
    commons/sandbox/monitoring/trunk/cxf/
    commons/sandbox/monitoring/trunk/cxf/pom.xml
    commons/sandbox/monitoring/trunk/cxf/src/
    commons/sandbox/monitoring/trunk/cxf/src/main/
    commons/sandbox/monitoring/trunk/cxf/src/main/java/
    commons/sandbox/monitoring/trunk/cxf/src/main/java/org/
    commons/sandbox/monitoring/trunk/cxf/src/main/java/org/apache/
    commons/sandbox/monitoring/trunk/cxf/src/main/java/org/apache/commons/
    commons/sandbox/monitoring/trunk/cxf/src/main/java/org/apache/commons/monitoring/
    commons/sandbox/monitoring/trunk/cxf/src/main/java/org/apache/commons/monitoring/cxf/
    commons/sandbox/monitoring/trunk/cxf/src/main/java/org/apache/commons/monitoring/cxf/HttpMonitoringFeature.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/cxf/HttpMonitoringFeature.java
    commons/sandbox/monitoring/trunk/cxf/src/main/java/org/apache/commons/monitoring/cxf/HttpMonitoringInInterceptor.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/cxf/HttpMonitoringInInterceptor.java
    commons/sandbox/monitoring/trunk/cxf/src/main/java/org/apache/commons/monitoring/cxf/MonitoringFeature.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/cxf/MonitoringFeature.java
    commons/sandbox/monitoring/trunk/cxf/src/main/java/org/apache/commons/monitoring/cxf/MonitoringInInterceptor.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/cxf/MonitoringInInterceptor.java
    commons/sandbox/monitoring/trunk/cxf/src/main/java/org/apache/commons/monitoring/cxf/MonitoringOutInterceptor.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/cxf/MonitoringOutInterceptor.java
    commons/sandbox/monitoring/trunk/cxf/src/main/resources/
    commons/sandbox/monitoring/trunk/cxf/src/test/
    commons/sandbox/monitoring/trunk/cxf/src/test/java/
    commons/sandbox/monitoring/trunk/jdbc/src/main/java/org/apache/commons/monitoring/jdbc/MonitoringDriver.java
    commons/sandbox/monitoring/trunk/jdbc/src/test/
    commons/sandbox/monitoring/trunk/jdbc/src/test/java/
    commons/sandbox/monitoring/trunk/jdbc/src/test/java/org/
    commons/sandbox/monitoring/trunk/jdbc/src/test/java/org/apache/
    commons/sandbox/monitoring/trunk/jdbc/src/test/java/org/apache/commons/
    commons/sandbox/monitoring/trunk/jdbc/src/test/java/org/apache/commons/monitoring/
    commons/sandbox/monitoring/trunk/jdbc/src/test/java/org/apache/commons/monitoring/jdbc/
    commons/sandbox/monitoring/trunk/jdbc/src/test/java/org/apache/commons/monitoring/jdbc/HsqlDBTest.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/AbstractVisitor.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/AbstractVisitor.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/CSVFormat.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/Format.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/Format.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/FormattingVisitor.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/FormattingVisitor.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/HTMLFormat.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/JSONFormat.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/JSONFormat.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/MetricData.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/MetricData.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/RenderingContext.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/RoleFilter.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/format/XMLFormat.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/XMLFormat.java
    commons/sandbox/monitoring/trunk/reporting/src/main/resources/META-INF/
    commons/sandbox/monitoring/trunk/reporting/src/main/resources/META-INF/LICENSE.TXT
    commons/sandbox/monitoring/trunk/reporting/src/main/resources/META-INF/NOTICE.txt
    commons/sandbox/monitoring/trunk/reporting/src/main/webapp/
    commons/sandbox/monitoring/trunk/reporting/src/main/webapp/WEB-INF/
    commons/sandbox/monitoring/trunk/reporting/src/main/webapp/WEB-INF/web.xml
    commons/sandbox/monitoring/trunk/reporting/src/main/webapp/css/
    commons/sandbox/monitoring/trunk/reporting/src/main/webapp/css/theme.blue.css
    commons/sandbox/monitoring/trunk/reporting/src/main/webapp/js/
    commons/sandbox/monitoring/trunk/reporting/src/main/webapp/js/jquery.min.js
    commons/sandbox/monitoring/trunk/reporting/src/main/webapp/js/jquery.tablesorter.js
    commons/sandbox/monitoring/trunk/reporting/src/main/webapp/js/jquery.tablesorter.widgets.js
    commons/sandbox/monitoring/trunk/spring/src/main/java/org/apache/commons/monitoring/spring/aop/
    commons/sandbox/monitoring/trunk/spring/src/main/java/org/apache/commons/monitoring/spring/aop/AopaliancePerformanceInterceptor.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/aop/AopaliancePerformanceInterceptor.java
    commons/sandbox/monitoring/trunk/web/
    commons/sandbox/monitoring/trunk/web/pom.xml
    commons/sandbox/monitoring/trunk/web/src/
    commons/sandbox/monitoring/trunk/web/src/main/
    commons/sandbox/monitoring/trunk/web/src/main/java/
    commons/sandbox/monitoring/trunk/web/src/main/java/org/
    commons/sandbox/monitoring/trunk/web/src/main/java/org/apache/
    commons/sandbox/monitoring/trunk/web/src/main/java/org/apache/commons/
    commons/sandbox/monitoring/trunk/web/src/main/java/org/apache/commons/monitoring/
    commons/sandbox/monitoring/trunk/web/src/main/java/org/apache/commons/monitoring/web/
    commons/sandbox/monitoring/trunk/web/src/main/java/org/apache/commons/monitoring/web/jsp/
      - copied from r1506987, commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/servlet/jsp/
    commons/sandbox/monitoring/trunk/web/src/main/java/org/apache/commons/monitoring/web/lifecycle/
    commons/sandbox/monitoring/trunk/web/src/main/java/org/apache/commons/monitoring/web/lifecycle/CommonsMonitoringLifecycle.java
    commons/sandbox/monitoring/trunk/web/src/main/java/org/apache/commons/monitoring/web/servlet/
    commons/sandbox/monitoring/trunk/web/src/main/java/org/apache/commons/monitoring/web/servlet/CategorizedMonitoringFilter.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/servlet/CategorizedMonitoringFilter.java
    commons/sandbox/monitoring/trunk/web/src/main/java/org/apache/commons/monitoring/web/servlet/MonitoringFilter.java
      - copied, changed from r1506987, commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/servlet/MonitoringFilter.java
    commons/sandbox/monitoring/trunk/web/src/main/resources/
    commons/sandbox/monitoring/trunk/web/src/test/
    commons/sandbox/monitoring/trunk/web/src/test/java/
Removed:
    commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/instrumentation/
    commons/sandbox/monitoring/trunk/aop/src/main/resources/
    commons/sandbox/monitoring/trunk/aop/src/test/resources/
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Counter.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Detachable.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Gauge.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Metric.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Monitor.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Repository.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/StopWatch.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Unit.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/AbstractMetric.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/AbstractNoOpMetric.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/NoOpCounter.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/NoOpGauge.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/ObservableMetric.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/ObserverCounter.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/ObserverGauge.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/ObserverMetric.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/RentrantLockCounter.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/RentrantLockGauge.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/SynchronizedCounter.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/SynchronizedGauge.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/TODO.txt
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/ThreadSafeCounter.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/ThreadSafeGauge.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counter/ThresholdListener.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/metrics/
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/monitors/AbstractMonitor.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/monitors/CreateMetricsOnDemandMonitor.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/monitors/NullMonitor.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/monitors/ObservableMonitor.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/monitors/ObserverMonitor.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/repositories/AbstractRepository.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/repositories/ConfigurableImplementationsRepository.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/repositories/HOMTRepositoryDecorator.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/repositories/ObservableRepository.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/repositories/ObserverRepository.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/repositories/RepositoryDecorator.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/repositories/RepositoryFinder.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/stopwatches/CpuTimeStopWatch.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/stopwatches/DefaultStopWatch.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/stopwatches/HistoryOfMyThread.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/stopwatches/SimpleStopWatch.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/stopwatches/StopWatchDecorator.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/stopwatches/ThresholdListener.java
    commons/sandbox/monitoring/trunk/core/src/test/java/org/apache/commons/monitoring/metrics/
    commons/sandbox/monitoring/trunk/core/src/test/java/org/apache/commons/monitoring/repositories/HistoryOfMyThreadTest.java
    commons/sandbox/monitoring/trunk/instrumentation/
    commons/sandbox/monitoring/trunk/jdbc/src/main/java/org/apache/commons/monitoring/jdbc/AbstractMonitoredDataSource.java
    commons/sandbox/monitoring/trunk/jdbc/src/main/java/org/apache/commons/monitoring/jdbc/MonitoredCallableStatement.java
    commons/sandbox/monitoring/trunk/jdbc/src/main/java/org/apache/commons/monitoring/jdbc/MonitoredConnectionHandler.java
    commons/sandbox/monitoring/trunk/jdbc/src/main/java/org/apache/commons/monitoring/jdbc/MonitoredDataSourceHandler.java
    commons/sandbox/monitoring/trunk/jdbc/src/main/java/org/apache/commons/monitoring/jdbc/MonitoredStatementHandler.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/AbstractPeriodicLogger.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/AbstractVisitor.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/Format.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/FormattingVisitor.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/JSONFormat.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/MetricData.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/RepositoryFilter.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/Selector.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/XMLFormat.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/jaxrs/
    commons/sandbox/monitoring/trunk/reporting/src/test/java/org/apache/commons/monitoring/reporting/AbstractPeriodicLoggerTest.java
    commons/sandbox/monitoring/trunk/spring/src/main/java/org/apache/commons/monitoring/spring/MonitoringNamespaceHandler.java
Modified:
    commons/sandbox/monitoring/trunk/PROPOSAL.html
    commons/sandbox/monitoring/trunk/aop/pom.xml
    commons/sandbox/monitoring/trunk/cdi/pom.xml
    commons/sandbox/monitoring/trunk/cdi/src/main/java/org/apache/commons/monitoring/cdi/CommonsMonitoringInterceptor.java
    commons/sandbox/monitoring/trunk/cdi/src/main/java/org/apache/commons/monitoring/cdi/Monitored.java
    commons/sandbox/monitoring/trunk/cdi/src/test/java/org/apache/commons/monitoring/cdi/CommonsMonitoringInterceptorTest.java
    commons/sandbox/monitoring/trunk/core/pom.xml
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Role.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Visitable.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/monitors/DefaultMonitor.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/repositories/DefaultRepository.java
    commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/util/ClassLoaders.java
    commons/sandbox/monitoring/trunk/core/src/test/java/org/apache/commons/monitoring/UnitTest.java
    commons/sandbox/monitoring/trunk/core/src/test/java/org/apache/commons/monitoring/counter/CounterBench.java
    commons/sandbox/monitoring/trunk/core/src/test/java/org/apache/commons/monitoring/repositories/DefaultRepositoryTest.java
    commons/sandbox/monitoring/trunk/core/src/test/java/org/apache/commons/monitoring/stopwatches/DefaultStopWatchTest.java
    commons/sandbox/monitoring/trunk/jdbc/pom.xml
    commons/sandbox/monitoring/trunk/jdbc/src/main/java/org/apache/commons/monitoring/jdbc/ConnectionClosedCallBack.java
    commons/sandbox/monitoring/trunk/jdbc/src/main/java/org/apache/commons/monitoring/jdbc/MonitoredConnection.java
    commons/sandbox/monitoring/trunk/jdbc/src/main/java/org/apache/commons/monitoring/jdbc/MonitoredDataSource.java
    commons/sandbox/monitoring/trunk/jdbc/src/main/java/org/apache/commons/monitoring/jdbc/MonitoredPreparedStatement.java
    commons/sandbox/monitoring/trunk/jdbc/src/main/java/org/apache/commons/monitoring/jdbc/MonitoredStatement.java
    commons/sandbox/monitoring/trunk/pom.xml
    commons/sandbox/monitoring/trunk/reporting/pom.xml
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/HttpUtils.java
    commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringServlet.java
    commons/sandbox/monitoring/trunk/reporting/src/test/java/org/apache/commons/monitoring/reporting/FormattingVisitorTest.java
    commons/sandbox/monitoring/trunk/reporting/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.xml
    commons/sandbox/monitoring/trunk/spring/pom.xml
    commons/sandbox/monitoring/trunk/spring/src/main/java/org/apache/commons/monitoring/spring/AspectJMonitoringAutoProxyCreator.java
    commons/sandbox/monitoring/trunk/spring/src/main/java/org/apache/commons/monitoring/spring/BeanNameMonitoringAutoProxyCreator.java
    commons/sandbox/monitoring/trunk/spring/src/main/java/org/apache/commons/monitoring/spring/MonitoringAdviceFactory.java
    commons/sandbox/monitoring/trunk/spring/src/main/java/org/apache/commons/monitoring/spring/PointcutMonitoringAutoProxyCreator.java
    commons/sandbox/monitoring/trunk/spring/src/main/java/org/apache/commons/monitoring/spring/config/RepositoryFactoryBean.java
    commons/sandbox/monitoring/trunk/spring/src/main/java/org/apache/commons/monitoring/spring/config/WebappRepositoryFactoryBean.java
    commons/sandbox/monitoring/trunk/src/site/site.xml
    commons/sandbox/monitoring/trunk/src/site/xdoc/instrumentation.xml
    commons/sandbox/monitoring/trunk/src/site/xdoc/issue-tracking.xml
    commons/sandbox/monitoring/trunk/src/site/xdoc/listeners.xml
    commons/sandbox/monitoring/trunk/src/site/xdoc/mail-lists.xml
    commons/sandbox/monitoring/trunk/src/site/xdoc/reporting.xml
    commons/sandbox/monitoring/trunk/src/site/xdoc/tutorial.xml
    commons/sandbox/monitoring/trunk/src/site/xdoc/web.xml
    commons/sandbox/monitoring/trunk/web/src/main/java/org/apache/commons/monitoring/web/jsp/StartTag.java
    commons/sandbox/monitoring/trunk/web/src/main/java/org/apache/commons/monitoring/web/jsp/StartTagTei.java
    commons/sandbox/monitoring/trunk/web/src/main/java/org/apache/commons/monitoring/web/jsp/StopTag.java
    commons/sandbox/monitoring/trunk/web/src/main/java/org/apache/commons/monitoring/web/jsp/TagUtils.java

Modified: commons/sandbox/monitoring/trunk/PROPOSAL.html
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/PROPOSAL.html?rev=1507950&r1=1507949&r2=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/PROPOSAL.html (original)
+++ commons/sandbox/monitoring/trunk/PROPOSAL.html Mon Jul 29 06:20:54 2013
@@ -16,59 +16,69 @@
 -->
 <html>
 <head>
-<title>Proposal for monitoring Package</title>
+    <title>Proposal for monitoring Package</title>
 </head>
 <body bgcolor="white">
 
 <div align="center">
-<h1>Proposal for <em>monitoring</em> Package</h1>
+    <h1>Proposal for <em>monitoring</em> Package</h1>
 </div>
 
 <h3>(0) Rationale</h3>
 
-<p>Entreprise Java application are expected to be scalable, performant, flexible, maintainable and highly available. 
-To ensure this, we need to instrument the application with tooling, both during development to detect design 
-bottlenecks and on production to monitor application behaviour and health.
+<p>Entreprise Java application are expected to be scalable, performant, flexible, maintainable and highly available.
+    To ensure this, we need to instrument the application with tooling, both during development to detect design
+    bottlenecks and on production to monitor application behaviour and health.
 </p>
+
 <p>
-The standard Java Management eXtension (JMX) provides the required backbone for nice management and monitoring 
-tools, but with the cost of complexity and requirement for application to compute the state it wants to expose.
+    The standard Java Management eXtension (JMX) provides the required backbone for nice management and monitoring
+    tools, but with the cost of complexity and requirement for application to compute the state it wants to expose.
 </p>
+
 <p>
-Profilers give very detailled report on code execution, performance, memory usage and thread-safety, but can only 
-be used during developpement.
+    Profilers give very detailled report on code execution, performance, memory usage and thread-safety, but can only
+    be used during developpement.
 </p>
+
 <p>
-Some opensource project allready try to fill the gap by providing simple monitoring tools :
+    Some opensource project allready try to fill the gap by providing simple monitoring tools :
 <ul>
-<li><a href="http://www.jamonapi.com">JAMon</a> is a well known monitoring toolkit, but lacks for a modular design
-and a clean tooling (separation between code and tests..). It is driven by a single individual, and as a 
-result doesn't take advantage of an apache-like community based evolution and developer collaboration.
-<li><a href="http://moskito.anotheria.net/">MoSKito</a> is nicely designed, but requires some technical
-inheritence and for this reason is too much intrusive. Its user community is still tiny accoring to sourceforge statistics</li>
+    <li><a href="http://www.jamonapi.com">JAMon</a> is a well known monitoring toolkit, but lacks for a modular design
+        and a clean tooling (separation between code and tests..). It is driven by a single individual, and as a
+        result doesn't take advantage of an apache-like community based evolution and developer collaboration.
+    <li><a href="http://moskito.anotheria.net/">MoSKito</a> is nicely designed, but requires some technical
+        inheritence and for this reason is too much intrusive. Its user community is still tiny accoring to sourceforge
+        statistics
+    </li>
 </ul>
 </p>
 
 
 <h3>(1) Scope of the Package</h3>
 
-<p>This proposal is to create a new apache commons component to provide a simple monitoring infrastructure, with simplicity and 
-extensibility in mind, and following Apache quality standards. By beeing hosted in apache commons, it expect to gather talentuous
-developers curisoity / interest and to envolve as a must-have component for java developers.
-.</p>
+<p>This proposal is to create a new apache commons component to provide a simple monitoring infrastructure, with
+    simplicity and
+    extensibility in mind, and following Apache quality standards. By beeing hosted in apache commons, it expect to
+    gather talentuous
+    developers curisoity / interest and to envolve as a must-have component for java developers.
+    .</p>
 
 
 <h3>(1.5) Interaction With Other Packages</h3>
 
 <p><em>monitoring</em> relies on standard Java 5 (or later) APIs for
-production deployment.  It utilizes the JUnit unit testing framework for
-developing and executing unit tests, but this is of interest only to
-developers of the component.</p>
+    production deployment. It utilizes the JUnit unit testing framework for
+    developing and executing unit tests, but this is of interest only to
+    developers of the component.</p>
+
 <p>Retrotranslator is used to create a backport version of the component to get used under Java 1.3 or 1.4. On such
-runtimes, backport-util-concurrent will be required.</p>
+    runtimes, backport-util-concurrent will be required.</p>
+
 <p><em>monitoring</em> provides Helper classes for various frameworks to make monitoring easier. Those dependencies
-are only required by user wanting to use them. Maven meta-datas are declared as <code>optional</code> to avoid unexpected transitive 
-dependencies.</p>
+    are only required by user wanting to use them. Maven meta-datas are declared as <code>optional</code> to avoid
+    unexpected transitive
+    dependencies.</p>
 
 <p>No external configuration files are utilized.</p>
 
@@ -76,24 +86,27 @@ dependencies.</p>
 <h3>(2) Initial Source of the Package</h3>
 
 <p>The original Java classes are created from scratch based on some initial experiments to
-build a clean monitoring toolkit.</p>
+    build a clean monitoring toolkit.</p>
 
 <p>The proposed package name for the new component is
-<code>org.apache.commons.monitoring</code>.</p>
+    <code>org.apache.commons.monitoring</code>.</p>
 
 
-<h3>(3)  Required Apache Commons Resources</h3>
+<h3>(3) Required Apache Commons Resources</h3>
 
 <ul>
-<li>SVN Repository - New directory <code>monitoring</code> in the
-    <code>commons</code> SVN repository.</li>
-<li>Mailing List - Discussions will take place on the general
-    <em>dev@commons.apache.org</em> mailing list.  To help
-    list subscribers identify messages of interest, it is suggested that
-    the message subject of messages about this component be prefixed with
-    [monitoring].</li>
-<li>JIRA Issue Tracking - New component "monitoring" under the "Commons" product
-    category, with appropriate version identifiers as needed.</li>
+    <li>SVN Repository - New directory <code>monitoring</code> in the
+        <code>commons</code> SVN repository.
+    </li>
+    <li>Mailing List - Discussions will take place on the general
+        <em>dev@commons.apache.org</em> mailing list. To help
+        list subscribers identify messages of interest, it is suggested that
+        the message subject of messages about this component be prefixed with
+        [monitoring].
+    </li>
+    <li>JIRA Issue Tracking - New component "monitoring" under the "Commons" product
+        category, with appropriate version identifiers as needed.
+    </li>
 </ul>
 
 
@@ -101,7 +114,7 @@ build a clean monitoring toolkit.</p>
 
 <p>The initial committers on the monitoring component shall be:
 <ul>
-  <li><a href="mailto:nicolas@apache.org">Nicolas De Loof</a></li>
+    <li><a href="mailto:nicolas@apache.org">Nicolas De Loof</a></li>
 </ul>
 </p>
 

Modified: commons/sandbox/monitoring/trunk/aop/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/aop/pom.xml?rev=1507950&r1=1506987&r2=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/aop/pom.xml (original)
+++ commons/sandbox/monitoring/trunk/aop/pom.xml Mon Jul 29 06:20:54 2013
@@ -16,50 +16,34 @@
   limitations under the License.
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
   <parent>
     <artifactId>commons-monitoring-parent</artifactId>
     <groupId>org.apache.commons.monitoring</groupId>
     <version>1.0-SNAPSHOT</version>
   </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.commons.monitoring</groupId>
-  <artifactId>commons-monitoring-instrumentation</artifactId>
+
+  <artifactId>commons-monitoring-aop</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <name>Commons Monitoring (Sandbox) :: AOP</name>
+
   <dependencies>
     <dependency>
       <groupId>org.apache.commons.monitoring</groupId>
       <artifactId>commons-monitoring-core</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-proxy</artifactId>
       <version>1.0</version>
-      <optional>true</optional>
-    </dependency>
-    <dependency>
-      <groupId>aopalliance</groupId>
-      <artifactId>aopalliance</artifactId>
-      <version>1.0</version>
-      <optional>true</optional>
-    </dependency>
-    <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>servlet-api</artifactId>
-      <version>2.3</version>
-      <scope>provided</scope>
-      <optional>true</optional>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.cxf</groupId>
-      <artifactId>cxf-rt-bindings-soap</artifactId>
-      <version>2.1.3</version>
-      <optional>true</optional>
     </dependency>
+
     <dependency>
-      <groupId>org.apache.cxf</groupId>
-      <artifactId>cxf-rt-transports-http</artifactId>
-      <version>2.1.3</version>
-      <optional>true</optional>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
     </dependency>
   </dependencies>
-</project>
\ No newline at end of file
+</project>

Copied: commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/AbstractPerformanceInterceptor.java (from r1506987, commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/aop/AbstractPerformanceInterceptor.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/AbstractPerformanceInterceptor.java?p2=commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/AbstractPerformanceInterceptor.java&p1=commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/aop/AbstractPerformanceInterceptor.java&r1=1506987&r2=1507950&rev=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/aop/AbstractPerformanceInterceptor.java (original)
+++ commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/AbstractPerformanceInterceptor.java Mon Jul 29 06:20:54 2013
@@ -15,82 +15,61 @@
  * limitations under the License.
  */
 
-package org.apache.commons.monitoring.instrumentation.aop;
+package org.apache.commons.monitoring.aop;
 
-import static org.apache.commons.monitoring.Unit.UNARY;
+import org.apache.commons.monitoring.Role;
+import org.apache.commons.monitoring.monitors.Monitor;
+import org.apache.commons.monitoring.repositories.Repository;
+import org.apache.commons.monitoring.stopwatches.StopWatch;
 
 import java.lang.reflect.Method;
 
-import org.apache.commons.monitoring.Monitor;
-import org.apache.commons.monitoring.Repository;
-import org.apache.commons.monitoring.StopWatch;
+import static org.apache.commons.monitoring.counter.Unit.UNARY;
 
 /**
  * A method interceptor that compute method invocation performances.
- * <p>
+ * <p/>
  * Concrete implementation will adapt the method interception API to
  * this class requirement.
  *
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
-public abstract class AbstractPerformanceInterceptor<T>
-{
-
-    protected Repository repository;
+public abstract class AbstractPerformanceInterceptor<T> {
 
     protected String category;
 
-    protected String subsystem;
-
-    protected MonitorNameExtractor monitorNameExtractor = new DefaultMonitorNameExtractor();
+    protected MonitorNameExtractor monitorNameExtractor;
 
-    public AbstractPerformanceInterceptor()
-    {
-        super();
+    public AbstractPerformanceInterceptor() {
+        setMonitorNameExtractor(DefaultMonitorNameExtractor.INSTANCE);
     }
 
     /**
      * API neutral method invocation
      */
-    protected Object doInvoke( T invocation )
-        throws Throwable
-    {
-        String name = getMonitorName( invocation );
-        if ( name == null )
-        {
-            return proceed( invocation );
+    protected Object doInvoke(final T invocation) throws Throwable {
+        final String name = getMonitorName(invocation);
+        if (name == null) {
+            return proceed(invocation);
         }
-        Monitor monitor = repository.getMonitor( name, category, subsystem );
-        StopWatch stopwatch = repository.start( monitor );
+
+        final Monitor monitor = Repository.INSTANCE.getMonitor(name, category);
+        final StopWatch stopwatch = Repository.INSTANCE.start(monitor);
         Throwable error = null;
-        try
-        {
-            return proceed( invocation );
-        }
-        catch ( Throwable t )
-        {
+        try {
+            return proceed(invocation);
+        } catch (final Throwable t) {
             error = t;
             throw t;
-        }
-        finally
-        {
+        } finally {
             stopwatch.stop();
-            beforeReturning( monitor, error, stopwatch.getElapsedTime() );
+            beforeReturning(monitor, error, stopwatch.getElapsedTime());
         }
     }
 
-    /**
-     * @param invocation
-     * @return
-     */
-    protected abstract Object proceed( T invocation )
-        throws Throwable;
+    protected abstract Object proceed(T invocation) throws Throwable;
 
-    /**
-     * @param invocation
-     * @return
-     */
-    protected abstract String getMonitorName( T invocation );
+    protected abstract String getMonitorName(T invocation);
 
     /**
      * Compute the monitor name associated to this method invocation
@@ -98,49 +77,21 @@ public abstract class AbstractPerformanc
      * @param method method being invoked
      * @return monitor name. If <code>null</code>, nothing will be monitored
      */
-    protected String getMonitorName( Method method )
-    {
-        return monitorNameExtractor.getMonitorName( method );
+    protected String getMonitorName(final Object instance, final Method method) {
+        return monitorNameExtractor.getMonitorName(instance, method);
     }
 
-    /**
-     * @param monitor the monitor associated to the method invocation
-     * @param error Throwable thrown by the method invocation if any
-     * @param duration the duration of the method invocation
-     */
-    protected void beforeReturning( Monitor monitor, Throwable error, long duration )
-    {
-        if ( error != null )
-        {
-            monitor.getCounter( Monitor.FAILURES ).add( 1, UNARY );
+    protected void beforeReturning(final Monitor monitor, final Throwable error, final long duration) {
+        if (error != null) {
+            monitor.getCounter(Role.FAILURES).add(duration);
         }
     }
 
-    /**
-     * Set a custom application-defined repository
-     *
-     * @param repository
-     */
-    public void setRepository( Repository repository )
-    {
-        this.repository = repository;
-    }
-
-    public void setCategory( String category )
-    {
+    public void setCategory(final String category) {
         this.category = category;
     }
 
-    public void setSubsystem( String subsystem )
-    {
-        this.subsystem = subsystem;
-    }
-
-    /**
-     * @param monitorNameExtractor the monitorNameExtractor to set
-     */
-    public void setMonitorNameExtractor( MonitorNameExtractor monitorNameExtractor )
-    {
+    public void setMonitorNameExtractor(final MonitorNameExtractor monitorNameExtractor) {
         this.monitorNameExtractor = monitorNameExtractor;
     }
 }
\ No newline at end of file

Copied: commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/DefaultMonitorNameExtractor.java (from r1506987, commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/aop/DefaultMonitorNameExtractor.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/DefaultMonitorNameExtractor.java?p2=commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/DefaultMonitorNameExtractor.java&p1=commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/aop/DefaultMonitorNameExtractor.java&r1=1506987&r2=1507950&rev=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/aop/DefaultMonitorNameExtractor.java (original)
+++ commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/DefaultMonitorNameExtractor.java Mon Jul 29 06:20:54 2013
@@ -15,25 +15,23 @@
  * limitations under the License.
  */
 
-package org.apache.commons.monitoring.instrumentation.aop;
+package org.apache.commons.monitoring.aop;
 
 import java.lang.reflect.Method;
 
 /**
- *
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
-public class DefaultMonitorNameExtractor
-    implements MonitorNameExtractor
-{
-
-    /**
-     * {@inheritDoc}
-     * @see org.apache.commons.monitoring.instrumentation.aop.MonitorNameExtractor#getMonitorName(java.lang.reflect.Method)
-     */
-    public String getMonitorName( Method method )
-    {
-        return method.getDeclaringClass().getSimpleName() + "." + method.getName();
+public class DefaultMonitorNameExtractor implements MonitorNameExtractor {
+    // singleton to avoid to need too much memory for nothing
+    public static final DefaultMonitorNameExtractor INSTANCE = new DefaultMonitorNameExtractor();
+
+    private DefaultMonitorNameExtractor() {
+        // no-op
+    }
+
+    public String getMonitorName(final Object instance, final Method method) {
+        return instance.getClass().getName() + "." + method.getName();
     }
 
 }

Copied: commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/MonitorNameExtractor.java (from r1506987, commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/aop/MonitorNameExtractor.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/MonitorNameExtractor.java?p2=commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/MonitorNameExtractor.java&p1=commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/aop/MonitorNameExtractor.java&r1=1506987&r2=1507950&rev=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/instrumentation/src/main/java/org/apache/commons/monitoring/instrumentation/aop/MonitorNameExtractor.java (original)
+++ commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/MonitorNameExtractor.java Mon Jul 29 06:20:54 2013
@@ -15,22 +15,10 @@
  * limitations under the License.
  */
 
-package org.apache.commons.monitoring.instrumentation.aop;
+package org.apache.commons.monitoring.aop;
 
 import java.lang.reflect.Method;
 
-/**
- *
- * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
- */
-public interface MonitorNameExtractor
-{
-
-    /**
-     * Compute the monitor name associated to this method invocation
-     *
-     * @param method method being invoked
-     * @return monitor name. If <code>null</code>, nothing will be monitored
-     */
-    String getMonitorName( Method method );
+public interface MonitorNameExtractor {
+    String getMonitorName(Object instance, Method method);
 }

Added: commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/MonitoringProxyFactory.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/MonitoringProxyFactory.java?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/MonitoringProxyFactory.java (added)
+++ commons/sandbox/monitoring/trunk/aop/src/main/java/org/apache/commons/monitoring/aop/MonitoringProxyFactory.java Mon Jul 29 06:20:54 2013
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.monitoring.aop;
+
+import org.apache.commons.monitoring.configuration.Configuration;
+import org.apache.commons.monitoring.util.ClassLoaders;
+import org.apache.commons.proxy.Invoker;
+import org.apache.commons.proxy.ProxyFactory;
+
+import java.lang.reflect.Method;
+
+public final class MonitoringProxyFactory {
+    private static final ProxyFactory PROXY_FACTORY = Configuration.newInstance(ProxyFactory.class);
+
+    public static <T> T monitor(final Class<T> clazz, final Object instance) {
+        return clazz.cast(PROXY_FACTORY.createInvokerProxy(ClassLoaders.current(), new MonitoringHandler(instance), new Class<?>[]{clazz}));
+    }
+
+    private MonitoringProxyFactory() {
+        // no-op
+    }
+
+    private static class MonitoringHandler extends AbstractPerformanceInterceptor<Invocation> implements Invoker {
+        private final Object instance;
+
+        public MonitoringHandler(final Object instance) {
+            this.instance = instance;
+        }
+
+        @Override
+        public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
+            return doInvoke(new Invocation(instance, method, args));
+        }
+
+        @Override
+        protected Object proceed(final Invocation invocation) throws Throwable {
+            return invocation.method.invoke(invocation.target, invocation.args);
+        }
+
+        @Override
+        protected String getMonitorName(final Invocation invocation) {
+            return getMonitorName(invocation.target, invocation.method);
+        }
+    }
+
+    private static class Invocation {
+        private final Object target;
+        private final Method method;
+        private final Object[] args;
+
+        private Invocation(final Object target, final Method method, final Object[] args) {
+            this.target = target;
+            this.method = method;
+            this.args = args;
+        }
+    }
+}

Added: commons/sandbox/monitoring/trunk/aop/src/test/java/org/apache/commons/monitoring/aop/MonitoringProxyFactoryTest.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/aop/src/test/java/org/apache/commons/monitoring/aop/MonitoringProxyFactoryTest.java?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/aop/src/test/java/org/apache/commons/monitoring/aop/MonitoringProxyFactoryTest.java (added)
+++ commons/sandbox/monitoring/trunk/aop/src/test/java/org/apache/commons/monitoring/aop/MonitoringProxyFactoryTest.java Mon Jul 29 06:20:54 2013
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.monitoring.aop;
+
+import org.apache.commons.monitoring.counter.Counter;
+import org.apache.commons.monitoring.repositories.Repository;
+import org.junit.Test;
+
+import java.util.concurrent.TimeUnit;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+public class MonitoringProxyFactoryTest {
+    @Test
+    public void test() {
+        final Foo foo = MonitoringProxyFactory.monitor(Foo.class, new FooImpl());
+        foo.haveARest(2000);
+
+        final Counter perf = Repository.INSTANCE.getMonitor(FooImpl.class.getName() + ".haveARest").getCounter("performances");
+        assertNotNull(perf);
+        assertEquals(2000, TimeUnit.NANOSECONDS.toMillis((int) perf.getMax()), 200);
+
+        try {
+            foo.throwSthg();
+        } catch (final Exception e) {
+            // normal
+        }
+
+        final Counter failures = Repository.INSTANCE.getMonitor(FooImpl.class.getName() + ".throwSthg").getCounter("failures");
+        assertNotNull(failures);
+        assertEquals(1, failures.getHits());
+    }
+
+    public static interface Foo {
+        void haveARest(long ms);
+        void throwSthg();
+    }
+
+    public static class FooImpl implements Foo {
+        @Override
+        public void haveARest(long ms) {
+            try {
+                Thread.sleep(ms);
+            } catch (final InterruptedException e) {
+                // no-ôp
+            }
+        }
+
+        public void throwSthg() {
+            throw new UnsupportedOperationException();
+        }
+    }
+}

Added: commons/sandbox/monitoring/trunk/aspectj/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/aspectj/pom.xml?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/aspectj/pom.xml (added)
+++ commons/sandbox/monitoring/trunk/aspectj/pom.xml Mon Jul 29 06:20:54 2013
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>commons-monitoring-parent</artifactId>
+    <groupId>org.apache.commons.monitoring</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>commons-monitoring-aspectj</artifactId>
+  <name>Commons Monitoring (Sandbox) :: AspectJ Integration</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.aspectj</groupId>
+      <artifactId>aspectjrt</artifactId>
+      <version>${aspectj.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons.monitoring</groupId>
+      <artifactId>commons-monitoring-aop</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.aspectj</groupId>
+      <artifactId>aspectjweaver</artifactId>
+      <version>${aspectj.version}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <argLine>-javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar</argLine>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <properties>
+    <aspectj.version>1.7.3</aspectj.version>
+  </properties>
+</project>

Added: commons/sandbox/monitoring/trunk/aspectj/src/main/java/org/apache/commons/monitoring/aspectj/CommonsMonitoringAspect.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/aspectj/src/main/java/org/apache/commons/monitoring/aspectj/CommonsMonitoringAspect.java?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/aspectj/src/main/java/org/apache/commons/monitoring/aspectj/CommonsMonitoringAspect.java (added)
+++ commons/sandbox/monitoring/trunk/aspectj/src/main/java/org/apache/commons/monitoring/aspectj/CommonsMonitoringAspect.java Mon Jul 29 06:20:54 2013
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.monitoring.aspectj;
+
+import org.apache.commons.monitoring.aop.AbstractPerformanceInterceptor;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.Signature;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+
+import java.lang.reflect.Method;
+
+@Aspect
+public abstract class CommonsMonitoringAspect extends AbstractPerformanceInterceptor<ProceedingJoinPoint> {
+    @Pointcut
+    protected abstract void pointcut();
+
+    @Around("pointcut()")
+    public Object monitor(final ProceedingJoinPoint pjp) throws Throwable {
+        return doInvoke(pjp);
+    }
+
+    @Override
+    protected Object proceed(final ProceedingJoinPoint invocation) throws Throwable {
+        return invocation.proceed();
+    }
+
+    @Override
+    protected String getMonitorName(final ProceedingJoinPoint invocation) {
+        final String monitorName = getMonitorName(invocation.getTarget(), findMethod(invocation.getSignature()));
+        if (monitorName != null) {
+            return monitorName;
+        }
+        return invocation.getSignature().toLongString();
+    }
+
+    private static Method findMethod(final Signature signature) {
+        if ("org.aspectj.runtime.reflect.MethodSignatureImpl".equals(signature.getClass().getName())) {
+            try {
+                final Method mtd = signature.getClass().getMethod("getMethod");
+                if (!mtd.isAccessible()) {
+                    mtd.setAccessible(true);
+                }
+                return Method.class.cast(mtd.invoke(signature));
+            } catch (final Exception e) {
+                // no-op
+            }
+        }
+        return null;
+    }
+}

Added: commons/sandbox/monitoring/trunk/aspectj/src/test/java/org/apache/commons/monitoring/aspectj/AspectJMonitoringTest.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/aspectj/src/test/java/org/apache/commons/monitoring/aspectj/AspectJMonitoringTest.java?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/aspectj/src/test/java/org/apache/commons/monitoring/aspectj/AspectJMonitoringTest.java (added)
+++ commons/sandbox/monitoring/trunk/aspectj/src/test/java/org/apache/commons/monitoring/aspectj/AspectJMonitoringTest.java Mon Jul 29 06:20:54 2013
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.monitoring.aspectj;
+
+import org.apache.commons.monitoring.repositories.Repository;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class AspectJMonitoringTest {
+    @Test
+    public void monitor() {
+        new MonitorMe().foo();
+        assertEquals(1, Repository.INSTANCE.getMonitor("org.apache.commons.monitoring.aspectj.AspectJMonitoringTest$MonitorMe.foo").getCounter("performances").getHits());
+    }
+
+    public static class MonitorMe {
+        public void foo() {}
+    }
+}

Added: commons/sandbox/monitoring/trunk/aspectj/src/test/resources/META-INF/aop.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/aspectj/src/test/resources/META-INF/aop.xml?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/aspectj/src/test/resources/META-INF/aop.xml (added)
+++ commons/sandbox/monitoring/trunk/aspectj/src/test/resources/META-INF/aop.xml Mon Jul 29 06:20:54 2013
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<aspectj>
+  <aspects>
+    <concrete-aspect name="org.apache.commons.aspectj.MyMonitoringAspectJ"
+                     extends="org.apache.commons.monitoring.aspectj.CommonsMonitoringAspect">
+      <pointcut name="pointcut" expression="execution(* org.apache.commons.monitoring.aspectj.AspectJMonitoringTest$MonitorMe.*(..))"/>
+    </concrete-aspect>
+  </aspects>
+
+  <weaver>
+    <include within="org.apache.commons.monitoring.aspectj.AspectJMonitoringTest$MonitorMe"/>
+  </weaver>
+</aspectj>

Modified: commons/sandbox/monitoring/trunk/cdi/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/cdi/pom.xml?rev=1507950&r1=1507949&r2=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/cdi/pom.xml (original)
+++ commons/sandbox/monitoring/trunk/cdi/pom.xml Mon Jul 29 06:20:54 2013
@@ -45,7 +45,7 @@
 
     <dependency>
       <groupId>org.apache.commons.monitoring</groupId>
-      <artifactId>commons-monitoring-instrumentation</artifactId>
+      <artifactId>commons-monitoring-aop</artifactId>
       <version>${project.version}</version>
     </dependency>
 
@@ -56,9 +56,8 @@
     <dependency>
       <groupId>org.apache.geronimo.specs</groupId>
       <artifactId>geronimo-servlet_2.5_spec</artifactId>
-      <version>1.2</version>
+      <scope>test</scope>
     </dependency>
-
     <dependency>
       <groupId>org.apache.openwebbeans.test</groupId>
       <artifactId>cditest-owb</artifactId>

Modified: commons/sandbox/monitoring/trunk/cdi/src/main/java/org/apache/commons/monitoring/cdi/CommonsMonitoringInterceptor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/cdi/src/main/java/org/apache/commons/monitoring/cdi/CommonsMonitoringInterceptor.java?rev=1507950&r1=1507949&r2=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/cdi/src/main/java/org/apache/commons/monitoring/cdi/CommonsMonitoringInterceptor.java (original)
+++ commons/sandbox/monitoring/trunk/cdi/src/main/java/org/apache/commons/monitoring/cdi/CommonsMonitoringInterceptor.java Mon Jul 29 06:20:54 2013
@@ -16,34 +16,29 @@
  */
 package org.apache.commons.monitoring.cdi;
 
-import org.apache.commons.monitoring.instrumentation.aop.AbstractPerformanceInterceptor;
-import org.apache.commons.monitoring.repositories.RepositoryFinder;
+import org.apache.commons.monitoring.aop.AbstractPerformanceInterceptor;
 
 import javax.interceptor.AroundInvoke;
+import javax.interceptor.AroundTimeout;
 import javax.interceptor.Interceptor;
 import javax.interceptor.InvocationContext;
 
-@Interceptor @Monitored
+@Interceptor
+@Monitored
 public class CommonsMonitoringInterceptor extends AbstractPerformanceInterceptor<InvocationContext> {
-    public CommonsMonitoringInterceptor() {
-        setRepository(RepositoryFinder.REPOSITORY);
-    }
-
     @AroundInvoke
-    public Object monitor(final InvocationContext invocationContext) throws Throwable
-    {
+    @AroundTimeout
+    public Object monitor(final InvocationContext invocationContext) throws Throwable {
         return doInvoke(invocationContext);
     }
 
     @Override
-    protected Object proceed(final InvocationContext invocation) throws Throwable
-    {
+    protected Object proceed(final InvocationContext invocation) throws Throwable {
         return invocation.proceed();
     }
 
     @Override
-    protected String getMonitorName(InvocationContext invocation)
-    {
-        return getMonitorName(invocation.getMethod());
+    protected String getMonitorName(final InvocationContext invocation) {
+        return getMonitorName(invocation.getTarget(), invocation.getMethod());
     }
 }

Modified: commons/sandbox/monitoring/trunk/cdi/src/main/java/org/apache/commons/monitoring/cdi/Monitored.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/cdi/src/main/java/org/apache/commons/monitoring/cdi/Monitored.java?rev=1507950&r1=1507949&r2=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/cdi/src/main/java/org/apache/commons/monitoring/cdi/Monitored.java (original)
+++ commons/sandbox/monitoring/trunk/cdi/src/main/java/org/apache/commons/monitoring/cdi/Monitored.java Mon Jul 29 06:20:54 2013
@@ -23,7 +23,7 @@ import java.lang.annotation.RetentionPol
 import java.lang.annotation.Target;
 
 @InterceptorBinding
-@Target({ElementType.TYPE, ElementType.METHOD })
+@Target({ElementType.TYPE, ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
 public @interface Monitored {
 }

Modified: commons/sandbox/monitoring/trunk/cdi/src/test/java/org/apache/commons/monitoring/cdi/CommonsMonitoringInterceptorTest.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/cdi/src/test/java/org/apache/commons/monitoring/cdi/CommonsMonitoringInterceptorTest.java?rev=1507950&r1=1507949&r2=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/cdi/src/test/java/org/apache/commons/monitoring/cdi/CommonsMonitoringInterceptorTest.java (original)
+++ commons/sandbox/monitoring/trunk/cdi/src/test/java/org/apache/commons/monitoring/cdi/CommonsMonitoringInterceptorTest.java Mon Jul 29 06:20:54 2013
@@ -16,8 +16,8 @@
  */
 package org.apache.commons.monitoring.cdi;
 
-import org.apache.commons.monitoring.Counter;
-import org.apache.commons.monitoring.repositories.RepositoryFinder;
+import org.apache.commons.monitoring.counter.Counter;
+import org.apache.commons.monitoring.repositories.Repository;
 import org.apache.webbeans.cditest.CdiTestContainer;
 import org.apache.webbeans.cditest.CdiTestContainerLoader;
 import org.junit.Test;
@@ -25,14 +25,14 @@ import org.junit.Test;
 import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.inject.spi.BeanManager;
 
+import java.util.concurrent.TimeUnit;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-public class CommonsMonitoringInterceptorTest
-{
+public class CommonsMonitoringInterceptorTest {
     @Test
-    public void checkMeasures() throws Exception
-    {
+    public void checkMeasures() throws Exception {
         final CdiTestContainer container = CdiTestContainerLoader.getCdiContainer();
         container.bootContainer();
         container.startApplicationScope();
@@ -45,13 +45,13 @@ public class CommonsMonitoringIntercepto
         container.stopApplicationScope();
         container.shutdownContainer();
 
-        final Counter perf = RepositoryFinder.REPOSITORY.getMonitor(MonitoredBean.class.getName() + ".twoSeconds").getCounter("performances");
+        final Counter perf = Repository.INSTANCE.getMonitor(MonitoredBean.class.getName() + ".twoSeconds").getCounter("performances");
         assertNotNull(perf);
-
-        assertEquals(2000, perf.getMax(), 200);
+        assertEquals(2000, TimeUnit.NANOSECONDS.toMillis((int) perf.getMax()), 200);
     }
 
-    @Monitored @ApplicationScoped
+    @Monitored
+    @ApplicationScoped
     public static class MonitoredBean {
         public void twoSeconds() {
             try {

Modified: commons/sandbox/monitoring/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/core/pom.xml?rev=1507950&r1=1507949&r2=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/core/pom.xml (original)
+++ commons/sandbox/monitoring/trunk/core/pom.xml Mon Jul 29 06:20:54 2013
@@ -16,35 +16,56 @@
   limitations under the License.
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                     http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
+
   <parent>
     <groupId>org.apache.commons.monitoring</groupId>
     <artifactId>commons-monitoring-parent</artifactId>
     <version>1.0-SNAPSHOT</version>
   </parent>
+
   <artifactId>commons-monitoring-core</artifactId>
   <packaging>jar</packaging>
-  <name>Commons Monitoring (Sandbox) core package</name>
+  <name>Commons Monitoring (Sandbox) :: Core</name>
+
   <dependencies>
-  	<dependency>
-  		<groupId>junit</groupId>
-  		<artifactId>junit</artifactId>
-  		<scope>test</scope>
-  	</dependency>
-  	<dependency>
-  		<groupId>org.apache.commons</groupId>
-  		<artifactId>commons-math</artifactId>
-  		<version>2.0</version>
-  	</dependency>
-  	<dependency>
-  		<groupId>javax.servlet</groupId>
-  		<artifactId>servlet-api</artifactId>
-  		<version>2.3</version>
-  		<scope>provided</scope>
-  		<optional>true</optional>
-  	</dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-math</artifactId>
+      <version>2.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+    </dependency>
   </dependencies>
 
+  <build>
+    <plugins>
+      <plugin> <!-- include commons-math in core to be able to install it in containers more trivially -->
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>2.1</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <relocations>
+                <relocation>
+                  <pattern>org.apache.commons.math</pattern>
+                  <shadedPattern>org.apache.commons.monitoring.math</shadedPattern>
+                </relocation>
+              </relocations>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
 </project>

Added: commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/MonitoringException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/MonitoringException.java?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/MonitoringException.java (added)
+++ commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/MonitoringException.java Mon Jul 29 06:20:54 2013
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.monitoring;
+
+public class MonitoringException extends RuntimeException {
+    public MonitoringException(final Exception e) {
+        super(e);
+    }
+}

Modified: commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Role.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Role.java?rev=1507950&r1=1507949&r2=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Role.java (original)
+++ commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Role.java Mon Jul 29 06:20:54 2013
@@ -17,68 +17,53 @@
 
 package org.apache.commons.monitoring;
 
+import org.apache.commons.monitoring.counter.Unit;
+
 import java.util.Collection;
 import java.util.Collections;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
+import static org.apache.commons.monitoring.counter.Unit.Time.NANOSECOND;
+
 /**
  * As a monitored resource may have multipe Metrics, each one has a dedicated 'role' that
  * defines the type of data or the monitored aspect it handles.
  *
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
- * @param <M> The metric this role relates to
  */
-public class Role
-    implements Comparable<Role>
-{
-    private String name;
-
-    private Unit unit;
+public class Role implements Comparable<Role> {
+    private static final ConcurrentMap<String, Role> ROLES = new ConcurrentHashMap<String, Role>();
 
-    private Metric.Type type;
+    public static final Role PERFORMANCES = new Role("performances", NANOSECOND);
+    public static final Role FAILURES = new Role("failures", Unit.UNARY);
 
-    private static final ConcurrentMap<String, Role> ROLES = new ConcurrentHashMap<String, Role>();
+    private String name;
+    private Unit unit;
 
-    public static Role getRole( String name )
-    {
-        return ROLES.get( name );
+    public static Role getRole(String name) {
+        return ROLES.get(name);
 
     }
 
-    public static Collection<Role> getRoles()
-    {
-        return Collections.unmodifiableCollection( ROLES.values() );
+    public static Collection<Role> getRoles() {
+        return Collections.unmodifiableCollection(ROLES.values());
     }
 
-    public Role( String name, Unit unit, Metric.Type type )
-    {
+    public Role(String name, Unit unit) {
         super();
-        if ( name == null )
-        {
-            throw new IllegalArgumentException( "A role name is required" );
-        }
-        if ( unit == null )
-        {
-            throw new IllegalArgumentException( "A role unit is required" );
+        if (name == null) {
+            throw new IllegalArgumentException("A role name is required");
         }
-        if ( type == null )
-        {
-            throw new IllegalArgumentException( "A type is required" );
+        if (unit == null) {
+            throw new IllegalArgumentException("A role unit is required");
         }
         this.name = name;
         this.unit = unit;
-        this.type = type;
-        Role old = ROLES.putIfAbsent( name, this );
-        if ( old != null )
-        {
-            if ( !type.equals( old.type ) )
-            {
-                throw new IllegalStateException( "A role already exists with this name but distinct type" );
-            }
-            if ( !unit.equals( old.unit ) )
-            {
-                throw new IllegalStateException( "A role already exists with this name but distinct unit" );
+        final Role old = ROLES.putIfAbsent(name, this);
+        if (old != null) {
+            if (!unit.equals(old.unit)) {
+                throw new IllegalStateException("A role already exists with this name but distinct unit");
             }
         }
     }
@@ -86,16 +71,14 @@ public class Role
     /**
      * @return the role
      */
-    public String getName()
-    {
+    public String getName() {
         return name;
     }
 
     /**
      * @return the unit
      */
-    public Unit getUnit()
-    {
+    public Unit getUnit() {
         return unit;
     }
 
@@ -103,8 +86,7 @@ public class Role
      * @see java.lang.Object#hashCode()
      */
     @Override
-    public int hashCode()
-    {
+    public int hashCode() {
         return name.hashCode();
     }
 
@@ -112,22 +94,18 @@ public class Role
      * @see java.lang.Object#equals(java.lang.Object)
      */
     @Override
-    public boolean equals( Object obj )
-    {
-        if ( this == obj )
+    public boolean equals(Object obj) {
+        if (this == obj)
             return true;
-        if ( obj == null )
+        if (obj == null)
             return false;
-        if ( getClass() != obj.getClass() )
+        if (getClass() != obj.getClass())
             return false;
         final Role other = (Role) obj;
-        if ( name == null )
-        {
-            if ( other.name != null )
+        if (name == null) {
+            if (other.name != null)
                 return false;
-        }
-        else if ( !name.equals( other.name ) )
-        {
+        } else if (!name.equals(other.name)) {
             return false;
         }
         return true;
@@ -136,20 +114,12 @@ public class Role
     /**
      * {@inheritDoc}
      */
-    public int compareTo( Role o )
-    {
-        return name.compareTo( o.name );
+    public int compareTo(Role o) {
+        return name.compareTo(o.name);
     }
 
     @Override
-    public String toString()
-    {
+    public String toString() {
         return name;
     }
-
-    public Metric.Type getType()
-    {
-        return type;
-    }
-
 }

Modified: commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Visitable.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Visitable.java?rev=1507950&r1=1507949&r2=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Visitable.java (original)
+++ commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Visitable.java Mon Jul 29 06:20:54 2013
@@ -20,7 +20,6 @@ package org.apache.commons.monitoring;
 /**
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
-public interface Visitable
-{
-    void accept( Visitor visitor );
+public interface Visitable {
+    void accept(Visitor visitor);
 }

Copied: commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Visitor.java (from r1506987, commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Visitor.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Visitor.java?p2=commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Visitor.java&p1=commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Visitor.java&r1=1506987&r2=1507950&rev=1507950&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Visitor.java (original)
+++ commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/Visitor.java Mon Jul 29 06:20:54 2013
@@ -17,16 +17,15 @@
 
 package org.apache.commons.monitoring;
 
+import org.apache.commons.monitoring.counter.Counter;
+import org.apache.commons.monitoring.monitors.Monitor;
+import org.apache.commons.monitoring.repositories.Repository;
+
 /**
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
-public interface Visitor
-{
-    void visit( Repository repository );
-
-    void visit( Monitor monitor );
-
-    void visit( Gauge gauge );
-
-    void visit( Counter counter );
+public interface Visitor {
+    void visit(Repository repository);
+    void visit(Monitor monitor);
+    void visit(Counter counter);
 }

Added: commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/configuration/Configuration.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/configuration/Configuration.java?rev=1507950&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/configuration/Configuration.java (added)
+++ commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/configuration/Configuration.java Mon Jul 29 06:20:54 2013
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.monitoring.configuration;
+
+import org.apache.commons.monitoring.MonitoringException;
+import org.apache.commons.monitoring.util.ClassLoaders;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+public final class Configuration {
+    private static final Logger LOGGER = Logger.getLogger(Configuration.class.getName());
+
+    private static final Collection<Closeable> INSTANCES = new ArrayList<Closeable>();
+
+    public static final String COMMONS_MONITORING_PREFIX = "org.apache.commons.monitoring.";
+    private static final String DEFAULT_CONFIGURATION_FILE = "commons-monitoring.properties";
+
+    public static enum Keys {
+        JMX("org.apache.commons.monitoring.jmx");
+
+        public final String key;
+
+        Keys(final String s) {
+            key = s;
+        }
+    }
+
+    private static final Properties PROPERTIES = new Properties(System.getProperties());
+    static {
+        try {
+            final InputStream is = findConfiguration();
+            if (is != null) {
+                PROPERTIES.load(is);
+            }
+        } catch (final Exception e) {
+            LOGGER.log(Level.SEVERE, e.getMessage(), e);
+        }
+    }
+    private static InputStream findConfiguration() throws FileNotFoundException {
+        final String filename = System.getProperty(COMMONS_MONITORING_PREFIX + "configuration", DEFAULT_CONFIGURATION_FILE);
+        if (new File(filename).exists()) {
+            return new FileInputStream(filename);
+        }
+
+        return ClassLoaders.current().getResourceAsStream(filename);
+    }
+
+    public static <T> T newInstance(final Class<T> clazz) {
+        try {
+            String config = PROPERTIES.getProperty(clazz.getName());
+            if (config == null) {
+                config = clazz.getPackage().getName() + ".Default" + clazz.getSimpleName();
+            }
+
+            Class<?> loadedClass;
+            try {
+                loadedClass = ClassLoaders.current().loadClass(config);
+            } catch (final Throwable throwable) { // NoClassDefFoundError or Exception
+                loadedClass = clazz;
+            }
+
+            final Object instance = loadedClass.newInstance();
+            if (Closeable.class.isInstance(instance)) {
+                INSTANCES.add(Closeable.class.cast(instance));
+            }
+            return clazz.cast(instance);
+        } catch (final Exception e) {
+            throw new MonitoringException(e);
+        }
+    }
+
+    public static boolean isActivated(final Keys key) {
+        return Boolean.parseBoolean(getProperty(key.key, "false"));
+    }
+
+    public static String getProperty(final String key, final String defaultValue) {
+        return PROPERTIES.getProperty(key, defaultValue);
+    }
+
+    public static void shutdown() {
+        for (final Closeable c : INSTANCES) {
+            try {
+                c.close();
+            } catch (IOException e) {
+                // no-op
+            }
+        }
+        INSTANCES.clear();
+    }
+
+    private Configuration() {
+        // no-op
+    }
+}



Mime
View raw message