SunSPOT API V3.0


com.sun.squawk.peripheral
Class SimulatedNorFlashSectorAllocator

java.lang.Object
  extended by com.sun.squawk.peripheral.SimulatedNorFlashSectorAllocator
All Implemented Interfaces:
INorFlashSectorAllocator, IPeripheral

public class SimulatedNorFlashSectorAllocator
extends Object
implements INorFlashSectorAllocator


Field Summary
protected  Vector sectors
           
 
Constructor Summary
SimulatedNorFlashSectorAllocator()
           
 
Method Summary
 INorFlashSector getExtraSector(int purpose)
           
 INorFlashSector[] getInitialSectors(int purpose)
           
static SimulatedNorFlashSectorAllocator getSingleton()
           
 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
 void releaseSector(INorFlashSector sector, int purpose)
          Notify the allocator that a previously allocated sector is no longer required
static void resetSingleton()
           
 void setupSectors(int numberOfSectors, int sectorSize, int purpose, boolean useFiles)
           
 void uninstallSectors()
          Make it such that I have no sectors allocated.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sectors

protected Vector sectors
Constructor Detail

SimulatedNorFlashSectorAllocator

public SimulatedNorFlashSectorAllocator()
Method Detail

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 free
purpose - 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.


SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.