activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r394992 - /incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/ControlFile.java
Date Tue, 18 Apr 2006 18:03:29 GMT
Author: chirino
Date: Tue Apr 18 11:03:27 2006
New Revision: 394992

URL: http://svn.apache.org/viewcvs?rev=394992&view=rev
Log:
We now check to see it org.apache.activeio.journal.active.DisableLocking system property is
set to true, if so we don't attempt to do any file locking.  
Used to help work around Hibernate ClassCastException.

Modified:
    incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/ControlFile.java

Modified: incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/ControlFile.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/ControlFile.java?rev=394992&r1=394991&r2=394992&view=diff
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/ControlFile.java
(original)
+++ incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/ControlFile.java
Tue Apr 18 11:03:27 2006
@@ -43,7 +43,9 @@
     private final RandomAccessFile file;
     private final FileChannel channel;
     private final ByteBufferPacket controlData;
+    
     private final static boolean brokenFileLock = "true".equals(System.getProperty("java.nio.channels.FileLock.broken",
"false"));
+    private final static boolean disableLocking = "true".equals(System.getProperty("org.apache.activeio.journal.active.DisableLocking",
"false"));
 
     private long controlDataVersion=0;
     private FileLock lock;
@@ -65,6 +67,8 @@
      * @throws IOException 
      */
     public void lock() throws IOException {
+        if( disableLocking )
+            return;
         Set set = getVmLockSet();
         synchronized (set) {
             if (lock == null) {
@@ -89,6 +93,9 @@
      * @throws IOException
      */
     public void unlock() throws IOException {
+        if( disableLocking )
+            return;
+        
         Set set = getVmLockSet();
         synchronized (set) {
             if (lock != null) {



Mime
View raw message