diff options
Diffstat (limited to 'policy-core')
6 files changed, 49 insertions, 13 deletions
diff --git a/policy-core/pom.xml b/policy-core/pom.xml index ecd5b19e..a1c05810 100644 --- a/policy-core/pom.xml +++ b/policy-core/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.2.0-SNAPSHOT</version> + <version>1.2.1-SNAPSHOT</version> </parent> <dependencies> diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockFeatureAPI.java b/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockFeatureAPI.java index 9f42936d..d4e7bee9 100644 --- a/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockFeatureAPI.java +++ b/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockFeatureAPI.java @@ -64,7 +64,7 @@ public interface PolicyResourceLockFeatureAPI extends OrderedService { /** * Result of a requested operation. */ - public static enum OperResult { + public enum OperResult { /** * The implementer accepted the request; no additional locking logic should be diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockManager.java b/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockManager.java index a9305e51..97e7242d 100644 --- a/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockManager.java +++ b/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockManager.java @@ -130,11 +130,11 @@ public class PolicyResourceLockManager extends SimpleLockManager { } - return doBoolIntercept(impl -> impl.beforeIsLocked(resourceId), () -> { + return doBoolIntercept(impl -> impl.beforeIsLocked(resourceId), () -> // implementer didn't do the work - defer to the superclass - return super.isLocked(resourceId); - }); + super.isLocked(resourceId) + ); } /** @@ -151,11 +151,11 @@ public class PolicyResourceLockManager extends SimpleLockManager { throw makeNullArgException(MSG_NULL_OWNER); } - return doBoolIntercept(impl -> impl.beforeIsLockedBy(resourceId, owner), () -> { + return doBoolIntercept(impl -> impl.beforeIsLockedBy(resourceId, owner), () -> // implementer didn't do the work - defer to the superclass - return super.isLockedBy(resourceId, owner); - }); + super.isLockedBy(resourceId, owner) + ); } /** @@ -210,6 +210,8 @@ public class PolicyResourceLockManager extends SimpleLockManager { */ private static class Singleton { + private static final PolicyResourceLockManager instance = new PolicyResourceLockManager(); + /** * Not invoked. */ @@ -217,7 +219,6 @@ public class PolicyResourceLockManager extends SimpleLockManager { super(); } - private static final PolicyResourceLockManager instance = new PolicyResourceLockManager(); } /** diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/lock/SimpleLockManager.java b/policy-core/src/main/java/org/onap/policy/drools/core/lock/SimpleLockManager.java index 14cffaab..c2d58b85 100644 --- a/policy-core/src/main/java/org/onap/policy/drools/core/lock/SimpleLockManager.java +++ b/policy-core/src/main/java/org/onap/policy/drools/core/lock/SimpleLockManager.java @@ -49,9 +49,6 @@ public class SimpleLockManager { super(); } - // TODO: for ease of use by clients, should we always invoke the callback, even though - // this is synchronous? - /** * Attempts to lock a resource. This method ignores the callback and always returns a * {@link CompletedLockRequest}. diff --git a/policy-core/src/test/resources/drools-artifact-1.1/src/main/resources/rules.drl b/policy-core/src/test/resources/drools-artifact-1.1/src/main/resources/rules.drl index 9dac208b..426c4df9 100644 --- a/policy-core/src/test/resources/drools-artifact-1.1/src/main/resources/rules.drl +++ b/policy-core/src/test/resources/drools-artifact-1.1/src/main/resources/rules.drl @@ -1,4 +1,23 @@ -package org.onap.policy.drools.core.test; +/* + * ============LICENSE_START======================================================= + * policy-core + * ================================================================================ + * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + package org.onap.policy.drools.core.test; rule "Initialization" when diff --git a/policy-core/src/test/resources/drools-artifact-1.2/src/main/resources/rules.drl b/policy-core/src/test/resources/drools-artifact-1.2/src/main/resources/rules.drl index e69b6597..a53047a2 100644 --- a/policy-core/src/test/resources/drools-artifact-1.2/src/main/resources/rules.drl +++ b/policy-core/src/test/resources/drools-artifact-1.2/src/main/resources/rules.drl @@ -1,3 +1,22 @@ +/* + * ============LICENSE_START======================================================= + * policy-core + * ================================================================================ + * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ package org.onap.policy.drools.core.test; rule "Initialization" |