当前位置: 首页>>代码示例>>Java>>正文


Java GigaSpace.readMultiple方法代码示例

本文整理汇总了Java中org.openspaces.core.GigaSpace.readMultiple方法的典型用法代码示例。如果您正苦于以下问题:Java GigaSpace.readMultiple方法的具体用法?Java GigaSpace.readMultiple怎么用?Java GigaSpace.readMultiple使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openspaces.core.GigaSpace的用法示例。


在下文中一共展示了GigaSpace.readMultiple方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doReceiveBlocking

import org.openspaces.core.GigaSpace; //导入方法依赖的package包/类
/**
 * First tries and perform a {@link org.openspaces.core.GigaSpace#readMultiple(Object,int,int)} using
 * the provided template, configured maxEntries (defaults to <code>50</code>) and the configured fifoGroups (default to <code>false</code>).  
 * If no values are returned, will perform a blocking read operation using
 * {@link org.openspaces.core.GigaSpace#read(Object,long,int)}.
 *
 * <p>Read operations are performed under an exclusive read lock which mimics the similar behavior
 * as take without actually taking the entry from the space.
 */
@Override
protected Object doReceiveBlocking(Object template, GigaSpace gigaSpace, long receiveTimeout) throws DataAccessException {
    ReadModifiers modifiers = gigaSpace.getDefaultReadModifiers().add(ReadModifiers.EXCLUSIVE_READ_LOCK);
    if(useFifoGrouping)
        modifiers = modifiers.add(ReadModifiers.FIFO_GROUPING_POLL);
    if (useMemoryOnlySearch)
        modifiers = modifiers.add(ReadModifiers.MEMORY_ONLY_SEARCH);
    
    Object[] results = gigaSpace.readMultiple(template, maxEntries, modifiers);
    if (results != null && results.length > 0) {
        return results;
    }
    return gigaSpace.read(template, receiveTimeout, modifiers);
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:24,代码来源:MultiExclusiveReadReceiveOperationHandler.java

示例2: doReceiveNonBlocking

import org.openspaces.core.GigaSpace; //导入方法依赖的package包/类
/**
 * Perform a {@link org.openspaces.core.GigaSpace#readMultiple(Object,int,int)}
 * using the provided template, configured maxEntries (defaults to <code>50</code>) and the configured fifoGroups (default to <code>false</code>).
 *
 * <p>Read operations are performed under an exclusive read lock which mimics the similar behavior
 * as take without actually taking the entry from the space.
 */
@Override
protected Object doReceiveNonBlocking(Object template, GigaSpace gigaSpace) throws DataAccessException {
    ReadModifiers modifiers = gigaSpace.getDefaultReadModifiers().add(ReadModifiers.EXCLUSIVE_READ_LOCK);
    if(useFifoGrouping)
        modifiers = modifiers.add(ReadModifiers.FIFO_GROUPING_POLL);
    if (useMemoryOnlySearch)
        modifiers = modifiers.add(ReadModifiers.MEMORY_ONLY_SEARCH);
    
    Object[] results = gigaSpace.readMultiple(template, maxEntries, modifiers);
    if (results != null && results.length > 0) {
        return results;
    }
    return null;
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:22,代码来源:MultiExclusiveReadReceiveOperationHandler.java

示例3: doReceiveBlocking

import org.openspaces.core.GigaSpace; //导入方法依赖的package包/类
/**
 * First tries and perform a {@link org.openspaces.core.GigaSpace#readMultiple(Object,int)}
 * using the provided template and configured maxEntries (defaults to <code>50</code>). If no
 * values are returned, will perform a blocking read operation using
 * {@link org.openspaces.core.GigaSpace#read(Object,long)}.
 */
@Override
protected Object doReceiveBlocking(Object template, GigaSpace gigaSpace, long receiveTimeout) throws DataAccessException {
    int modifiers = gigaSpace.getSpace().getReadModifiers();
    if (useMemoryOnlySearch)
        modifiers |= ReadModifiers.MEMORY_ONLY_SEARCH;
    Object[] results = gigaSpace.readMultiple(template, maxEntries, modifiers);
    if (results != null && results.length > 0) {
        return results;
    }
    return gigaSpace.read(template, receiveTimeout, modifiers);
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:18,代码来源:MultiReadReceiveOperationHandler.java

示例4: doReceiveNonBlocking

import org.openspaces.core.GigaSpace; //导入方法依赖的package包/类
/**
 * Perform a {@link org.openspaces.core.GigaSpace#readMultiple(Object,int)}
 * using the provided template and configured maxEntries (defaults to <code>50</code>). This is a non
 * blocking operation.
 */
@Override
protected Object doReceiveNonBlocking(Object template, GigaSpace gigaSpace) throws DataAccessException {
    int modifiers = gigaSpace.getSpace().getReadModifiers();
    if (useMemoryOnlySearch)
        modifiers |= ReadModifiers.MEMORY_ONLY_SEARCH;
    Object[] results = gigaSpace.readMultiple(template, maxEntries, modifiers);
    if (results != null && results.length > 0) {
        return results;
    }
    return null;
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:17,代码来源:MultiReadReceiveOperationHandler.java


注:本文中的org.openspaces.core.GigaSpace.readMultiple方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。