Cacheable
class SPSNameCacheable extends java.lang.Object implements Cacheable
The cache ensures that the class of the target sps is loaded if the sps is found in cache. This is ensured by calling loadGeneratedClass() on the sps when it is added to the cache. Each subsequent user of the sps cache will do its own load/unload on the class. Because the class manager/loader maintains reference counts on the classes it is handling, the user load/unload will just increment/decrement the use count. Only when the sps is uncached will it be unloaded.
Modifier and Type | Field | Description |
---|---|---|
private DataDictionaryImpl |
dd |
|
private TableKey |
identity |
|
private SPSDescriptor |
spsd |
Constructor | Description |
---|---|
SPSNameCacheable(DataDictionaryImpl dd) |
Modifier and Type | Method | Description |
---|---|---|
void |
clean(boolean forRemove) |
Clean the object.
|
void |
clearIdentity() |
Put the object into the No Identity state.
|
Cacheable |
createIdentity(java.lang.Object key,
java.lang.Object createParameter) |
Create a new item.
|
java.lang.Object |
getIdentity() |
Get the identity of this object.
|
SPSDescriptor |
getSPSDescriptor() |
Get the sps descriptor that is associated with this Cacheable
|
boolean |
isDirty() |
Returns true of the object is dirty.
|
Cacheable |
setIdentity(java.lang.Object key) |
Set the identity of the object.
|
private TableKey identity
private SPSDescriptor spsd
private final DataDictionaryImpl dd
SPSNameCacheable(DataDictionaryImpl dd)
public void clearIdentity()
Cacheable
clearIdentity
in interface Cacheable
Cacheable.clearIdentity()
public java.lang.Object getIdentity()
Cacheable
getIdentity
in interface Cacheable
Cacheable.getIdentity()
public Cacheable createIdentity(java.lang.Object key, java.lang.Object createParameter)
Cacheable
Create a new item and set the identity of the object to represent it.
The object will be in the No Identity state,
ie. it will have just been created or clearIdentity() was just called.
The object must copy the information out of key, not just store a reference to key
if the key is not immutable.
After this call the expression getIdentity().equals(key) must return true.
If the class of the object needs to change (e.g. to support a different format)
then the object should create a new object, call its initParameter() with the parameters
the original object was called with, set its identity and return a reference to it. The cache
manager will discard the reference to the old object.
If an exception is thrown the object must be left in the no-identity state.
MT - single thread required - Method must only be called be cache manager
and the cache manager will guarantee only one thread can be calling it.
createIdentity
in interface Cacheable
Cacheable.createIdentity(java.lang.Object, java.lang.Object)
public Cacheable setIdentity(java.lang.Object key) throws StandardException
Cacheable
Set the identity of the object to represent an item that already exists,
e.g. an existing container.
The object will be in the No Identity state,
ie. it will have just been created or clearIdentity() was just called.
The object must copy the information out of key, not just store a reference to key.
After this call the expression getIdentity().equals(key) must return true.
If the class of the object needs to change (e.g. to support a different format)
then the object should create a new object, call its initParameter() with the parameters
the original object was called with, set its identity and return a reference to it. The cache
manager will discard the reference to the old object.
If an exception is thrown the object must be left in the no-identity state.
MT - single thread required - Method must only be called be cache manager
and the cache manager will guarantee only one thread can be calling it.
setIdentity
in interface Cacheable
StandardException
- Thrown on errorCacheable.setIdentity(java.lang.Object)
public void clean(boolean forRemove)
Cacheable
clean
in interface Cacheable
Cacheable.clean(boolean)
public boolean isDirty()
Cacheable
isDirty
in interface Cacheable
Cacheable.isDirty()
public SPSDescriptor getSPSDescriptor()
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.