/[gzz]/gzz/lava/gzz/storm/impl/AbstractPool.java
ViewVC logotype

Diff of /gzz/lava/gzz/storm/impl/AbstractPool.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15 by benja, Sun Jan 19 00:55:59 2003 UTC revision 1.16 by benja, Sun Jan 19 01:08:51 2003 UTC
# Line 90  public abstract class AbstractPool imple Line 90  public abstract class AbstractPool imple
90          return ((PointerIndexType.Index)index).getPointer(uri);          return ((PointerIndexType.Index)index).getPointer(uri);
91      }      }
92    
     /**  
      *  <code>block</code> and <code>closed</code>  
      *  must be set by <code>close()</code>.  
      */  
93      protected abstract class AbstractBlockOutputStream      protected abstract class AbstractBlockOutputStream
94          extends BlockOutputStream {          extends BlockOutputStream {
95    
96          protected Header822 header;          protected Header822 header;
97          protected Block block;          protected Block block;
98          protected boolean closed = false;  
99            /** Whether <code>close()</code> has already been called.
100             *  If <code>false</code>, <code>getBlock()</code> and so on
101             *  cannot be called yet.
102             */
103            protected boolean closed;
104    
105          /** Create a new AbstractBlockOutputStream object          /** Create a new AbstractBlockOutputStream object
106           *  and write the given header to it.           *  and write the given header to it.
# Line 112  public abstract class AbstractPool imple Line 113  public abstract class AbstractPool imple
113              header.writeTo(this);              header.writeTo(this);
114          }          }
115    
116            public void close() throws IOException {
117                if(closed) return;
118                closed = true;
119                out.close();
120                block = makeBlock();
121            }
122    
123            /** Create the block and add it to the pool.
124             *  When <code>close()</code> is called for the first time,
125             *  it calls this method internally.
126             *  @return The new block.
127             */
128            protected abstract Block makeBlock() throws IOException;
129    
130          public Block getBlock() { return block; }          public Block getBlock() { return block; }
131          public Header822 getHeader() { return header; }          public Header822 getHeader() { return header; }
132      }      }

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26