activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r412797 - in /incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active: ControlFile.java JournalLockedException.java
Date Thu, 08 Jun 2006 16:53:42 GMT
Author: chirino
Date: Thu Jun  8 09:53:42 2006
New Revision: 412797

URL: http://svn.apache.org/viewvc?rev=412797&view=rev
Log:
Added a custom IOException so that apps interested in the Locked journal condition can more
easily trap the error.

Added:
    incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/JournalLockedException.java
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/viewvc/incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/ControlFile.java?rev=412797&r1=412796&r2=412797&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
Thu Jun  8 09:53:42 2006
@@ -73,14 +73,14 @@
         synchronized (set) {
             if (lock == null) {
                 if (!set.add(canonicalPath)) {
-                    throw new IOException("Journal is already opened by this application.");
+                    throw new JournalLockedException("Journal is already opened by this application.");
                 }
 
                 if( !brokenFileLock ) {
                     lock = channel.tryLock();
                     if (lock == null) {
                         set.remove(canonicalPath);
-                        throw new IOException("Journal is already opened by another application");
+                        throw new JournalLockedException("Journal is already opened by another
application");
                     }
                 }
             }

Added: incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/JournalLockedException.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/JournalLockedException.java?rev=412797&view=auto
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/JournalLockedException.java
(added)
+++ incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/JournalLockedException.java
Thu Jun  8 09:53:42 2006
@@ -0,0 +1,42 @@
+/** 
+ * Copyright 2006 The Apache Software Foundation
+ * 
+ * Copyright 2005 Hiram Chirino
+ * 
+ * Licensed 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.activeio.journal.active;
+
+import java.io.IOException;
+
+/**
+ * @version $Revision$
+ */
+public class JournalLockedException extends IOException {
+
+    private static final long serialVersionUID = -3696987774575855799L;
+
+    public JournalLockedException() {
+        super();
+    }
+
+    /**
+     * @param arg0
+     */
+    public JournalLockedException(String arg0) {
+        super(arg0);
+    }
+
+}



Mime
View raw message