com.sun.squawk.peripheral
Class SimulatedNorFlashSectorAllocator
java.lang.Object
com.sun.squawk.peripheral.SimulatedNorFlashSectorAllocator
- All Implemented Interfaces:
- INorFlashSectorAllocator, IPeripheral
public class SimulatedNorFlashSectorAllocator
- extends Object
- implements INorFlashSectorAllocator
sectors
protected Vector sectors
SimulatedNorFlashSectorAllocator
public SimulatedNorFlashSectorAllocator()
getExtraSector
public INorFlashSector getExtraSector(int purpose)
throws InsufficientFlashMemoryException
- Specified by:
getExtraSector
in interface INorFlashSectorAllocator
- Parameters:
purpose
- code (defined in INorFlashSector
) indicating purpose of sector
- Returns:
- a free sector
- Throws:
InsufficientFlashMemoryException
getInitialSectors
public INorFlashSector[] getInitialSectors(int purpose)
- Specified by:
getInitialSectors
in interface INorFlashSectorAllocator
- Parameters:
purpose
- code (defined in INorFlashSector
) indicating purpose of sectors
- Returns:
- the sectors that were in use for this purpose at the time of the last VM exit
getSingleton
public static SimulatedNorFlashSectorAllocator getSingleton()
installSectors
public void installSectors(int numberOfSectors,
int sectorSize,
int purpose)
- Check to see if there are sectors already installed for the purpose
specified, or If there are sectors found on file system use them as is,
if not then setup with number of sectors and sectorSize as specified
releaseSector
public void releaseSector(INorFlashSector sector,
int purpose)
- Description copied from interface:
INorFlashSectorAllocator
- Notify the allocator that a previously allocated sector is no longer required
- Specified by:
releaseSector
in interface INorFlashSectorAllocator
- Parameters:
sector
- the sector to freepurpose
- code (defined in INorFlashSector
) indicating purpose of sector
resetSingleton
public static void resetSingleton()
setupSectors
public void setupSectors(int numberOfSectors,
int sectorSize,
int purpose,
boolean useFiles)
uninstallSectors
public void uninstallSectors()
- Make it such that I have no sectors allocated.
Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.