use of com.hazelcast.spi.impl.operationservice.OperationResponseHandler in project hazelcast by hazelcast.
the class OnJoinOp method beforeRun.
@Override
public void beforeRun() throws Exception {
if (!operations.isEmpty()) {
NodeEngine nodeEngine = getNodeEngine();
OperationResponseHandler responseHandler = createErrorLoggingResponseHandler(getLogger());
for (Operation op : operations) {
op.setNodeEngine(nodeEngine);
op.setOperationResponseHandler(responseHandler);
OperationAccessor.setCallerAddress(op, getCallerAddress());
OperationAccessor.setConnection(op, getConnection());
}
}
}
use of com.hazelcast.spi.impl.operationservice.OperationResponseHandler in project hazelcast by hazelcast.
the class OperationRunnerImpl method setOperationResponseHandler.
private void setOperationResponseHandler(Operation op) {
OperationResponseHandler handler = outboundResponseHandler;
if (op.getCallId() == 0) {
if (op.returnsResponse()) {
throw new HazelcastException("Operation " + op + " wants to return a response, but doesn't have a call ID");
}
handler = createEmptyResponseHandler();
}
op.setOperationResponseHandler(handler);
}
use of com.hazelcast.spi.impl.operationservice.OperationResponseHandler in project hazelcast by hazelcast.
the class WaitSet method onShutdown.
public void onShutdown() {
Object response = new HazelcastInstanceNotActiveException();
Address thisAddress = nodeEngine.getThisAddress();
for (WaitSetEntry entry : queue) {
if (!entry.isValid()) {
continue;
}
Operation op = entry.getOperation();
// only for local invocations, remote ones will be expired via #onMemberLeft()
if (thisAddress.equals(op.getCallerAddress())) {
try {
OperationResponseHandler responseHandler = op.getOperationResponseHandler();
responseHandler.sendResponse(op, response);
} catch (Exception e) {
logger.finest("While sending HazelcastInstanceNotActiveException response...", e);
}
}
queue.clear();
}
}
use of com.hazelcast.spi.impl.operationservice.OperationResponseHandler in project hazelcast by hazelcast.
the class WaitSetEntry method onCancel.
public void onCancel() {
OperationResponseHandler responseHandler = op.getOperationResponseHandler();
responseHandler.sendResponse(op, cancelResponse);
}
use of com.hazelcast.spi.impl.operationservice.OperationResponseHandler in project hazelcast by hazelcast.
the class PartitionReplicaSyncResponse method prepareOperation.
private void prepareOperation(Operation op) {
int partitionId = getPartitionId();
int replicaIndex = getReplicaIndex();
NodeEngine nodeEngine = getNodeEngine();
ILogger opLogger = nodeEngine.getLogger(op.getClass());
OperationResponseHandler responseHandler = createErrorLoggingResponseHandler(opLogger);
op.setNodeEngine(nodeEngine).setPartitionId(partitionId).setReplicaIndex(replicaIndex).setOperationResponseHandler(responseHandler);
}
Aggregations