jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r478991 - /jackrabbit/branches/1.1/jackrabbit/src/main/java/org/apache/jackrabbit/core/fs/local/HandleMonitor.java
Date Fri, 24 Nov 2006 20:39:59 GMT
Author: jukka
Date: Fri Nov 24 12:39:58 2006
New Revision: 478991

URL: http://svn.apache.org/viewvc?view=rev&rev=478991
Log:
1.1: Merged revision 474234 (JCR-628)

Modified:
    jackrabbit/branches/1.1/jackrabbit/src/main/java/org/apache/jackrabbit/core/fs/local/HandleMonitor.java

Modified: jackrabbit/branches/1.1/jackrabbit/src/main/java/org/apache/jackrabbit/core/fs/local/HandleMonitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.1/jackrabbit/src/main/java/org/apache/jackrabbit/core/fs/local/HandleMonitor.java?view=diff&rev=478991&r1=478990&r2=478991
==============================================================================
--- jackrabbit/branches/1.1/jackrabbit/src/main/java/org/apache/jackrabbit/core/fs/local/HandleMonitor.java
(original)
+++ jackrabbit/branches/1.1/jackrabbit/src/main/java/org/apache/jackrabbit/core/fs/local/HandleMonitor.java
Fri Nov 24 12:39:58 2006
@@ -21,8 +21,8 @@
 import org.slf4j.LoggerFactory;
 
 import java.io.File;
-import java.io.FileDescriptor;
 import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.io.InputStream;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -133,7 +133,7 @@
          * Creates a new handle for a file
          * @param file
          */
-        public Handle(File file) {
+        private Handle(File file) {
             this.file = file;
         }
 
@@ -142,7 +142,7 @@
          * @return
          * @throws FileNotFoundException
          */
-        public InputStream open() throws FileNotFoundException {
+        private InputStream open() throws FileNotFoundException {
             Handle.MonitoredInputStream in = new Handle.MonitoredInputStream(file);
             streams.add(in);
             return in;
@@ -152,7 +152,7 @@
          * Closes a stream
          * @param in
          */
-        public void close(MonitoredInputStream in) {
+        private void close(MonitoredInputStream in) {
             streams.remove(in);
             if (streams.isEmpty()) {
                 HandleMonitor.this.close(file);
@@ -162,14 +162,14 @@
         /**
          * Dumps this handle
          */
-        public void dump() {
+        private void dump() {
             dump(false);
         }
 
         /**
          * Dumps this handle
          */
-        public void dump(boolean detailed) {
+        private void dump(boolean detailed) {
             if (detailed) {
                 log.info("- " + file.getPath() + ", " + streams.size());
                 Iterator iter = streams.iterator();
@@ -191,52 +191,29 @@
             /**
              * throwable of the time, the stream was created
              */
-            private final Throwable throwable;
+            private final Throwable throwable = new Exception();
 
             /**
              * {@inheritDoc}
              */
-            public MonitoredInputStream(File file) throws FileNotFoundException {
+            private MonitoredInputStream(File file) throws FileNotFoundException {
                 super(file);
-                // register the throwable
-                try {
-                    throw new Exception();
-                } catch (Exception e) {
-                    throwable = e;
-                }
             }
 
             /**
-             * {@inheritDoc}
+             * dumps this stream
              */
-            public MonitoredInputStream(FileDescriptor fdObj) {
-                super(fdObj);
-                // register the throwable
-                try {
-                    throw new Exception();
-                } catch (Exception e) {
-                    throwable = e;
-                }
+            private void dump() {
+                log.info("- opened by : ", throwable);
             }
 
             /**
              * {@inheritDoc}
              */
-            public MonitoredInputStream(String name) throws FileNotFoundException {
-                super(name);
-                // register the throwable
-                try {
-                    throw new Exception();
-                } catch (Exception e) {
-                    throwable = e;
-                }
-            }
-
-            /**
-             * dumps this stream
-             */
-            public void dump() {
-                log.info("- opened by : ", throwable);
+            public void close() throws IOException {
+                // remove myself from the set
+                Handle.this.close(this);
+                super.close();
             }
 
         }



Mime
View raw message