com.funambol.storage
Class NonClosingObjectStore

java.lang.Object
  extended by com.funambol.storage.ObjectStore
      extended by com.funambol.storage.NonClosingObjectStore

public class NonClosingObjectStore
extends ObjectStore

This class extends the ObjectStore and changes its behavior in that stores are not closed when the close method is invoken. Open is also redefined so that a Store is opened only once.


Field Summary
 
Fields inherited from class com.funambol.storage.ObjectStore
mutex, name, rs
 
Constructor Summary
NonClosingObjectStore()
           
NonClosingObjectStore(java.lang.String name)
           
 
Method Summary
 void close()
          Close the current RecordStore, if open.
 boolean open()
          Open the current RecordStore, or throws an exception if not present.
 boolean open(java.lang.String name)
          Open an existing RecordStore, or throws an exception if not present.
protected  boolean openStore()
          private method used by open and create to share code.
protected  boolean openStore(java.lang.String name, boolean create)
          private method used by open and create to share code.
 void remove()
          Removes this object store.
 
Methods inherited from class com.funambol.storage.ObjectStore
addStoreListener, create, createEmptyRecord, getAvaliableStorage, getFirstIndex, getName, getNextIndex, getObjects, remove, removeObjectComparator, removeObjectFilter, removeStoreListener, retrieve, retrieveBytes, setObjectComparator, setObjectFilter, size, store, store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonClosingObjectStore

public NonClosingObjectStore()

NonClosingObjectStore

public NonClosingObjectStore(java.lang.String name)
Method Detail

open

public boolean open(java.lang.String name)
             throws javax.microedition.rms.RecordStoreException
Open an existing RecordStore, or throws an exception if not present. If the name is the same of the currently open one, no action is taken, otherwise the old one is closed.

Overrides:
open in class ObjectStore
Parameters:
name - is the name of the RecordStore to be managed
Returns:
true if the record store has been open or created false if it was cached
Throws:
javax.microedition.rms.RecordStoreException

open

public boolean open()
             throws javax.microedition.rms.RecordStoreException
Open the current RecordStore, or throws an exception if not present.

Overrides:
open in class ObjectStore
Returns:
true if the record store has been open or created false if it was cached
Throws:
javax.microedition.rms.RecordStoreException

openStore

protected boolean openStore(java.lang.String name,
                            boolean create)
                     throws javax.microedition.rms.RecordStoreException
private method used by open and create to share code.

Overrides:
openStore in class ObjectStore
Throws:
javax.microedition.rms.RecordStoreException

openStore

protected boolean openStore()
                     throws javax.microedition.rms.RecordStoreException
Description copied from class: ObjectStore
private method used by open and create to share code.

Overrides:
openStore in class ObjectStore
Throws:
javax.microedition.rms.RecordStoreException

close

public void close()
           throws javax.microedition.rms.RecordStoreException
Description copied from class: ObjectStore
Close the current RecordStore, if open.

Overrides:
close in class ObjectStore
Throws:
javax.microedition.rms.RecordStoreException

remove

public void remove()
            throws javax.microedition.rms.RecordStoreException
Removes this object store. The store is closed before trying to remove it.

Overrides:
remove in class ObjectStore
Throws:
javax.microedition.rms.RecordStoreException


Copyright © 2001-2009 Funambol.