jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1153899 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/ main/java/org/apache/jackrabbit/core/jmx/ main/java/org/apache/jackrabbit/core/jmx/core/ main/java/org/apache/jackrabbit/core/jmx/query/ main/java/or...
Date Thu, 04 Aug 2011 15:01:18 GMT
Author: alexparvulescu
Date: Thu Aug  4 15:01:17 2011
New Revision: 1153899

URL: http://svn.apache.org/viewvc?rev=1153899&view=rev
Log:
JCR-2936 JMX Bindings for Jackrabbit
 - full rollback

Removed:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jmx/JackrabbitBaseMBean.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jmx/JmxRegistry.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jmx/JmxRegistryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jmx/core/
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jmx/query/
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jmx/util/
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/jmx/AbstractJmxTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/jmx/core/
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/jmx/query/
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/jmx/util/
Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryContext.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryObjectModelImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionState.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryContext.java?rev=1153899&r1=1153898&r2=1153899&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryContext.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryContext.java
Thu Aug  4 15:01:17 2011
@@ -21,7 +21,6 @@ import org.apache.jackrabbit.core.data.D
 import org.apache.jackrabbit.core.fs.FileSystem;
 import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.id.NodeIdFactory;
-import org.apache.jackrabbit.core.jmx.JmxRegistry;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
 import org.apache.jackrabbit.core.security.JackrabbitSecurityManager;
 import org.apache.jackrabbit.core.security.authorization.PrivilegeRegistry;
@@ -104,8 +103,6 @@ public class RepositoryContext {
      * Repository-wide timer instance.
      */
     private final Timer timer = new Timer(false);
-    
-    private JmxRegistry jmxRegistry;
 
     /**
      * Creates a component context for the given repository.
@@ -362,13 +359,4 @@ public class RepositoryContext {
         return nodeIdFactory;
     }
 
-    public JmxRegistry getJmxRegistry() {
-        assert jmxRegistry != null;
-        return jmxRegistry;
-    }
-
-    public void setJmxRegistry(JmxRegistry jmxRegistry) {
-        assert jmxRegistry != null;
-        this.jmxRegistry = jmxRegistry;
-    }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java?rev=1153899&r1=1153898&r2=1153899&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
Thu Aug  4 15:01:17 2011
@@ -82,8 +82,6 @@ import org.apache.jackrabbit.core.fs.Fil
 import org.apache.jackrabbit.core.fs.FileSystemResource;
 import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.id.NodeIdFactory;
-import org.apache.jackrabbit.core.jmx.JmxRegistry;
-import org.apache.jackrabbit.core.jmx.JmxRegistryImpl;
 import org.apache.jackrabbit.core.lock.LockManager;
 import org.apache.jackrabbit.core.lock.LockManagerImpl;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
@@ -233,8 +231,6 @@ public class RepositoryImpl extends Abst
      */
     private final CacheManager cacheMgr = new CacheManager();
 
-    private final JmxRegistry jmxRegistry = new JmxRegistryImpl();
-
     /**
      * Chanel for posting create workspace messages.
      */
@@ -359,9 +355,6 @@ public class RepositoryImpl extends Abst
             // initialize system search manager
             getSystemSearchManager(repConfig.getDefaultWorkspaceName());
 
-            //this has to be live before initSecurityManager(), to be able to track all the
queries
-            initJmxRegistry();
-
             // Initialise the security manager;
             initSecurityManager();
 
@@ -468,10 +461,6 @@ public class RepositoryImpl extends Abst
         return cacheMgr;
     }
 
-    public JmxRegistry getJmxRegistry() {
-        return jmxRegistry;
-    }
-
     /**
      * Creates the {@link org.apache.jackrabbit.core.security.JackrabbitSecurityManager SecurityManager}
      * of this <code>Repository</code> and adds it to the repository context.
@@ -1013,7 +1002,6 @@ public class RepositoryImpl extends Abst
         synchronized (activeSessions) {
             session.addListener(this);
             activeSessions.put(session, session);
-            jmxRegistry.getCoreStat().sessionCreated();
         }
     }
 
@@ -1204,8 +1192,6 @@ public class RepositoryImpl extends Abst
 
         context.getTimer().cancel();
 
-        jmxRegistry.stop();
-
         log.info("Repository has been shutdown");
     }
 
@@ -1466,11 +1452,6 @@ public class RepositoryImpl extends Abst
         return new GarbageCollector(context.getDataStore(), ipmList, sessions);
     }
 
-    protected void initJmxRegistry(){
-        this.jmxRegistry.start();
-        this.context.setJmxRegistry(jmxRegistry);
-    }
-
     //-----------------------------------------------------------< Repository >
     /**
      * {@inheritDoc}
@@ -1605,7 +1586,6 @@ public class RepositoryImpl extends Abst
         synchronized (activeSessions) {
             // remove session from active sessions
             activeSessions.remove(session);
-            jmxRegistry.getCoreStat().sessionLoggedOut();
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java?rev=1153899&r1=1153898&r2=1153899&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
Thu Aug  4 15:01:17 2011
@@ -131,16 +131,13 @@ public class QueryImpl extends AbstractQ
                             throws RepositoryException {
                         return query.execute(offset, limit);
                     }
-
                     public String toString() {
                         return "query.execute(" + statement + ")";
                     }
                 });
-        time = System.currentTimeMillis() - time;
-        sessionContext.getRepositoryContext().getJmxRegistry().getQueryStat()
-                .logQuery(language, statement, time);
-
+        
         if (log.isDebugEnabled()) {
+            time = System.currentTimeMillis() - time;
             NumberFormat format = NumberFormat.getNumberInstance();
             format.setMinimumFractionDigits(2);
             format.setMaximumFractionDigits(2);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryObjectModelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryObjectModelImpl.java?rev=1153899&r1=1153898&r2=1153899&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryObjectModelImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryObjectModelImpl.java
Thu Aug  4 15:01:17 2011
@@ -122,12 +122,8 @@ public class QueryObjectModelImpl extend
         long time = System.currentTimeMillis();
         QueryResult qr = engine.execute(getColumns(), getSource(),
                 getConstraint(), getOrderings(), offset, limit);
-        time = System.currentTimeMillis() - time;
-
-        sessionContext.getRepositoryContext().getJmxRegistry().getQueryStat()
-                .logQuery(language, statement, time);
-        
         if (log.isDebugEnabled()) {
+            time = System.currentTimeMillis() - time;
             NumberFormat format = NumberFormat.getNumberInstance();
             format.setMinimumFractionDigits(2);
             format.setMaximumFractionDigits(2);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionState.java?rev=1153899&r1=1153898&r2=1153899&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionState.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionState.java
Thu Aug  4 15:01:17 2011
@@ -23,7 +23,6 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
 import org.apache.jackrabbit.core.WorkspaceManager;
-import org.apache.jackrabbit.core.jmx.core.CoreStat;
 import org.apache.jackrabbit.core.observation.ObservationDispatcher;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -181,22 +180,20 @@ public class SessionState {
             }
 
             try {
-                final CoreStat coreStat = context.getRepositoryContext().getJmxRegistry().getCoreStat();
                 // Perform the actual operation, optionally with debug logs
-                if (log.isDebugEnabled() || coreStat.isEnabled()) {
-                    long start = System.nanoTime();
+                if (log.isDebugEnabled()) {
                     log.debug("Performing {}", operation);
+                    long start = System.nanoTime();
                     try {
                         return operation.perform(context);
                     } finally {
                         long time = System.nanoTime() - start;
-                        coreStat.onSessionOperation(isWriteOperation, time);
                         if (time > NS_PER_MS) {
-                            log.debug("Performed {} in {}ms", operation, time
-                                    / NS_PER_MS);
+                            log.debug("Performed {} in {}ms",
+                                    operation, time / NS_PER_MS);
                         } else {
-                            log.debug("Performed {} in {}us", operation, time
-                                    / NS_PER_US);
+                            log.debug("Performed {} in {}us",
+                                    operation, time / NS_PER_US);
                         }
                     }
                 } else {



Mime
View raw message