Class FilePoolManager
java.lang.Object
net.simplace.sim.io.FilePoolManager
Static registry of the opened files per session, so that a file used by several adapters is opened only once and
its data can be shared (see
getFile(FileData)).- Author:
- Andreas Enders
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidadd(FWSimSession aSession, FileData aFileData) Registers a file for a session.static voidfinalize(FWSimSession aSession) Removes all files of a session from the registry.static FileDataLooks for an already registered file equal to the given one (same file and session).static voidRemoves a file from the registry of its session.
-
Constructor Details
-
FilePoolManager
public FilePoolManager()
-
-
Method Details
-
getFile
Looks for an already registered file equal to the given one (same file and session).Note: the search only runs if
keysSize()is greater than 1, which (because of a bug inMultiHashMap.keysSize()) counts the registered files, not the sessions; with a single registered file nothing is found.- Parameters:
aFileData- the file to look for- Returns:
- the registered file, or
nullif none was found
-
remove
Removes a file from the registry of its session.- Parameters:
aFileData- the file
-
add
Registers a file for a session.- Parameters:
aSession- the sessionaFileData- the file
-
finalize
Removes all files of a session from the registry. The files are not closed here; they are closed by the file pools of their interfaces when the adapters are finalized.- Parameters:
aSession- the session
-