public final class ImmortalMemory extends PerennialMemory
ImmortalMemory is accessible by all schedulable objects (including NoHeapRealtimeThread and no-heap AbstractAsyncEventHandlers) and normal Java threads.
The memory of objects allocated in ImmortalMemory will never be reclaimed and finalize methods of objects allocated in ImmortalMemory will never be executed.
| Modifier and Type | Method and Description |
|---|---|
void |
enter()
Associates this memory area with the current schedulable for the duration
of the execution of the
run() method of the instance of
Runnable given in the constructor. |
boolean |
enter(java.util.function.BooleanSupplier logic)
Same as
MemoryArea.enter(Runnable) except that the executed method is
called getAsBoolean() and a boolean is returned. |
double |
enter(java.util.function.DoubleSupplier logic)
Same as
MemoryArea.enter(Runnable) except that the executed method is
called getAsDouble() and a double is returned. |
int |
enter(java.util.function.IntSupplier logic)
Same as
MemoryArea.enter(Runnable) except that the executed method is
called getAsInt() and an int is returned. |
long |
enter(java.util.function.LongSupplier logic)
Same as
MemoryArea.enter(Runnable) except that the executed method is
called getAsLong() and a long is returned. |
void |
enter(java.lang.Runnable logic)
Associates this memory area with the current schedulable for the duration
of the execution of the
run() method of the given Runnable. |
<T> T |
enter(java.util.function.Supplier<T> logic)
Same as
MemoryArea.enter(Runnable) except that the executed method is
called get() and an object is returned. |
boolean |
executeInArea(java.util.function.BooleanSupplier logic)
Executes the
getAsBoolean() method from the logic
parameter using this memory area as the current allocation
context. |
double |
executeInArea(java.util.function.DoubleSupplier logic)
Executes the
getAsDouble() method from the logic parameter
using this memory area as the current allocation context. |
int |
executeInArea(java.util.function.IntSupplier logic)
Executes the
getAsInt() method from the logic parameter
using this memory area as the current allocation context. |
long |
executeInArea(java.util.function.LongSupplier logic)
Executes the
getAsLong() method from the logic parameter
using this memory area as the current allocation context. |
void |
executeInArea(java.lang.Runnable logic)
Executes the
run() method from the logic parameter
using this memory area as the current allocation context. |
<T> T |
executeInArea(java.util.function.Supplier<T> logic)
Executes the
get() method from the logic parameter
using this memory area as the current allocation context. |
static ImmortalMemory |
instance()
instance returns the single instance of ImmortalMemory in the
system.
|
getMemoryArea, mayHoldReferenceTo, mayHoldReferenceTo, memoryConsumed, memoryRemaining, newArray, newArrayInArea, newInstance, newInstance, sizepublic static ImmortalMemory instance()
public void enter()
MemoryArearun() 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
MemoryArea.executeInArea(java.lang.Runnable)) or the enter method exits.enter in class MemoryAreapublic void enter(java.lang.Runnable logic)
MemoryArearun() 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 MemoryArea.executeInArea(java.lang.Runnable)) or the enter
method exits.enter in class MemoryArealogic - The Runnable object whose run() method should be
invoked.public boolean enter(java.util.function.BooleanSupplier logic)
MemoryAreaMemoryArea.enter(Runnable) except that the executed method is
called getAsBoolean() and a boolean is returned.enter in class MemoryArealogic - The object whose getAsboolean() method is to
be executed.getAsBoolean() method.public double enter(java.util.function.DoubleSupplier logic)
MemoryAreaMemoryArea.enter(Runnable) except that the executed method is
called getAsDouble() and a double is returned.enter in class MemoryArealogic - The object whose getAsDouble() method is to be
executed.getAsDouble() method.public int enter(java.util.function.IntSupplier logic)
MemoryAreaMemoryArea.enter(Runnable) except that the executed method is
called getAsInt() and an int is returned.enter in class MemoryArealogic - The object whose getAsInt() method is to be
executed.getAsInt() method.public long enter(java.util.function.LongSupplier logic)
MemoryAreaMemoryArea.enter(Runnable) except that the executed method is
called getAsLong() and a long is returned.enter in class MemoryArealogic - The object whose getAsLong() method is to be
executed.getAsLong() method.public <T> T enter(java.util.function.Supplier<T> logic)
MemoryAreaMemoryArea.enter(Runnable) except that the executed method is
called get() and an object is returned. The
The get() method must ensure that the returned object is
allocated outside the area, when the area is not a PerennialMemory.enter in class MemoryArealogic - The object whose get() method is to be
executed.get() method.public void executeInArea(java.lang.Runnable logic)
MemoryArearun() method from the logic parameter
using this memory area as the current allocation context. The
effect of executeInArea on the scope stack is specified in
the subclasses of MemoryArea.executeInArea in class MemoryArealogic - The logic whose run() method is to be executed.public boolean executeInArea(java.util.function.BooleanSupplier logic)
MemoryAreagetAsBoolean() method from the logic
parameter using this memory area as the current allocation
context. The effect of executeInArea on the scope stack is
specified in the subclasses of MemoryArea.executeInArea in class MemoryArealogic - The logic whose getAsBoolean() method is to be
executed.getAsBoolean() method.public double executeInArea(java.util.function.DoubleSupplier logic)
MemoryAreagetAsDouble() method from the logic parameter
using this memory area as the current allocation context. The
effect of executeInArea on the scope stack is specified in
the subclasses of MemoryArea.executeInArea in class MemoryArealogic - The logic whose getAsDouble() method is to be
executed.getAsDouble() method.public int executeInArea(java.util.function.IntSupplier logic)
MemoryAreagetAsInt() method from the logic parameter
using this memory area as the current allocation context. The
effect of executeInArea on the scope stack is specified in
the subclasses of MemoryArea.executeInArea in class MemoryArealogic - The logic whose getAsInt() method is to be executed.getAsInt() method.public long executeInArea(java.util.function.LongSupplier logic)
MemoryAreagetAsLong() method from the logic parameter
using this memory area as the current allocation context. The
effect of executeInArea on the scope stack is specified in
the subclasses of MemoryArea.executeInArea in class MemoryArealogic - The logic whose getAsLong() method is to be executed.getAsLong() method.public <T> T executeInArea(java.util.function.Supplier<T> logic)
MemoryAreaget() method from the logic parameter
using this memory area as the current allocation context. The
effect of executeInArea on the scope stack is specified in
the subclasses of MemoryArea.executeInArea in class MemoryArealogic - The logic whose get() method is to be executed.get() method.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2024 aicas GmbH. All Rights Reserved.