incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1149390 - in /sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine: impl/RequestProcessorMBeanImpl.java impl/SlingMainServlet.java impl/SlingRequestProcessorImpl.java jmx/RequestProcessor.java jmx/RequestProcessorMBean.java
Date Thu, 21 Jul 2011 22:28:52 GMT
Author: justin
Date: Thu Jul 21 22:28:51 2011
New Revision: 1149390

URL: http://svn.apache.org/viewvc?rev=1149390&view=rev
Log:
SLING-1476 - renaming attributes per Bertrand's comments; moving mbean implementation to a
non-exported class (helps to read the spec)

Added:
    sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/RequestProcessorMBeanImpl.java
      - copied, changed from r1148949, sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/jmx/RequestProcessor.java
Removed:
    sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/jmx/RequestProcessor.java
Modified:
    sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
    sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingRequestProcessorImpl.java
    sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/jmx/RequestProcessorMBean.java

Copied: sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/RequestProcessorMBeanImpl.java
(from r1148949, sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/jmx/RequestProcessor.java)
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/RequestProcessorMBeanImpl.java?p2=sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/RequestProcessorMBeanImpl.java&p1=sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/jmx/RequestProcessor.java&r1=1148949&r2=1149390&rev=1149390&view=diff
==============================================================================
--- sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/jmx/RequestProcessor.java
(original)
+++ sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/RequestProcessorMBeanImpl.java
Thu Jul 21 22:28:51 2011
@@ -14,21 +14,22 @@
  * License for the specific language governing permissions and limitations under
  * the License.
  */
-package org.apache.sling.engine.jmx;
+package org.apache.sling.engine.impl;
 
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
+import javax.management.StandardMBean;
 
 import org.apache.commons.math.stat.descriptive.SynchronizedSummaryStatistics;
+import org.apache.sling.engine.jmx.RequestProcessorMBean;
 
 /**
  * This is the implementation of the management interface for the RequestProcessor.
  */
-public class RequestProcessor implements RequestProcessorMBean {
+public class RequestProcessorMBeanImpl extends StandardMBean implements RequestProcessorMBean
{
 
     private final SynchronizedSummaryStatistics durationStatistics;
 
-    public RequestProcessor() {
+    public RequestProcessorMBeanImpl() {
+        super(RequestProcessorMBean.class, false);
         this.durationStatistics = new SynchronizedSummaryStatistics();
     }
 
@@ -36,11 +37,11 @@ public class RequestProcessor implements
         durationStatistics.addValue(value);
     }
 
-    public long getCount() {
+    public long getRequestsCount() {
         return durationStatistics.getN();
     }
     
-    public double getMeanRequestDuration() {
+    public double getMeanRequestDurationMsec() {
         return durationStatistics.getMean();
     }
     

Modified: sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java?rev=1149390&r1=1149389&r2=1149390&view=diff
==============================================================================
--- sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
(original)
+++ sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
Thu Jul 21 22:28:51 2011
@@ -57,7 +57,6 @@ import org.apache.sling.engine.impl.para
 import org.apache.sling.engine.impl.request.RequestData;
 import org.apache.sling.engine.impl.request.RequestHistoryConsolePlugin;
 import org.apache.sling.engine.jmx.RequestProcessorMBean;
-import org.apache.sling.engine.jmx.RequestProcessor;
 import org.apache.sling.engine.servlets.ErrorHandler;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
@@ -347,7 +346,7 @@ public class SlingMainServlet extends Ge
             Dictionary<String, String> mbeanProps = new Hashtable<String, String>();
             mbeanProps.put("jmx.objectname", "org.apache.sling:type=engine,service=RequestProcessor");
 
-            RequestProcessor mbean = new RequestProcessor();
+            RequestProcessorMBeanImpl mbean = new RequestProcessorMBeanImpl();
             bundleContext.registerService(RequestProcessorMBean.class.getName(), mbean, mbeanProps);
             requestProcessor.setMBean(mbean);
         } catch (Throwable t) {

Modified: sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingRequestProcessorImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingRequestProcessorImpl.java?rev=1149390&r1=1149389&r2=1149390&view=diff
==============================================================================
--- sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingRequestProcessorImpl.java
(original)
+++ sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingRequestProcessorImpl.java
Thu Jul 21 22:28:51 2011
@@ -57,7 +57,6 @@ import org.apache.sling.engine.impl.log.
 import org.apache.sling.engine.impl.request.ContentData;
 import org.apache.sling.engine.impl.request.RequestData;
 import org.apache.sling.engine.impl.request.RequestHistoryConsolePlugin;
-import org.apache.sling.engine.jmx.RequestProcessor;
 import org.apache.sling.engine.servlets.ErrorHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -79,7 +78,7 @@ public class SlingRequestProcessorImpl i
 
     private ServletFilterManager filterManager;
 
-    private RequestProcessor mbean;
+    private RequestProcessorMBeanImpl mbean;
 
     // ---------- helper setters
 
@@ -121,7 +120,7 @@ public class SlingRequestProcessorImpl i
         this.filterManager = filterManager;
     }
 
-    void setMBean(final RequestProcessor mbean) {
+    void setMBean(final RequestProcessorMBeanImpl mbean) {
         this.mbean = mbean;
     }
 

Modified: sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/jmx/RequestProcessorMBean.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/jmx/RequestProcessorMBean.java?rev=1149390&r1=1149389&r2=1149390&view=diff
==============================================================================
--- sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/jmx/RequestProcessorMBean.java
(original)
+++ sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/jmx/RequestProcessorMBean.java
Thu Jul 21 22:28:51 2011
@@ -22,9 +22,9 @@ package org.apache.sling.engine.jmx;
  */
 public interface RequestProcessorMBean {
 
-    long getCount();
+    long getRequestsCount();
     
-    double getMeanRequestDuration();
+    double getMeanRequestDurationMsec();
     
     void resetStatistics();
 



Mime
View raw message