Hyades Datapool Specification

org.eclipse.hyades.edit.datapool
Interface IDatapoolFactory


public interface IDatapoolFactory

A datapool factory manages the construction and sharing of IDatapool objects. This interface supports sharing of editable datapools.


Method Summary
 IDatapool load(java.io.File dpFile, boolean sharedInstance)
          Load the datapool from the specified file.
 void save(IDatapool datapool)
          Persists the specified instance of a datapool.
 void saveAs(IDatapool datapool, java.io.File dpFile)
          Persists the specified instance of a datapool to the specified file.
 void unload(IDatapool datapool)
          Removes a reference to an instance of a datapool.
 

Method Detail

load

public IDatapool load(java.io.File dpFile,
                      boolean sharedInstance)
Load the datapool from the specified file. If a sharedInstance is requested then the cache of other datapools that have been opened is checked for an existing copy of the datapool. Note that modifying a shared instance of the datapool may effect other uses of the datapool and should only be done in a confined execution environment.

Parameters:
dpFile - The datapool file name.
sharedInstance - Available for sharing instances of the datapool, which can save significantly on datapool loading overhead.
See Also:
unload(IDatapool)

unload

public void unload(IDatapool datapool)
Removes a reference to an instance of a datapool. If the datapool is shared the reference count is reduced. Once all references to a datapool have been unloaded the datapool instance will be made available to garbage collection.

Parameters:
datapool - The datapool instance being unloaded.
See Also:
load(java.io.File,boolean)

save

public void save(IDatapool datapool)
Persists the specified instance of a datapool. The file used is the same as the file from which the datapool was loaded. If the datapool was constructed from scratch the saveAs method should be used to save the file.

Parameters:
datapool - The datapool instance being saved.
See Also:
load(java.io.File,boolean), unload(IDatapool), saveAs(IDatapool,java.io.File)

saveAs

public void saveAs(IDatapool datapool,
                   java.io.File dpFile)
Persists the specified instance of a datapool to the specified file.

Parameters:
datapool - The datapool instance being saved.
dpFile - The file to which the datapool is to be saved.
See Also:
load(java.io.File,boolean), unload(IDatapool), save(IDatapool)


Hyades DPL