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(BooleanSupplier logic)
Same as
MemoryArea.enter(Runnable) except that the executed method is
called getAsBoolean() and a boolean is returned. |
double |
enter(DoubleSupplier logic)
Same as
MemoryArea.enter(Runnable) except that the executed method is
called getAsDouble() and a double is returned. |
int |
enter(IntSupplier logic)
Same as
MemoryArea.enter(Runnable) except that the executed method is
called getAsInt() and an int is returned. |
long |
enter(LongSupplier logic)
Same as
MemoryArea.enter(Runnable) except that the executed method is
called getAsLong() and a long is returned. |
void |
enter(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(Supplier<T> logic)
Same as
MemoryArea.enter(Runnable) except that the executed method is
called get() and an object is returned. |
boolean |
executeInArea(BooleanSupplier logic)
Executes the
getAsBoolean() method from the logic
parameter using this memory area as the current allocation
context. |
double |
executeInArea(DoubleSupplier logic)
Executes the
getAsDouble() method from the logic parameter
using this memory area as the current allocation context. |
int |
executeInArea(IntSupplier logic)
Executes the
getAsInt() method from the logic parameter
using this memory area as the current allocation context. |
long |
executeInArea(LongSupplier logic)
Executes the
getAsLong() method from the logic parameter
using this memory area as the current allocation context. |
void |
executeInArea(Runnable logic)
Executes the
run() method from the logic parameter
using this memory area as the current allocation context. |
<T> T |
executeInArea(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, size
public static ImmortalMemory instance()
public void enter()
MemoryArea
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
MemoryArea.executeInArea(java.lang.Runnable)
) or the enter
method exits.enter
in class MemoryArea
public void enter(Runnable logic)
MemoryArea
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 MemoryArea.executeInArea(java.lang.Runnable)
) or the enter
method exits.enter
in class MemoryArea
logic
- The Runnable object whose run()
method should be
invoked.public boolean enter(BooleanSupplier logic)
MemoryArea
MemoryArea.enter(Runnable)
except that the executed method is
called getAsBoolean()
and a boolean is returned.enter
in class MemoryArea
logic
- The object whose getAsboolean()
method is to
be executed.getAsBoolean()
method.public double enter(DoubleSupplier logic)
MemoryArea
MemoryArea.enter(Runnable)
except that the executed method is
called getAsDouble()
and a double is returned.enter
in class MemoryArea
logic
- The object whose getAsDouble()
method is to be
executed.getAsDouble()
method.public int enter(IntSupplier logic)
MemoryArea
MemoryArea.enter(Runnable)
except that the executed method is
called getAsInt()
and an int is returned.enter
in class MemoryArea
logic
- The object whose getAsInt()
method is to be
executed.getAsInt()
method.public long enter(LongSupplier logic)
MemoryArea
MemoryArea.enter(Runnable)
except that the executed method is
called getAsLong()
and a long is returned.enter
in class MemoryArea
logic
- The object whose getAsLong()
method is to be
executed.getAsLong()
method.public <T> T enter(Supplier<T> logic)
MemoryArea
MemoryArea.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 MemoryArea
logic
- The object whose get()
method is to be
executed.get()
method.public void executeInArea(Runnable logic)
MemoryArea
run()
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 MemoryArea
logic
- The logic whose run()
method is to be executed.public boolean executeInArea(BooleanSupplier logic)
MemoryArea
getAsBoolean()
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 MemoryArea
logic
- The logic whose getAsBoolean()
method is to be
executed.getAsBoolean()
method.public double executeInArea(DoubleSupplier logic)
MemoryArea
getAsDouble()
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 MemoryArea
logic
- The logic whose getAsDouble()
method is to be
executed.getAsDouble()
method.public int executeInArea(IntSupplier logic)
MemoryArea
getAsInt()
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 MemoryArea
logic
- The logic whose getAsInt()
method is to be executed.getAsInt()
method.public long executeInArea(LongSupplier logic)
MemoryArea
getAsLong()
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 MemoryArea
logic
- The logic whose getAsLong()
method is to be executed.getAsLong()
method.public <T> T executeInArea(Supplier<T> logic)
MemoryArea
get()
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 MemoryArea
logic
- The logic whose get()
method is to be executed.get()
method.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2025 aicas GmbH. All Rights Reserved.