1 | /*
|
---|
2 | * Copyright (C) 1997 Pharos IP Pty Ltd
|
---|
3 | * Confidential. All rights reserved.
|
---|
4 | * $Id: Closeable.java 10737 2005-10-19 03:06:40Z kjdon $
|
---|
5 | */
|
---|
6 |
|
---|
7 | package au.com.pharos.gdbm;
|
---|
8 |
|
---|
9 | import java.io.IOException;
|
---|
10 |
|
---|
11 | /** A Closeable object is one having a connection to an underlying
|
---|
12 | * data store that may be flushed or closed.
|
---|
13 | *
|
---|
14 | * <P>This interface is intended to complement the Dictionary and
|
---|
15 | * Collection interfaces by reflecting the fact that many such objects
|
---|
16 | * may be closed.
|
---|
17 | *
|
---|
18 | * @author Martin Pool
|
---|
19 | * @version $Revision: 10737 $
|
---|
20 | **/
|
---|
21 | public interface Closeable {
|
---|
22 | /** Write outstanding changes to the underlying database, and
|
---|
23 | * break the connection, freeing any associated resources or
|
---|
24 | * locks. This generally does not imply that the data will be
|
---|
25 | * lost, merely that it will be released. If this is not
|
---|
26 | * meaningful for a particular Closeable object, then it should be
|
---|
27 | * a no-op.
|
---|
28 | *
|
---|
29 | * @exception java.io.IOException passed up from the underlying
|
---|
30 | * database.
|
---|
31 | **/
|
---|
32 | public void close() throws IOException;
|
---|
33 |
|
---|
34 | /** Write outstanding changes to the underlying database, but
|
---|
35 | * leave the database open. If this is not meaningful for a
|
---|
36 | * particular Closeable object, then it should be a no-op.
|
---|
37 | *
|
---|
38 | * @exception java.io.IOException passed up from the underlying
|
---|
39 | * database.
|
---|
40 | **/
|
---|
41 | public void sync() throws IOException;
|
---|
42 | }
|
---|