org.modeshape.jcr

## Class InfinispanUtil

- java.lang.Object
- - org.modeshape.jcr.InfinispanUtil

-     public class InfinispanUtil
      extends Object

  A set of utility methods for Infinispan caches.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `InfinispanUtil.Combiner<T>` The interface that defines how the results should be merged
    `static class` | `InfinispanUtil.Location`
    `static interface` | `InfinispanUtil.Sequence<T>` A sequence of values.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static Logger` | `LOGGER`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <K,V,T> T` | `execute(Cache<K,V> cache, InfinispanUtil.Location location, DistributedCallable<K,V,T> callable, InfinispanUtil.Combiner<T> combiner)` Utility to run the supplied callable in all the processes where the cache is being run.
    `static <K,V> InfinispanUtil.Sequence<K>` | `getAllKeys(Cache<K,V> cache)` Get all of the keys in the cache.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LOGGER

          protected static final Logger LOGGER

  - ### Method Detail

    - #### execute

          public static <K,V,T> T execute(Cache<K,V> cache,
                          InfinispanUtil.Location location,
                          DistributedCallable<K,V,T> callable,
                          InfinispanUtil.Combiner<T> combiner)
                           throws InterruptedException,
                                  ExecutionException

      Utility to run the supplied callable in all the processes where the cache is being run.
      Type Parameters:
        `K` - the type of key used in the cache
        `V` - the type of value used in the cache
        `T` - the type of result
      Parameters:
        `cache` - the cache
        `location` - the location where the callable should be run; if null, `InfinispanUtil.Location.LOCALLY` is used
        `callable` - the callable
        `combiner` - the component that can combine multiple results of type T into a single result
      Returns:
        the result of the operation
      Throws:
        `InterruptedException` - if the process is interrupted
        `ExecutionException` - if there is an error while getting executing the operation

    - #### getAllKeys

          public static <K,V> InfinispanUtil.Sequence<K> getAllKeys(Cache<K,V> cache)
                                                       throws InterruptedException,
                                                              ExecutionException

      Get all of the keys in the cache.
      Type Parameters:
        `K` - the type of key
        `V` - the type of value
      Parameters:
        `cache` - the cache
      Returns:
        the sequence that can be used to obtain the keys; never null
      Throws:
        `InterruptedException` - if the process is interrupted
        `ExecutionException` - if there is an error while getting all keys

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.