java.lang.Objectjavax.realtime.MemoryArea
javax.realtime.ImmortalPhysicalMemory
public class ImmortalPhysicalMemory
An instance of ImmortalPhysicalMemory
allows objects to be allocated
from a range of physical memory with particular attributes, determined by
their memory type. This memory area has the same restrictive set
of assignment rules as ImmortalMemory
memory areas, and may be used in any
execution context where ImmortalMemory
is appropriate.
No provision is made for sharing object in ImmortalPhysicalMemory
with
entities outside the JVM that creates them, and, while the memory backing an instance of
ImmortalPhysicalMemory
could be shared by multiple JVMs, the class does not
support such sharing.
Methods from ImmortalPhysicalMemory
should be overridden only by methods that
use super
.
Constructor Summary | |
---|---|
ImmortalPhysicalMemory(java.lang.Object type,
long size)
Create an instance with the given parameters. |
|
ImmortalPhysicalMemory(java.lang.Object type,
long base,
long size)
Create an instance with the given parameters. |
|
ImmortalPhysicalMemory(java.lang.Object type,
long base,
long size,
java.lang.Runnable logic)
Create an instance with the given parameters. |
|
ImmortalPhysicalMemory(java.lang.Object type,
long size,
java.lang.Runnable logic)
Create an instance with the given parameters. |
|
ImmortalPhysicalMemory(java.lang.Object type,
long base,
SizeEstimator size)
Create an instance with the given parameters. |
|
ImmortalPhysicalMemory(java.lang.Object type,
long base,
SizeEstimator size,
java.lang.Runnable logic)
Create an instance with the given parameters. |
|
ImmortalPhysicalMemory(java.lang.Object type,
SizeEstimator size)
Create an instance with the given parameters. |
|
ImmortalPhysicalMemory(java.lang.Object type,
SizeEstimator size,
java.lang.Runnable logic)
Create an instance with the given parameters. |
Method Summary |
---|
Methods inherited from class javax.realtime.MemoryArea |
---|
enter, enter, executeInArea, getMemoryArea, memoryConsumed, memoryRemaining, newArray, newInstance, newInstance, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImmortalPhysicalMemory(java.lang.Object type, long size)
type
- An instance of Object
representing the type of
memory required (e.g., dma, shared) - used to define the base address
and control the mapping. If the required memory has more than one
attribute type
may be an array of objects. If type
is null or a reference to an array with no entries, any type of memory
is acceptable. Note that type
values are compared by
reference (==), not by value (equals
).size
- The size of the area in bytes.
java.lang.SecurityException
- Thrown if the application doesn't have
permissions to access physical memory or the given type of memory.
UnsupportedPhysicalMemoryException
- Thrown if the underlying
hardware does not support the given type, or if no matching
PhysicalMemoryTypeFilter
has been registered with
the PhysicalMemoryManager
.
MemoryTypeConflictException
- Thrown if type
specifies
incompatible memory attributes.
java.lang.IllegalArgumentException
- Thrown if size
is less than zero.
java.lang.OutOfMemoryError
- Thrown if there is insufficient memory for the
ImmortalPhysicalMemory
object or for the backing memory.
SizeOutOfBoundsException
- Thrown if the size
extends into an invalid range of memory.public ImmortalPhysicalMemory(java.lang.Object type, long base, long size)
type
- An instance of Object
or an array of
objects representing the type of
memory required (e.g., dma, shared) - used to define the base address
and control the mapping. If the required memory has more than one
attribute type
may be an array of objects. If type
is null or a reference to an array with no entries, any type of memory
is acceptable. Note that type
values are compared by
reference (==), not by value (equals
).base
- The physical memory address of the area.size
- The size of the area in bytes.
java.lang.SecurityException
- Thrown if the application doesn't have
permissions to access physical memory or the given range of memory.
OffsetOutOfBoundsException
- Thrown if the base
address is invalid.
SizeOutOfBoundsException
- Thrown if the size
extends into an invalid range of memory.
UnsupportedPhysicalMemoryException
- Thrown if the underlying
hardware does not support the given type, or if no matching
PhysicalMemoryTypeFilter
has been registered with
the PhysicalMemoryManager
.
MemoryTypeConflictException
- Thrown if the specified base does not point to
memory that matches the requested type, or if type
specifies
incompatible memory attributes.
java.lang.IllegalArgumentException
- Thrown if size
is less than zero.
IllegalArgumentException
may also be thrown if base
plus size
would be greater than the maximum physical address supported
by the processor.
MemoryInUseException
- Thrown if the specified memory is already in use.
java.lang.OutOfMemoryError
- Thrown if there is insufficient memory for the
ImmortalPhysicalMemory
object or for the backing memory.public ImmortalPhysicalMemory(java.lang.Object type, SizeEstimator size)
type
- An instance of Object
or an array of
objects representing the type of
memory required (e.g., dma, shared) - used to define the base address
and control the mapping. If the required memory has more than one
attribute type
may be an array of objects. If type
is null or a reference to an array with no entries, any type of memory
is acceptable. Note that type
values are compared by
reference (==), not by value (equals
).size
- A size estimator for this area.
java.lang.SecurityException
- Thrown if the application doesn't have
permissions to access physical memory or the given type of memory.
SizeOutOfBoundsException
- Thrown if the size estimate
from size
extends into an invalid range of memory.
UnsupportedPhysicalMemoryException
- Thrown if the underlying
hardware does not support the given type, or if no matching
PhysicalMemoryTypeFilter
has been registered with
the PhysicalMemoryManager
.
MemoryTypeConflictException
- Thrown if type
specifies
incompatible memory attributes.
java.lang.IllegalArgumentException
- Thrown if size
is null,
or size.getEstimate()
is negative.
java.lang.OutOfMemoryError
- Thrown if there is insufficient memory for the
ImmortalPhysicalMemory
object or for the backing memory.public ImmortalPhysicalMemory(java.lang.Object type, long base, SizeEstimator size)
type
- An instance of Object
or an array of
objects representing the type of
memory required (e.g., dma, shared) - used to define the base address
and control the mapping. If the required memory has more than one
attribute type
may be an array of objects. If type
is null or a reference to an array with no entries, any type of memory
is acceptable. Note that type
values are compared by
reference (==), not by value (equals
).base
- The physical memory address of the area.size
- A size estimator for this memory area.
java.lang.SecurityException
- Thrown if the application doesn't have
permissions to access physical memory or the given type of memory.
OffsetOutOfBoundsException
- Thrown if the base
address is invalid.
SizeOutOfBoundsException
- Thrown if the
size estimate from size
extends into an invalid range of memory.
UnsupportedPhysicalMemoryException
- Thrown if the underlying
hardware does not support the given type, or if no matching
PhysicalMemoryTypeFilter
has been registered with
the PhysicalMemoryManager
.
MemoryTypeConflictException
- Thrown if the specified base does not point to
memory that matches the requested type, or if type
specifies
incompatible memory attributes.
java.lang.IllegalArgumentException
- Thrown if size
is null,
or size.getEstimate()
is negative.
IllegalArgumentException
may also be thrown if base
plus the size indicated by size
would be greater than
the maximum physical address supported
by the processor.
MemoryInUseException
- Thrown if the specified memory is already in use.
java.lang.OutOfMemoryError
- Thrown if there is insufficient memory for the
ImmortalPhysicalMemory
object or for the backing memory.public ImmortalPhysicalMemory(java.lang.Object type, long size, java.lang.Runnable logic)
type
- An instance of Object
or an array of
objects representing the type of
memory required (e.g., dma, shared) - used to define the base address
and control the mapping. If the required memory has more than one
attribute type
may be an array of objects. If type
is null or a reference to an array with no entries, any type of memory
is acceptable. Note that type
values are compared by
reference (==), not by value (equals
).size
- The size of the area in bytes.logic
- The run()
method of this object will be
called whenever MemoryArea.enter()
is called. If logic
is null,
logic
must be supplied when the memory area is entered.
java.lang.SecurityException
- Thrown if the application doesn't have
permissions to access physical memory or the given type of memory.
SizeOutOfBoundsException
- Thrown if size
extends into an invalid range of memory.
UnsupportedPhysicalMemoryException
- Thrown if the underlying
hardware does not support the given type, or if no matching
PhysicalMemoryTypeFilter
has been registered with
the PhysicalMemoryManager
.
java.lang.IllegalArgumentException
- Thrown if size
is negative.
MemoryTypeConflictException
- Thrown if the specified base does not point to
memory that matches the requested type, or if type
specifies
incompatible memory attributes.
java.lang.OutOfMemoryError
- Thrown if there is insufficient memory for the
ImmortalPhysicalMemory
object or for the backing memory.
IllegalAssignmentError
- Thrown if storing logic
in this
would
violate the assignment rules.public ImmortalPhysicalMemory(java.lang.Object type, long base, long size, java.lang.Runnable logic)
type
- An instance of Object
or an array of
objects representing the type of
memory required (e.g., dma, shared) - used to define the base address
and control the mapping. If the required memory has more than one
attribute type
may be an array of objects. If type
is null or a reference to an array with no entries, any type of memory
is acceptable. Note that type
values are compared by
reference (==), not by value (equals
).base
- The physical memory address of the area.size
- The size of the area in bytes.logic
- The run()
method of this object will be
called whenever MemoryArea.enter()
is called. If logic
is null,
logic
must be supplied when the memory area is entered.
java.lang.SecurityException
- Thrown if the application doesn't have
permissions to access physical memory or the given type of memory.
OffsetOutOfBoundsException
- Thrown if the base
address is invalid.
SizeOutOfBoundsException
- Thrown if size
extends into an invalid range of memory.
UnsupportedPhysicalMemoryException
- Thrown if the underlying
hardware does not support the given type, or if no matching
PhysicalMemoryTypeFilter
has been registered with
the PhysicalMemoryManager
.
MemoryTypeConflictException
- Thrown if the specified base does not point to
memory that matches the requested type, or if type
specifies
incompatible memory attributes.
java.lang.IllegalArgumentException
- Thrown if size
is negative.
IllegalArgumentException
may also be thrown if base
plus size
would be greater than the maximum physical address supported
by the processor.
MemoryInUseException
- Thrown if the specified memory is already in use.
java.lang.OutOfMemoryError
- Thrown if there is insufficient memory for the
ImmortalPhysicalMemory
object or for the backing memory.
IllegalAssignmentError
- Thrown if storing logic
in this
would
violate the assignment rules.public ImmortalPhysicalMemory(java.lang.Object type, SizeEstimator size, java.lang.Runnable logic)
type
- An instance of Object
or an array of
objects representing the type of
memory required (e.g., dma, shared) - used to define the base address
and control the mapping. If the required memory has more than one
attribute type
may be an array of objects. If type
is null or a reference to an array with no entries, any type of memory
is acceptable. Note that type
values are compared by
reference (==), not by value (equals
).size
- A size estimator for this area.logic
- The run()
method of this object will be
called whenever MemoryArea.enter()
is called. If logic
is null,
logic
must be supplied when the memory area is entered.
java.lang.SecurityException
- Thrown if the application doesn't have
permissions to access physical memory or the given type of memory.
SizeOutOfBoundsException
- Thrown if the size
extends into an invalid range of memory.
UnsupportedPhysicalMemoryException
- Thrown if the underlying
hardware does not support the given type, or if no matching
PhysicalMemoryTypeFilter
has been registered with
the PhysicalMemoryManager
.
java.lang.IllegalArgumentException
- Thrown if size
is null,
or size.getEstimate()
is negative.
MemoryTypeConflictException
- Thrown if type
specifies
incompatible memory attributes.
java.lang.OutOfMemoryError
- Thrown if there is insufficient memory for the
ImmortalPhysicalMemory
object or for the backing memory.
IllegalAssignmentError
- Thrown if storing logic
in this
would
violate the assignment rules.public ImmortalPhysicalMemory(java.lang.Object type, long base, SizeEstimator size, java.lang.Runnable logic)
type
- An instance of Object
or an array of
objects representing the type of
memory required (e.g., dma, shared) - used to define the base address
and control the mapping. If the required memory has more than one
attribute type
may be an array of objects. If type
is null or a reference to an array with no entries, any type of memory
is acceptable. Note that type
values are compared by
reference (==), not by value (equals
).base
- The physical memory address of the area.size
- A size estimator for this memory area.logic
- The run()
method of this object will be
called whenever MemoryArea.enter()
is called. If logic
is null,
logic
must be supplied when the memory area is entered.
java.lang.SecurityException
- Thrown if the application doesn't have
permissions to access physical memory or the given type of memory.
OffsetOutOfBoundsException
- Thrown if the base
address is invalid.
SizeOutOfBoundsException
- Thrown if the size
estimate from size
extends into an invalid range of memory.
UnsupportedPhysicalMemoryException
- Thrown if the underlying
hardware does not support the given type, or if no matching
PhysicalMemoryTypeFilter
has been registered with
the PhysicalMemoryManager
.
MemoryTypeConflictException
- Thrown if the specified base does not point to
memory that matches the requested type, or if type
specifies
incompatible memory attributes.
java.lang.IllegalArgumentException
- Thrown if size
is null,
or size.getEstimate()
is negative.
IllegalArgumentException
may also be thrown if base
plus the size indicated by size
would be
greater than the maximum physical address supported
by the processor.
MemoryInUseException
- Thrown if the specified memory is already in use.
java.lang.OutOfMemoryError
- Thrown if there is insufficient memory for the
ImmortalPhysicalMemory
object or for the backing memory.
IllegalAssignmentError
- Thrown if storing logic
in this
would
violate the assignment rules.