Annotation Interface CacheObjectAttribute
An attribute that indicates that the property or class to which it applies are available for queries.
When you annotate selected methods in a class with CacheObjectAttribute
you indicate that the return values of those methods are used by the ScaleOut in-memory data grid
when query requests are performed.
The methods annotated should be public and have no parameters. Static methods are not allowed.
The return type must be serializable.
If the method signature is illegal, a ObjectIndexAttributeException
will be thrown.
While you can annotate the methods of interfaces with CacheObjectAttribute
,
type signature information for interfaces is never saved in the StateServer property index.
Sample class with CacheObjectAttributes:
public class MyClass implements Serializable { String name; int number; MyClass() { } @CacheObjectAttribute(HashIndexPriority.HighPriorityHashable) public String getName() { return name; } @CacheObjectAttribute public int getNumber() { return number; } }
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionIndicates the priority of an item annotated withCacheObjectAttribute
for using the limited slots (8 total slots) in the in-memory data grid property index hash table.
-
Element Details
-
value
HashIndexPriority valueIndicates the priority of an item annotated withCacheObjectAttribute
for using the limited slots (8 total slots) in the in-memory data grid property index hash table. Even if there's no room for an item in the hash table, the item will still be entered into the property index.- Returns:
- the
HashIndexPriority
- Default:
- NotHashable
-