use of com.hazelcast.internal.services.ServiceNamespaceAware in project hazelcast by hazelcast.
the class OperationBackupHandler method checkServiceNamespaces.
private void checkServiceNamespaces(BackupAwareOperation backupAwareOp, Operation backupOp) {
Operation op = (Operation) backupAwareOp;
Object service;
try {
service = op.getService();
} catch (Exception ignored) {
// operation doesn't know its service name
return;
}
if (service instanceof FragmentedMigrationAwareService) {
assert backupAwareOp instanceof ServiceNamespaceAware : service + " is instance of FragmentedMigrationAwareService, " + backupAwareOp + " should implement ServiceNamespaceAware!";
assert backupOp instanceof ServiceNamespaceAware : service + " is instance of FragmentedMigrationAwareService, " + backupOp + " should implement ServiceNamespaceAware!";
} else {
assert !(backupAwareOp instanceof ServiceNamespaceAware) : service + " is NOT instance of FragmentedMigrationAwareService, " + backupAwareOp + " should NOT implement ServiceNamespaceAware!";
assert !(backupOp instanceof ServiceNamespaceAware) : service + " is NOT instance of FragmentedMigrationAwareService, " + backupOp + " should NOT implement ServiceNamespaceAware!";
}
}
use of com.hazelcast.internal.services.ServiceNamespaceAware in project hazelcast by hazelcast.
the class SplitBrainProtectionServiceImpl method getSplitBrainProtectionAwareService.
private SplitBrainProtectionAwareService getSplitBrainProtectionAwareService(Operation op) {
Object service;
if (op instanceof ServiceNamespaceAware) {
ServiceNamespace serviceNamespace = ((ServiceNamespaceAware) op).getServiceNamespace();
service = nodeEngine.getService(serviceNamespace.getServiceName());
} else {
service = op.getService();
}
if (service instanceof SplitBrainProtectionAwareService) {
return (SplitBrainProtectionAwareService) service;
}
return null;
}
Aggregations