public abstract class GenericHeaplet extends Object implements Heaplet
If the object created is an instance of GenericHeapObject
, it is then
automatically injected with logger
and storage
objects.
Modifier and Type | Field and Description |
---|---|
protected org.forgerock.json.fluent.JsonValue |
config
The heaplet's object configuration object.
|
protected Heap |
heap
Where objects should be put and where object dependencies should be retrieved.
|
protected Logger |
logger
Provides methods for logging activities.
|
protected String |
name
The name of the object to be created and stored in the heap by this heaplet.
|
protected Object |
object
The object created by the heaplet's
create() method. |
protected Name |
qualified
The fully qualified name of the object to be created.
|
protected TemporaryStorage |
storage
Allocates temporary buffers for caching streamed content during processing.
|
Constructor and Description |
---|
GenericHeaplet() |
Modifier and Type | Method and Description |
---|---|
abstract Object |
create()
Called to request the heaplet create an object.
|
Object |
create(Name name,
org.forgerock.json.fluent.JsonValue config,
Heap heap)
Called to request the heaplet to create an object.
|
void |
destroy()
Called to indicate that the object created by the heaplet is going to be dereferenced.
|
void |
start()
Called to request the heaplet start an object.
|
protected String name
protected org.forgerock.json.fluent.JsonValue config
protected Heap heap
protected TemporaryStorage storage
public GenericHeaplet()
public Object create(Name name, org.forgerock.json.fluent.JsonValue config, Heap heap) throws HeapException
Heaplet
create
in interface Heaplet
name
- the name of the object to be created.config
- the heaplet's configuration object.heap
- the heap where object dependencies can be retrieved.HeapException
- if an exception occurred during creation of the object or any of its dependencies.public void destroy()
Heaplet
public abstract Object create() throws HeapException
Heaplet.create(Name, JsonValue, Heap)
after initializing
the protected field members. Implementations should parse configuration
but not acquire resources, start threads, or log any initialization
messages. These tasks should be performed by the start()
method.HeapException
- if an exception occurred during creation of the heap object
or any of its dependencies.org.forgerock.json.fluent.JsonValueException
- if the heaplet (or one of its dependencies) has a malformed
configuration.public void start() throws HeapException
Heaplet.create(Name, JsonValue, Heap)
after creating and
configuring the object and once the object's logger and storage have been
configured. Implementations should override this method if they need to
acquire resources, start threads, or log any initialization messages.HeapException
- if an exception occurred while starting the heap object or
any of its dependencies.Copyright © 2014 ForgeRock AS. All rights reserved.