|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.realtime.MemoryArea javax.realtime.ScopedMemory javax.realtime.LTPhysicalMemory
public class LTPhysicalMemory
An instance of LTPhysicalMemory
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 semantics
as ScopedMemory
memory areas, and the same performance
restrictions as LTMemory
.
Methods from LTPhysicalMemory
should be overridden only by methods that
use super
.
MemoryArea
,
ScopedMemory
,
VTMemory
,
LTMemory
,
VTPhysicalMemory
,
ImmortalPhysicalMemory
,
RealtimeThread
,
NoHeapRealtimeThread
Constructor Summary | |
---|---|
LTPhysicalMemory(java.lang.Object type,
long size)
Create an instance of LTPhysicalMemory with the given parameters. |
|
LTPhysicalMemory(java.lang.Object type,
long base,
long size)
Create an instance of LTPhysicalMemory with the given parameters. |
|
LTPhysicalMemory(java.lang.Object type,
long base,
long size,
java.lang.Runnable logic)
Create an instance of LTPhysicalMemory with the given parameters. |
|
LTPhysicalMemory(java.lang.Object type,
long size,
java.lang.Runnable logic)
Create an instance of LTPhysicalMemory with the given parameters. |
|
LTPhysicalMemory(java.lang.Object type,
long base,
SizeEstimator size)
Create an instance of LTPhysicalMemory with the given parameters. |
|
LTPhysicalMemory(java.lang.Object type,
long base,
SizeEstimator size,
java.lang.Runnable logic)
Create an instance of LTPhysicalMemory with the given parameters. |
|
LTPhysicalMemory(java.lang.Object type,
SizeEstimator size)
Create an instance of LTPhysicalMemory with the given parameters. |
|
LTPhysicalMemory(java.lang.Object type,
SizeEstimator size,
java.lang.Runnable logic)
Create an instance of LTPhysicalMemory with the given parameters. |
Method Summary | |
---|---|
void |
enter()
Associate this memory area with the current schedulable object for the duration of the execution of the run() method of the
instance of Runnable given in the constructor. |
void |
enter(java.lang.Runnable logic)
Associate this memory area with the current schedulable object for the duration of the execution of the run()
method of the given Runnable. |
void |
joinAndEnter()
In the error-free case, joinAndEnter combines
join();enter(); such that no enter() from
another schedulable object can intervene between the two method invocations. |
void |
joinAndEnter(HighResolutionTime time)
In the error-free case, joinAndEnter combines
join();enter(); such that no enter() from
another schedulable object can intervene between the two method invocations. |
void |
joinAndEnter(java.lang.Runnable logic)
In the error-free case, joinAndEnter combines
join();enter(); such that no enter() from
another schedulable object can intervene between the two method invocations. |
void |
joinAndEnter(java.lang.Runnable logic,
HighResolutionTime time)
In the error-free case, joinAndEnter combines
join();enter(); such that no enter() from
another schedulable object can intervene between the two method invocations. |
long |
size()
Query the size of the memory area. |
java.lang.String |
toString()
Creates a string describing this object. |
Methods inherited from class javax.realtime.ScopedMemory |
---|
executeInArea, getMaximumSize, getPortal, getReferenceCount, join, join, newArray, newInstance, newInstance, setPortal |
Methods inherited from class javax.realtime.MemoryArea |
---|
getMemoryArea, memoryConsumed, memoryRemaining |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LTPhysicalMemory(java.lang.Object type, long size)
LTPhysicalMemory
with the given parameters.
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.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.
java.lang.IllegalArgumentException
- Thrown if size
is less than zero.
SizeOutOfBoundsException
- Thrown if
the implementation detects size
extends
beyond physically addressable 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.PhysicalMemoryManager
public LTPhysicalMemory(java.lang.Object type, long base, long size)
LTPhysicalMemory
with the given parameters.
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.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 type of memory.
SizeOutOfBoundsException
- Thrown if the size is less than zero, or the
implementation detects that base
plus
size
extends beyond physically addressable memory.
OffsetOutOfBoundsException
- Thrown if the address is invalid.
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.
MemoryInUseException
- Thrown if the specified memory is already in use.PhysicalMemoryManager
public LTPhysicalMemory(java.lang.Object type, SizeEstimator size)
LTPhysicalMemory
with the given parameters.
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.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 implementation
detects that
size
extends beyond physically addressable 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.PhysicalMemoryManager
public LTPhysicalMemory(java.lang.Object type, long base, SizeEstimator size)
LTPhysicalMemory
with the given parameters.
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.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.
SizeOutOfBoundsException
- Thrown if the
implementation detects that base
plus
the size estimate extends beyond physically addressable memory.
OffsetOutOfBoundsException
- Thrown if the address is invalid.
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.
MemoryInUseException
- Thrown if the specified memory is already in use.
java.lang.IllegalArgumentException
- Thrown if size
is null.PhysicalMemoryManager
public LTPhysicalMemory(java.lang.Object type, long size, java.lang.Runnable logic)
LTPhysicalMemory
with the given parameters.
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.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.
java.lang.IllegalArgumentException
- Thrown if size
is less than zero.
SizeOutOfBoundsException
- Thrown if the
implementation detects that size
extends beyond physically addressable 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.
IllegalAssignmentError
- Thrown if storing logic in
this would violate the assignment rules.PhysicalMemoryManager
public LTPhysicalMemory(java.lang.Object type, long base, long size, java.lang.Runnable logic)
LTPhysicalMemory
with the given parameters.
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.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.
SizeOutOfBoundsException
- Thrown if the implementation detects that
base
plus size
extends
beyond physically addressable memory.
java.lang.SecurityException
- Thrown if the application doesn't have
permissions to access physical memory or the given type of memory.
java.lang.IllegalArgumentException
- Thrown if size
is less than zero.
OffsetOutOfBoundsException
- Thrown if the address is invalid.
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.
MemoryInUseException
- Thrown if the specified memory is already in use.
IllegalAssignmentError
- Thrown if storing logic in this
would violate the assignment rules.PhysicalMemoryManager
public LTPhysicalMemory(java.lang.Object type, SizeEstimator size, java.lang.Runnable logic)
LTPhysicalMemory
with the given parameters.
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.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
implementation detects that base
plus
the size estimate extends beyond physically addressable 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 request type, or if type
specifies
attributes with a conflict.
java.lang.IllegalArgumentException
- Thrown if size
is null.
IllegalAssignmentError
- Thrown if storing logic in this
would violate the assignment rules.PhysicalMemoryManager
public LTPhysicalMemory(java.lang.Object type, long base, SizeEstimator size, java.lang.Runnable logic)
LTPhysicalMemory
with the given parameters.
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.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.
SizeOutOfBoundsException
- Thrown if the
implementation detects that base
plus
the size estimate extends beyond physically addressable memory.
OffsetOutOfBoundsException
- Thrown if the address is invalid.
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.
MemoryInUseException
- Thrown if the specified memory is already in use.
java.lang.IllegalArgumentException
- Thrown if size
is null.
IllegalAssignmentError
- Thrown if storing logic in this
would violate the assignment rules.PhysicalMemoryManager
Method Detail |
---|
public void enter()
run()
method of the
instance of Runnable given in the constructor. During this
period of execution, this memory area becomes the default
allocation context until another default allocation context is
selected (using enter
, or executeInArea
(java.lang.Runnable))
or the enter method exits.
enter
in class ScopedMemory
ScopedCycleException
- Thrown if this invocation would break the single
parent rule.
ThrowBoundaryError
- Thrown when the JVM needs to propagate an exception allocated in this
scope
to (or through) the memory area of the caller. Storing a reference to that exception would cause
an IllegalAssignmentError
, so the JVM cannot be permitted to deliver the exception.
The ThrowBoundaryError
is allocated in the current
allocation context and contains information about the exception it replaces.
java.lang.IllegalThreadStateException
- Thrown when enter
is invoked from a Java thread.
java.lang.IllegalArgumentException
- Thrown no non-null value for logic
was supplied when the memory area was constructed.public void enter(java.lang.Runnable logic)
run()
method of the given Runnable. During this period of execution,
this memory area becomes the default allocation context until
another default allocation context is selected (using
enter
, or
executeInArea(java.lang.Runnable)
) or the
enter
method exits.
enter
in class ScopedMemory
logic
- The Runnable object whose run()
method
should be invoked.
ScopedCycleException
- Thrown if this invocation would break the single
parent rule.
ThrowBoundaryError
- Thrown when the JVM needs to propagate an exception allocated in this
scope
to (or through) the memory area of the caller. Storing a reference to that exception would cause
an IllegalAssignmentError
, so the JVM cannot be permitted to deliver the exception.
The ThrowBoundaryError
is allocated in the current
allocation context and contains information about the exception it replaces.
java.lang.IllegalThreadStateException
- Thrown when enter
is invoked from a Java thread.
java.lang.IllegalArgumentException
- Thrown if logic
is null.public void joinAndEnter() throws java.lang.InterruptedException
joinAndEnter
combines
join();enter();
such that no enter()
from
another schedulable object can intervene between the two method invocations.
The resulting method
will wait for the reference count on this ScopedMemory
to reach zero,
then enter the ScopedMemory
and execute the run
method from
logic
passed in the constructor. If no instance of Runnable
was passed to the memory area's constructor,
the method throws IllegalArgumentException
immediately.
joinAndEnter
in class ScopedMemory
java.lang.InterruptedException
- If this schedulable object is interrupted by
RealtimeThread.interrupt()
or
AsynchronouslyInterruptedException.fire()
while waiting for the reference count to go to zero.
ThrowBoundaryError
- Thrown when the JVM needs to propagate an exception allocated in this
scope
to (or through) the memory area of the caller. Storing a reference to that exception would cause
an IllegalAssignmentError
, so the JVM cannot be permitted to deliver the exception.
The ThrowBoundaryError
is allocated in the current
allocation context and contains information about the exception it replaces.
java.lang.IllegalArgumentException
- Thrown if no non-null logic
value
was supplied to the memory area's constructor.public void joinAndEnter(HighResolutionTime time) throws java.lang.InterruptedException
joinAndEnter
combines
join();enter();
such that no enter()
from
another schedulable object can intervene between the two method invocations. The resulting method
will wait for the reference count on this ScopedMemory
to reach zero, or
for the current time to reach the designated time,
then enter the ScopedMemory
and execute the run
method from
Runnable
object passed to the constructor. If no instance of Runnable
was passed to the memory area's constructor, the method
throws IllegalArgumentException
immediately.
Note that expiration of time
may cause control to enter the
memory area before its reference count has gone to zero.
joinAndEnter
in class ScopedMemory
time
- The time that bounds the wait.
ThrowBoundaryError
- Thrown when the JVM needs to propagate an exception allocated in this
scope
to (or through) the memory area of the caller. Storing a reference to that exception would cause
an IllegalAssignmentError
, so the JVM cannot be permitted to deliver the exception.
The ThrowBoundaryError
is allocated in the current
allocation context and contains information about the exception it replaces.
java.lang.InterruptedException
- If this schedulable object is interrupted by
RealtimeThread.interrupt()
or
AsynchronouslyInterruptedException.fire()
while waiting for the reference count to go to zero.
ScopedCycleException
- Thrown if this invocation would break the single
parent rule.
java.lang.IllegalArgumentException
- Thrown if time
is null, or if
no non-null logic
value
was supplied to the memory area's constructor.public void joinAndEnter(java.lang.Runnable logic) throws java.lang.InterruptedException
joinAndEnter
combines
join();enter();
such that no enter()
from
another schedulable object can intervene between the two method invocations. The resulting method
will wait for the reference count on this ScopedMemory
to reach zero,
then enter the ScopedMemory
and execute the run
method from
logic
If logic
is null, throw IllegalArgumentException
immediately.
joinAndEnter
in class ScopedMemory
logic
- The Runnable
object which contains the code to execute.
java.lang.InterruptedException
- If this schedulable object is interrupted by
RealtimeThread.interrupt()
or
AsynchronouslyInterruptedException.fire()
while waiting for the reference count to go to zero.
ThrowBoundaryError
- Thrown when the JVM needs to propagate an exception allocated in this
scope
to (or through) the memory area of the caller. Storing a reference to that exception would cause
an IllegalAssignmentError
, so the JVM cannot be permitted to deliver the exception.
The ThrowBoundaryError
is allocated in the current
allocation context and contains information about the exception it replaces.
java.lang.IllegalArgumentException
- Thrown if logic
is null.public void joinAndEnter(java.lang.Runnable logic, HighResolutionTime time) throws java.lang.InterruptedException
joinAndEnter
combines
join();enter();
such that no enter()
from
another schedulable object can intervene between the two method invocations. The resulting method
will wait for the reference count on this ScopedMemory
to reach zero, or
for the current time to reach the designated time,
then enter the ScopedMemory
and execute the run
method from
logic
.
Throws IllegalArgumentException
immediately if logic
is null.
Note that expiration of time
may cause control to enter the
memory area before its reference count has gone to zero.
joinAndEnter
in class ScopedMemory
logic
- The Runnable
object which contains the code to execute.time
- The time that bounds the wait.
java.lang.InterruptedException
- If this schedulable object is interrupted by
RealtimeThread.interrupt()
or
AsynchronouslyInterruptedException.fire()
while waiting for the reference count to go to zero.
ThrowBoundaryError
- Thrown when the JVM needs to propagate an exception allocated in this
scope
to (or through) the memory area of the caller. Storing a reference to that exception would cause
an IllegalAssignmentError
, so the JVM cannot be permitted to deliver the exception.
The ThrowBoundaryError
is allocated in the current
allocation context and contains information about the exception it replaces.
ScopedCycleException
- Thrown if this invocation would break the single
parent rule.
java.lang.IllegalArgumentException
- Thrown if time
or logic
is null.public java.lang.String toString()
(LTPhysicalMemory) Scoped memory # num
where num
is a number that uniquely
identifies this LTPhysicalMemory
memory area.
representing the value of this
.
toString
in class ScopedMemory
this
.public long size()
MemoryArea
size
in class MemoryArea
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |