All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.distribution.group.Group Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.distribution.group;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
 * 

* Identifies the key for a group. *

* *

* @Group should be used when you have control over the key class. For example: *

* *
 * class User {
 * 
 *    ...
 *    String office;
 *    ...
 *    
 *    int hashCode() {
 *       // Defines the hash for the key, normally used to determine location
 *       ...
 *    }
 *    
 *    // Override the location by specifying a group, all keys in the same 
 *    // group end up with the same owner
 *    @Group
 *    String getOffice() {
 *       return office;
 *    }
 *    
 * }
 * 
* *

* If you don't have control over the key class, you can specify a {@link Grouper} (in your configuration) which can be used to * specify the group externally. *

* *

* You must set the groupsEnabled property to true in your configuration in order to use groups. *

* * @see Grouper * * @author Pete Muir * */ @Target(METHOD) @Retention(RUNTIME) public @interface Group { }