@Target(value={METHOD,TYPE}) @Retention(value=RUNTIME) public @interface SossIndexAttribute
A marker that indicates that the property or class to which it applies should be saved in the StateServer property index when instances of the class are created or updated.
When you annotate selected methods in a class with SossIndexAttribute
you indicate that the return values of those methods should be saved in the StateServer's
property index whenever an instance of the class is created or updated. Information
about the class's type hierarchy are also included in the information saved in
the property index. If you want to be able to query StateServer for instances of a
class but don't need to save any values within the property index, you can
annotate the class itself with the SossIndexAttribute
.
The methods annotated should be public and have no parameters. Static methods are not allowed.
The return type should be serializable.
If the method signature is illegal, a NamedCacheIndexAttributeException
will be thrown.
While you can annotate the methods of interfaces with SossIndexAttribute
,
type signature information for interfaces is never saved in the StateServer property index.
An example of object with attributes:
public class MyClass implements Serializable { String name; int number; MyClass() { } @SossIndexAttribute(HashIndexPriority.HighPriorityHashable) public String getName() { return name; } @SossIndexAttribute public int getNumber() { return number; } }
Modifier and Type | Optional Element and Description |
---|---|
HashIndexPriority |
value
Indicates the priority of an item annotated with
SossIndexAttribute for using the limited slots in the
StateServer's property index hash table. |
public abstract HashIndexPriority value
SossIndexAttribute
for using the limited slots in the
StateServer's 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
Copyright (C) 2007-2014 ScaleOut Software, Inc.