jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1517851 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr: RefreshManager.java RepositoryImpl.java delegate/RefreshManager.java delegate/SessionDelegate.java
Date Tue, 27 Aug 2013 15:34:57 GMT
Author: mduerig
Date: Tue Aug 27 15:34:56 2013
New Revision: 1517851

URL: http://svn.apache.org/r1517851
Log:
OAK-960 Enable session refresh state coordination between multiple session in single thread
- Move RefreshManager to jcr package

Added:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RefreshManager.java
  (contents, props changed)
      - copied, changed from r1517850, jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/RefreshManager.java
Removed:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/RefreshManager.java
Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/SessionDelegate.java

Copied: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RefreshManager.java
(from r1517850, jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/RefreshManager.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RefreshManager.java?p2=jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RefreshManager.java&p1=jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/RefreshManager.java&r1=1517850&r2=1517851&rev=1517851&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/RefreshManager.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RefreshManager.java
Tue Aug 27 15:34:56 2013
@@ -17,12 +17,14 @@
  * under the License.
  */
 
-package org.apache.jackrabbit.oak.jcr.delegate;
+package org.apache.jackrabbit.oak.jcr;
 
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
 import static java.util.concurrent.TimeUnit.MINUTES;
 
 import org.apache.jackrabbit.oak.jcr.operation.SessionOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This class contains the auto refresh logic for sessions, which is done to enhance backwards
@@ -41,6 +43,8 @@ import org.apache.jackrabbit.oak.jcr.ope
  * See OAK-960
  */
 public class RefreshManager {
+    private static final Logger log = LoggerFactory.getLogger(RefreshManager.class);
+
     private final Exception initStackTrace = new Exception("The session was created here:");
     private final long refreshInterval;
 
@@ -75,7 +79,7 @@ public class RefreshManager {
      * @param sessionOperation  the operation to be executed
      * @return  {@code true} if a refreshed, {@code false} otherwise.
      */
-    boolean needsRefresh(SessionOperation<?> sessionOperation) {
+    public boolean needsRefresh(SessionOperation<?> sessionOperation) {
         long now = System.currentTimeMillis();
         long timeElapsed = now - lastAccessed;
         lastAccessed = now;
@@ -87,7 +91,7 @@ public class RefreshManager {
                     && timeElapsed > MILLISECONDS.convert(1, MINUTES)) {
                 // TODO replace logging with JMX monitoring. See OAK-941
                 // Warn once if this session has been idle too long
-                SessionDelegate.log.warn("This session has been idle for " + MINUTES.convert(timeElapsed,
MILLISECONDS) +
+                log.warn("This session has been idle for " + MINUTES.convert(timeElapsed,
MILLISECONDS) +
                         " minutes and might be out of date. Consider using a fresh session
or explicitly" +
                         " refresh the session.", initStackTrace);
                 warnIfIdle = false;
@@ -107,7 +111,7 @@ public class RefreshManager {
         return false;
     }
 
-    void refreshAtNextAccess() {
+    public void refreshAtNextAccess() {
         refreshAtNextAccess = true;
     }
 

Propchange: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RefreshManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RefreshManager.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java?rev=1517851&r1=1517850&r2=1517851&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
Tue Aug 27 15:34:56 2013
@@ -39,7 +39,6 @@ import org.apache.jackrabbit.api.securit
 import org.apache.jackrabbit.commons.SimpleValueFactory;
 import org.apache.jackrabbit.oak.api.ContentRepository;
 import org.apache.jackrabbit.oak.api.ContentSession;
-import org.apache.jackrabbit.oak.jcr.delegate.RefreshManager;
 import org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate;
 import org.apache.jackrabbit.oak.spi.security.SecurityProvider;
 import org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard;

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/SessionDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/SessionDelegate.java?rev=1517851&r1=1517850&r2=1517851&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/SessionDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/SessionDelegate.java
Tue Aug 27 15:34:56 2013
@@ -35,6 +35,7 @@ import org.apache.jackrabbit.oak.api.Roo
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.core.IdentifierManager;
+import org.apache.jackrabbit.oak.jcr.RefreshManager;
 import org.apache.jackrabbit.oak.jcr.operation.SessionOperation;
 import org.apache.jackrabbit.oak.jcr.security.AccessManager;
 import org.apache.jackrabbit.oak.spi.security.SecurityProvider;



Mime
View raw message