@Target(value={METHOD,TYPE})
@Retention(value=RUNTIME)
public @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; } }
Modifier and Type | Optional Element and Description |
---|---|
HashIndexPriority |
value
Indicates the priority of an item annotated with
CacheObjectAttribute for using the limited slots (8 total slots) in the
in-memory data grid property index hash table. |
public abstract HashIndexPriority value
CacheObjectAttribute
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.HashIndexPriority