import java.util.HashMap;
import java.util.Properties;
import java.util.UUID;
-import java.util.function.Supplier;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import org.drools.core.WorkingMemory;
-import org.onap.policy.drools.controller.DroolsController;
import org.onap.policy.drools.core.PolicyContainer;
import org.onap.policy.drools.core.PolicySession;
import org.onap.policy.drools.system.PolicyController;
import org.onap.policy.drools.system.PolicyControllerConstants;
import org.onap.policy.drools.system.PolicyEngineConstants;
-import org.onap.policy.guard.OperationsHistory;
-import org.onap.policy.guard.Util;
import org.onap.policy.util.DroolsSessionCommonSerializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
sb.setLength(sb.length() - 2);
errorMessage = sb.toString();
disabled = true;
- logger.error("Initialization failure: " + errorMessage);
+ logger.error("Initialization failure: {}", errorMessage);
}
}
if (disabled) {
if (errorMessage != null) {
- logger.error("Database update skipped: " + errorMessage);
+ logger.error("Database update skipped: {}", errorMessage);
}
return false;
}
final String message, final String outcome) {
if (disabled) {
if (errorMessage != null) {
- logger.error("Database update skipped: " + errorMessage);
+ logger.error("Database update skipped: {}", errorMessage);
}
return;
}
package org.onap.policy.drools.m2.lock;
import java.io.Serializable;
-import java.util.HashMap;
import org.onap.policy.drools.core.lock.Lock;
import org.onap.policy.drools.core.lock.LockCallback;
this.requestor = requestor;
// try to allocate a new lock
- if ((lock = PolicyEngineConstants.getManager().createLock(
- key, ownerKey, 600, this, waitForLock)).isActive()) {
- // the lock is good
- return true;
- }
-
- // we need to wait for the lock -- return false,
- return false;
+ lock = PolicyEngineConstants.getManager().createLock(
+ key, ownerKey, 600, this, waitForLock);
+ // return the boolean value of the lock.isactive
+ return lock.isActive();
}
/*=================================*/