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


Java ExceptionUtil类代码示例

本文整理汇总了Java中com.hazelcast.util.ExceptionUtil的典型用法代码示例。如果您正苦于以下问题:Java ExceptionUtil类的具体用法?Java ExceptionUtil怎么用?Java ExceptionUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getMembers

import com.hazelcast.util.ExceptionUtil; //导入依赖的package包/类
@Override
protected Collection<String> getMembers() {
    try {
        Collection<String> list = aws.getPrivateIpAddresses();
        if (list.isEmpty()) {
            logger.warning("No EC2 instances found!");
        } else {
            if (logger.isFinestEnabled()) {
                StringBuilder sb = new StringBuilder("Found the following EC2 instances:\n");
                for (String ip : list) {
                    sb.append("    ").append(ip).append("\n");
                }
                logger.finest(sb.toString());
            }
        }
        return list;
    } catch (Exception e) {
        logger.warning(e);
        throw ExceptionUtil.rethrow(e);
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-aws,代码行数:22,代码来源:TcpIpJoinerOverAWS.java

示例2: build

import com.hazelcast.util.ExceptionUtil; //导入依赖的package包/类
@Override
public MapReduceTask<KeyIn, ValueIn, KeyOut, ValueOut> build( IMap<KeyIn, ValueIn> map )
{
    try
    {
        ClientMapProxy<KeyIn, ValueIn> proxy = (ClientMapProxy<KeyIn, ValueIn>) map;
        ClientContext context = (ClientContext) GET_CLIENTCONTEXT_METHOD.invoke( proxy );
        return new IMapClientMapReduceTaskProxy<KeyIn, ValueIn, KeyOut, ValueOut>( proxy.getName(), context,
                                                                                   hazelcastInstance );
    }
    catch ( Throwable t )
    {
        ExceptionUtil.rethrow( t );
    }
    return null;
}
 
开发者ID:noctarius,项目名称:castmapr,代码行数:17,代码来源:ClientMapReduceTaskBuilder.java

示例3: build

import com.hazelcast.util.ExceptionUtil; //导入依赖的package包/类
@Override
public MapReduceTask<KeyIn, ValueIn, KeyOut, ValueOut> build( IMap<KeyIn, ValueIn> map )
{
    try
    {
        MapProxyImpl<KeyIn, ValueIn> proxy = (MapProxyImpl<KeyIn, ValueIn>) map;
        NodeEngine nodeEngine = hazelcastInstance.node.nodeEngine;
        return new IMapNodeMapReduceTaskImpl<KeyIn, ValueIn, KeyOut, ValueOut>( proxy.getName(), nodeEngine,
                                                                                hazelcastInstance );
    }
    catch ( Throwable t )
    {
        ExceptionUtil.rethrow( t );
    }
    return null;
}
 
开发者ID:noctarius,项目名称:castmapr,代码行数:17,代码来源:NodeMapReduceTaskBuilder.java

示例4: run

import com.hazelcast.util.ExceptionUtil; //导入依赖的package包/类
@Override
public void run()
{
    try
    {
        Map<Integer, Object> responses = invokeTasks( isDistributableReducer() );
        Map groupedResponses = groupResponsesByKey( responses );
        Map reducedResults = finalReduceStep( groupedResponses );
        if ( collator == null )
        {
            listener.onCompletion( reducedResults );
        }
        else
        {
            R result = collator.collate( reducedResults );
            collatorListener.onCompletion( result );
        }
    }
    catch ( Throwable t )
    {
        ExceptionUtil.rethrow( t );
    }
}
 
开发者ID:noctarius,项目名称:castmapr,代码行数:24,代码来源:IListNodeMapReduceTaskImpl.java

示例5: submit

import com.hazelcast.util.ExceptionUtil; //导入依赖的package包/类
@Override
public Map<KeyIn, ValueIn> submit()
{
    List<KeyIn> keys = buildKeys();
    try
    {
        Map<Integer, Object> responses;
        if ( keys != null )
        {
            responses = invokeTasks( keys, isDistributableReducer() );
        }
        else
        {
            responses = invokeTasks( isDistributableReducer() );
        }
        Map<KeyOut, List<ValueOut>> groupedResponses = groupResponsesByKey( responses );
        return (Map<KeyIn, ValueIn>) finalReduceStep( groupedResponses );
    }
    catch ( Throwable t )
    {
        ExceptionUtil.rethrow( t );
    }
    return Collections.emptyMap();
}
 
开发者ID:noctarius,项目名称:castmapr,代码行数:25,代码来源:AbstractMapReduceTask.java

示例6: ClusteredSessionService

import com.hazelcast.util.ExceptionUtil; //导入依赖的package包/类
/**
 * Instantiates a new Clustered session service.
 *
 * @param filterConfig   the filter config
 */
public ClusteredSessionService(WebFilterConfig filterConfig) {
    this.filterConfig = filterConfig;
    try {
        init();
    } catch (Exception e) {
        ExceptionUtil.rethrow(e);
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-wm,代码行数:14,代码来源:ClusteredSessionService.java

示例7: setAttributes

import com.hazelcast.util.ExceptionUtil; //导入依赖的package包/类
private void setAttributes(Object attributes) {
    try {
        ATTRIBUTES_FIELD.set(this, attributes);
    } catch (IllegalAccessException e) {
        ExceptionUtil.rethrow(e);
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-tomcat-sessionmanager,代码行数:8,代码来源:HazelcastSession.java

示例8: getMembers

import com.hazelcast.util.ExceptionUtil; //导入依赖的package包/类
/**
 * Get a list of all members.
 * 
 * @return a collection with all members
 */
@Override
protected Collection<String> getMembers() {

    Collection<String> list = new LinkedList<>();
    String name = consulConfig.getName();
    try {

        ConsulResponse<List<CatalogService>> service = this.agentClient.getService(name);

        logger.info("Resolving service: " + name);

        for (CatalogService s : service.getResponse()) {
            if (logger.isFinestEnabled()) {
                logger.finest("Found service at: " + s.getAddress());
            }
            list.add(s.getAddress());
        }

        if (list.isEmpty()) {
            logger.info("No services found!");
        }
        return list;
    } catch (Exception e) {
        logger.warning(e);
        throw ExceptionUtil.rethrow(e);
    }
}
 
开发者ID:decoomanj,项目名称:hazelcast-consul,代码行数:33,代码来源:ConsulJoiner.java

示例9: discoverNodes

import com.hazelcast.util.ExceptionUtil; //导入依赖的package包/类
@Override
public Collection<DiscoveredNode> discoverNodes() {

    Collection<DiscoveredNode> list = new LinkedList<>();
    Properties empty = new Properties();

    if (this.agentClient != null) {
        try {

            ConsulResponse<List<CatalogService>> service = this.agentClient.getService(serviceName);

            LOG.log(Level.WARNING, "Resolving service: {0}", serviceName);

            for (CatalogService s : service.getResponse()) {
                if (LOG.isLoggable(Level.FINEST)) {
                    LOG.log(Level.FINEST, "Found service at: {0}", s.getAddress());
                }
                Address address = new Address(s.getAddress(), s.getServicePort());
                list.add(new SimpleDiscoveredNode(address, empty));
            }

            if (list.isEmpty()) {
                LOG.warning("No consul instances found!");
            }
            return list;
        } catch (Exception e) {
            LOG.severe(e.getMessage());
            throw ExceptionUtil.rethrow(e);
        }
    }
    return list;
}
 
开发者ID:decoomanj,项目名称:hazelcast-consul-spi,代码行数:33,代码来源:ConsulDiscovery.java

示例10: invoke

import com.hazelcast.util.ExceptionUtil; //导入依赖的package包/类
@Nonnull
@Override
public ICompletableFuture<ClientMessage> invoke(@Nonnegative int partitionId, @Nonnull ClientMessage request) {
    try {
        ClientInvocation clientInvocation = new ClientInvocation(client, request, partitionId);
        return clientInvocation.invoke();

    } catch (Exception e) {
        throw ExceptionUtil.rethrow(e);
    }
}
 
开发者ID:noctarius,项目名称:snowcast,代码行数:12,代码来源:Hazelcast37ClientInvocator.java

示例11: asyncInvoke

import com.hazelcast.util.ExceptionUtil; //导入依赖的package包/类
private <E> InternalCompletableFuture<E> asyncInvoke(Operation operation) {
    try {
        OperationService operationService = getNodeEngine().getOperationService();
        return (InternalCompletableFuture<E>) operationService.invokeOnPartition(
                TreeMapService.SERVICE_NAME, operation, partitionId);
    } catch (Throwable throwable) {
        throw ExceptionUtil.rethrow(throwable);
    }
}
 
开发者ID:buremba,项目名称:hazelcast-modules,代码行数:10,代码来源:TreeMapProxy.java

示例12: asyncInvoke

import com.hazelcast.util.ExceptionUtil; //导入依赖的package包/类
private <E> InternalCompletableFuture<E> asyncInvoke(Operation operation) {
    try {
        OperationService operationService = getNodeEngine().getOperationService();
        return (InternalCompletableFuture<E>) operationService.invokeOnPartition(
                HyperLogLogService.SERVICE_NAME, operation, partitionId);
    } catch (Throwable throwable) {
        throw ExceptionUtil.rethrow(throwable);
    }
}
 
开发者ID:buremba,项目名称:hazelcast-modules,代码行数:10,代码来源:HyperLogLogProxy.java

示例13: invokeOperation

import com.hazelcast.util.ExceptionUtil; //导入依赖的package包/类
private Object invokeOperation(Data key, KeyBasedMapOperation operation) {
    final NodeEngine nodeEngine = getNodeEngine();
    int partitionId = nodeEngine.getPartitionService().getPartitionId(key);
    operation.setThreadId(ThreadUtil.getThreadId());
    try {
        Future f;
        Object o;
        OperationService operationService = nodeEngine.getOperationService();
        if (mapConfig.isStatisticsEnabled()) {
            long time = System.currentTimeMillis();
            f = operationService
                    .createInvocationBuilder(SERVICE_NAME, operation, partitionId)
                    .setResultDeserialized(false)
                    .invoke();
            o = f.get();
            if (operation instanceof BasePutOperation)
                localMapStats.incrementPuts(System.currentTimeMillis() - time);
            else if (operation instanceof BaseRemoveOperation)
                localMapStats.incrementRemoves(System.currentTimeMillis() - time);
            else if (operation instanceof GetOperation)
                localMapStats.incrementGets(System.currentTimeMillis() - time);

        } else {
            f = operationService.createInvocationBuilder(SERVICE_NAME, operation, partitionId)
                    .setResultDeserialized(false).invoke();
            o = f.get();
        }
        return o;
    } catch (Throwable t) {
        throw ExceptionUtil.rethrow(t);
    }
}
 
开发者ID:buremba,项目名称:hazelcast-modules,代码行数:33,代码来源:CustomMapImpl.java

示例14: getCallable

import com.hazelcast.util.ExceptionUtil; //导入依赖的package包/类
/**
 * since this operation handles responses in an async way, we need to handle serialization exceptions too
 *
 * @return
 */
private Callable getCallable() {
    try {
        return getNodeEngine().toObject(callableData);
    } catch (HazelcastSerializationException e) {
        getResponseHandler().sendResponse(e);
        throw ExceptionUtil.rethrow(e);
    }
}
 
开发者ID:gurbuzali,项目名称:scheduled-executor,代码行数:14,代码来源:ScheduledCallableTaskOperation.java

示例15: buildMapReduceTaskBuilder

import com.hazelcast.util.ExceptionUtil; //导入依赖的package包/类
private MapReduceTaskBuilder buildMapReduceTaskBuilder( HazelcastInstance hazelcastInstance )
{
    try
    {
        String canonicalClassName = hazelcastInstance.getClass().getCanonicalName();

        String className;
        if ( NODE_HI_CLASS.equals( canonicalClassName ) )
        {
            className = "com.noctarius.castmapr.NodeMapReduceTaskBuilder";
        }
        else if ( CLIENT_HI_CLASS.equals( canonicalClassName ) )
        {
            className = "com.noctarius.castmapr.ClientMapReduceTaskBuilder";
        }
        else
        {
            throw new IllegalArgumentException( "Unknown HazelcastInstance implementation found." );
        }

        Class<? extends MapReduceTaskBuilder> builderClass;
        builderClass = (Class<? extends MapReduceTaskBuilder>) classLoader.loadClass( className );

        Constructor<MapReduceTaskBuilder> constructor;
        constructor =
            (Constructor<MapReduceTaskBuilder>) builderClass.getDeclaredConstructor( HazelcastInstance.class );

        return constructor.newInstance( hazelcastInstance );
    }
    catch ( Throwable t )
    {
        ExceptionUtil.rethrow( t );
    }
    return null;
}
 
开发者ID:noctarius,项目名称:castmapr,代码行数:36,代码来源:MapReduceTaskFactory.java


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