Package org.forgerock.openig.heap
Class Heaplets
java.lang.Object
org.forgerock.openig.heap.Heaplets
Loads
Heaplet
classes based on the class of object they create. Three methods of
locating the heaplet class are attempted, in the following order:
- The
Loader
class attempts to locate aHeapletFactory
interface implementation suitable for the class being created. - A nested
Heaplet
class is searched for. Example: creatingcom.example.Foo
would search for a heaplet class namedcom.example.Foo$Heaplet
. - A standalone class with the name
Heaplet
appended. Example: creatingcom.example.Foo
would search for a heaplet class namedcom.example.FooHeaplet
.
-
Method Summary
Modifier and TypeMethodDescriptionfindHeapletClass
(Class<?> c) Finds the heaplet class associated to the givenc
type.static Heaplet
getHeaplet
(Class<?> c) Returns the heaplet that creates an instance of the specified class, ornull
if no such heaplet could be found.
-
Method Details
-
getHeaplet
Returns the heaplet that creates an instance of the specified class, ornull
if no such heaplet could be found.- Parameters:
c
- the class that the heaplet is responsible for creating.- Returns:
- the heaplet that creates the specified class, or
null
if not found.
-
findHeapletClass
Finds the heaplet class associated to the givenc
type.- Parameters:
c
- type to find a heaplet for- Returns:
- an optional containing the heaplet class (if found), otherwise empty.
-