com.sun.rtsjx
Interface PhysicalMemoryMapper

All Known Implementing Classes:
SharedMemoryMapper

public interface PhysicalMemoryMapper

Basic mapping operations.

Implementation providing methods other than map/unmap for physical memory should extend this class and set the mapper field of the PhysicalMemoryRequest when parsing the type object.

See Also:
PhysicalMemoryRequest

Method Summary
 boolean canRemap()
          Returns true if a remap() can be attempted.
 void checkMapperConstraints(PhysicalMemoryRequest request)
          Check the constraints due to the mapper itself.
 long get_mapped_address()
          Get the mapped address, or 0 if unmapped.
 boolean isCompatibleWithPhysicalMemory()
          Returns true if this mapper is compatible with ImmortalPhysicalMemory, LTPhysicalMemory and VTPhysicalMemory.
 long map(PhysicalMemoryRequest request)
          Map the request.
 void unmap(PhysicalMemoryRequest request)
          Undo a mapping.
 

Method Detail

map

long map(PhysicalMemoryRequest request)
         throws javax.realtime.OffsetOutOfBoundsException,
                javax.realtime.SizeOutOfBoundsException,
                javax.realtime.MemoryTypeConflictException,
                java.lang.OutOfMemoryError
Map the request.

Parameters:
request - constraints issued from the parsing of a memory type.
Throws:
javax.realtime.OffsetOutOfBoundsException - Thrown if the address is invalid.
javax.realtime.SizeOutOfBoundsException - Thrown if the size is negative or extends into an invalid range of memory.
javax.realtime.MemoryTypeConflictException - Thrown if the specified base does not point to memory that matches the request type, or if type specifies incompatible memory attributes.
java.lang.OutOfMemoryError - Thrown if the requested type of memory exists, but there is not enough of it free to satisfy the request.

unmap

void unmap(PhysicalMemoryRequest request)
Undo a mapping.

Parameters:
request - constraints issued from the parsing of a memory type.

get_mapped_address

long get_mapped_address()
Get the mapped address, or 0 if unmapped.

Returns:
the mapped address, or 0 if unmapped.

checkMapperConstraints

void checkMapperConstraints(PhysicalMemoryRequest request)
                            throws java.lang.SecurityException,
                                   javax.realtime.OffsetOutOfBoundsException,
                                   javax.realtime.SizeOutOfBoundsException,
                                   javax.realtime.MemoryTypeConflictException
Check the constraints due to the mapper itself.

The default implementation does nothing.

Parameters:
request - constraints issued from the parsing of a memory type.
Throws:
java.lang.SecurityException - Thrown if application doesn't have permissions to access physical memory, the specified range of addresses, or the given type of memory.
javax.realtime.OffsetOutOfBoundsException - Thrown if the address is invalid.
javax.realtime.SizeOutOfBoundsException - Thrown if the size is negative or extends into an invalid range of memory.
javax.realtime.MemoryTypeConflictException - Thrown if the specified base does not point to memory that matches the request type, or if type specifies incompatible memory attributes.

canRemap

boolean canRemap()
Returns true if a remap() can be attempted.

Returns:
true if a remap() can be attempted.

isCompatibleWithPhysicalMemory

boolean isCompatibleWithPhysicalMemory()
Returns true if this mapper is compatible with ImmortalPhysicalMemory, LTPhysicalMemory and VTPhysicalMemory. false otherwise