Search in sources :

Example 1 with ExecuteRegionFunctionSingleHopOpImpl

use of org.apache.geode.cache.client.internal.ExecuteRegionFunctionSingleHopOp.ExecuteRegionFunctionSingleHopOpImpl in project geode by apache.

the class SingleHopOperationCallable method call.

public Object call() throws Exception {
    op.initMessagePart();
    Object result = null;
    boolean onlyUseExistingCnx = ((pool.getMaxConnections() != -1 && pool.getConnectionCount() >= pool.getMaxConnections()) ? true : false);
    op.setAllowDuplicateMetadataRefresh(!onlyUseExistingCnx);
    try {
        UserAttributes.userAttributes.set(securityAttributes);
        result = this.pool.executeOn(server, op, true, onlyUseExistingCnx);
    } catch (AllConnectionsInUseException ex) {
        // server
        if (op instanceof ExecuteRegionFunctionSingleHopOpImpl) {
            ExecuteRegionFunctionSingleHopOpImpl newop = (ExecuteRegionFunctionSingleHopOpImpl) op;
            result = this.pool.execute(new ExecuteRegionFunctionOpImpl(newop));
        } else {
            result = this.pool.execute(this.op);
        }
    } finally {
        UserAttributes.userAttributes.set(null);
    }
    return result;
}
Also used : ExecuteRegionFunctionOpImpl(org.apache.geode.cache.client.internal.ExecuteRegionFunctionOp.ExecuteRegionFunctionOpImpl) AllConnectionsInUseException(org.apache.geode.cache.client.AllConnectionsInUseException) ExecuteRegionFunctionSingleHopOpImpl(org.apache.geode.cache.client.internal.ExecuteRegionFunctionSingleHopOp.ExecuteRegionFunctionSingleHopOpImpl)

Aggregations

AllConnectionsInUseException (org.apache.geode.cache.client.AllConnectionsInUseException)1 ExecuteRegionFunctionOpImpl (org.apache.geode.cache.client.internal.ExecuteRegionFunctionOp.ExecuteRegionFunctionOpImpl)1 ExecuteRegionFunctionSingleHopOpImpl (org.apache.geode.cache.client.internal.ExecuteRegionFunctionSingleHopOp.ExecuteRegionFunctionSingleHopOpImpl)1