Class SPSNameCacheable
- All Implemented Interfaces:
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DataDictionaryImplprivate TableKeyprivate SPSDescriptor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclean(boolean forRemove) Clean the object.voidPut the object into the No Identity state.createIdentity(Object key, Object createParameter) Create a new item.Get the identity of this object.Get the sps descriptor that is associated with this CacheablebooleanisDirty()Returns true of the object is dirty.setIdentity(Object key) Set the identity of the object.
-
Field Details
-
identity
-
spsd
-
dd
-
-
Constructor Details
-
SPSNameCacheable
SPSNameCacheable(DataDictionaryImpl dd)
-
-
Method Details
-
clearIdentity
public void clearIdentity()Description copied from interface:CacheablePut the object into 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.- Specified by:
clearIdentityin interfaceCacheable- See Also:
-
getIdentity
Description copied from interface:CacheableGet the identity of this object.
MT - thread safe.- Specified by:
getIdentityin interfaceCacheable- See Also:
-
createIdentity
Description copied from interface:CacheableCreate a new item.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.- Specified by:
createIdentityin interfaceCacheable- Returns:
- an object reference if the object can take on the identity, null otherwise.
- See Also:
-
setIdentity
Description copied from interface:CacheableSet the identity of the object.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.- Specified by:
setIdentityin interfaceCacheable- Returns:
- an object reference if the object can take on the identity, null otherwise.
- Throws:
StandardException- Thrown on error- See Also:
-
clean
public void clean(boolean forRemove) Description copied from interface:CacheableClean the object. It is up to the object to ensure synchronization of the isDirty() and clean() method calls.
If forRemove is true then the object is being removed due to an explict remove request, in this case the cache manager will have called this method regardless of the state of the isDirty()
If an exception is thrown the object must be left in the clean state.
MT - thread safe - Can be called at any time by the cache manager, it is the responsibility of the object implementing Cacheable to ensure any users of the object do not conflict with the clean call. -
isDirty
-
getSPSDescriptor
Get the sps descriptor that is associated with this Cacheable
-