public class MapResoucesManager extends Object implements Disposable
This class manages the temporal folder for PortableView openings
The main function of this class are:
Modifier and Type | Field and Description |
---|---|
static int |
MAX_RESOUCES |
Constructor and Description |
---|
MapResoucesManager(PortableViewLoader mapLoader) |
Modifier and Type | Method and Description |
---|---|
void |
addResource(DefaultPortableView map)
Adds a resource to the pool
|
void |
adjustResourceSize()
Removed the oldest resources if pools contains more than
MAX_RESOUCES |
void |
cleanAllResources()
Clean all open resources
|
void |
cleanDeadMapReferences()
Cleans all dead weak references to Portable view opened form all
resources
|
void |
closeMap(DefaultPortableView map)
Remove portable view instance form opened map register of resource.
|
void |
dispose() |
PortableViewInformation |
getInfoOfFile(File mapFile)
Gets
PortableViewInformation from a PortableView file |
boolean |
isOpen(DefaultPortableView map)
Informs if a Portable view instance has been open
|
MapContext |
openMap(DefaultPortableView map)
Opens a map
Deploy context of a
PortableView file so it can be accessible if
it isn't done yet
|
public static final int MAX_RESOUCES
public MapResoucesManager(PortableViewLoader mapLoader)
public void cleanAllResources()
Clean all open resources
public PortableViewInformation getInfoOfFile(File mapFile)
PortableViewInformation
from a PortableView
filemapFile
- public void addResource(DefaultPortableView map)
map
- public void adjustResourceSize()
MAX_RESOUCES
public MapContext openMap(DefaultPortableView map) throws InvalidPortableViewFormatException, CantLoadContextException, IOException
Opens a map
Deploy context of a PortableView
file so it can be accessible if
it isn't done yet
map
- InvalidPortableViewFormatException
CantLoadContextException
IOException
public void closeMap(DefaultPortableView map)
map
- public void cleanDeadMapReferences()
public boolean isOpen(DefaultPortableView map)
map
- public void dispose()
dispose
in interface Disposable