javax.realtime
Class PhysicalMemoryManager

java.lang.Object
  extended byjavax.realtime.PhysicalMemoryManager

public final class PhysicalMemoryManager
extends Object

This class provides a collection of methods to query, set up filters for, and set up insertion/removal handlers for physical memory ranges.

Since:
0.3.8
Author:
Morgan Deters

Field Summary
static Object ALIGNED
          Specifies aligned memory.
static Object BYTESWAP
          Specifies that byte swapping should be used.
static Object DMA
          Specifies DMA memory.
static Object IO_PAGE
          Specifies I/O space.
static Object SHARED
          Specifies shared memory.
 
Method Summary
static boolean isRemovable(long address, long size)
          Returns true if any part of the specified range of memory is removable.
static boolean isRemoved(long address, long size)
          Returns true if any part of the specified range of memory is currently removed.
static void onInsertion(long base, long size, AsyncEvent ae)
          Associate a handler with insertion of memory in the given range.
static void onInsertion(long base, long size, AsyncEventHandler aeh)
          Deprecated. use onInsertion(long, long, AsyncEvent)
static void onRemoval(long base, long size, AsyncEvent ae)
          Associate a handler with removal of memory in the given range.
static void onRemoval(long base, long size, AsyncEventHandler aeh)
          Deprecated. use onRemoval(long, long, javax.realtime.AsyncEvent)
static void registerFilter(Object name, PhysicalMemoryTypeFilter filter)
          Register a memory type filter with the manager.
static void removeFilter(Object name)
          Dissociate the filter for the given memory type from the manager.
static boolean unregisterInsertionEvent(long base, long size, AsyncEvent ae)
          Unregister an insertion event.
static boolean unregisterRemovalEvent(long base, long size, AsyncEvent ae)
          Unregister a removal event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIGNED

public static final Object ALIGNED
Specifies aligned memory.


BYTESWAP

public static final Object BYTESWAP
Specifies that byte swapping should be used.


DMA

public static final Object DMA
Specifies DMA memory.


IO_PAGE

public static final Object IO_PAGE
Specifies I/O space.


SHARED

public static final Object SHARED
Specifies shared memory.

Method Detail

registerFilter

public static final void registerFilter(Object name,
                                        PhysicalMemoryTypeFilter filter)
                                 throws DuplicateFilterException
Register a memory type filter with the manager. Both arguments must be in immortal memory.

Parameters:
name - the type of memory handled by this filter
filter - the filter
Throws:
DuplicateFilterException - if a filter for this type of memory is already registered
ResourceLimitError - too many filters have been registered
IllegalArgumentException - if the name parameter is an array of objects, or if the name or the filter is not in immortal memory, or if the name or the filter is null
SecurityException - if this operation is not permitted

removeFilter

public static final void removeFilter(Object name)
Dissociate the filter for the given memory type from the manager.

Parameters:
name - the name associated with this filter
Throws:
IllegalArgumentException - if name is null
SecurityException - if this operation is not permitted

isRemovable

public static boolean isRemovable(long address,
                                  long size)
Returns true if any part of the specified range of memory is removable.

Parameters:
address - the base physical address of the queried range
size - the extent of the queried range
Returns:
true if any part of the range can be removed; false otherwise

isRemoved

public static boolean isRemoved(long address,
                                long size)
Returns true if any part of the specified range of memory is currently removed.

Parameters:
address - the base physical address of the queried range
size - the extent of the queried range
Returns:
true if any part of the rnage is currently removed (or otherwise unavailable)

onInsertion

public static void onInsertion(long base,
                               long size,
                               AsyncEvent ae)
Associate a handler with insertion of memory in the given range. If the size or base is negative, dissociate the given handler from all onInsertion events.

Parameters:
base - the base physical address of the range
size - the extent of the range
ae - the event to fire on insertion
Throws:
IllegalArgumentException - if the range contains no removable memory

onRemoval

public static void onRemoval(long base,
                             long size,
                             AsyncEvent ae)
Associate a handler with removal of memory in the given range. If the size or base is negative, dissociate the given handler from all onRemoval events.

Parameters:
base - the base physical address of the range
size - the extent of the range
ae - the event to fire on removal
Throws:
IllegalArgumentException - if the range contains no removable memory

unregisterInsertionEvent

public static boolean unregisterInsertionEvent(long base,
                                               long size,
                                               AsyncEvent ae)
Unregister an insertion event.

Parameters:
base - the base physical address associated with ae
size - the size of the memory area associated with ae
ae - the event to dissocate with onInsertion condition; if null, unregister all events matching the range

unregisterRemovalEvent

public static boolean unregisterRemovalEvent(long base,
                                             long size,
                                             AsyncEvent ae)
Unregister a removal event.

Parameters:
base - the base physical address associated with ae
size - the size of the memory area associated with ae
ae - the event to dissocate with onRemoval condition; if null, unregister all events matching the range

onRemoval

public static void onRemoval(long base,
                             long size,
                             AsyncEventHandler aeh)
Deprecated. use onRemoval(long, long, javax.realtime.AsyncEvent)

Associate a handler with removal of memory in the given range. If the size or base is negative, dissociate the given handler from all onRemoval events.

Parameters:
base - the base physical address of the range
size - the extent of the range
aeh - the handler to associate/dissociate
Throws:
IllegalArgumentException - if the range contains no removable memory

onInsertion

public static void onInsertion(long base,
                               long size,
                               AsyncEventHandler aeh)
Deprecated. use onInsertion(long, long, AsyncEvent)

Associate a handler with insertion of memory in the given range. If the size or base is negative, dissociate the given handler from all onInsertion events.

Parameters:
base - the base physical address of the range
size - the extent of the range
aeh - the handler to associate/dissociate
Throws:
IllegalArgumentException - if the range contains no removable memory


jRate is developed and maintained by the jRate project development team.
Copyright (c) 2001-2006 Angelo Corsaro and Morgan Deters.