From a6d4077e3639a0f3478f0cbf51e06ef46517a10d Mon Sep 17 00:00:00 2001 From: "Straubs, Ralph (rs8887)" Date: Fri, 17 Jul 2020 10:38:02 -0400 Subject: Add tdjam-controller the details is on wiki: https://wiki.onap.org/display/DW/tdjam+Feature+for+Tosca-Driven+Control+Loops Fixed some eclipse warnings. Revised the interaction between a manager and its SerialWorkQueue to address some threading issues. The original code started processing the event as soon as the manager was created, WHILE it was still being added to the map. During junit tests, the event responses came back, within the same thread, which then attempted to remove the manager from the map. This resulted in a ConcurrentHashMap exception. Issue-ID: POLICY-2415 Change-Id: I94a4152637be76e5b2aea2d869afd84dfb413a0e Signed-off-by: Straubs, Ralph (rs8887) Signed-off-by: jhh Signed-off-by: Taka Cho Signed-off-by: Jim Hahn --- .../controller-frankfurt/src/main/resources/frankfurt.drl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'controlloop/common/controller-frankfurt/src/main') diff --git a/controlloop/common/controller-frankfurt/src/main/resources/frankfurt.drl b/controlloop/common/controller-frankfurt/src/main/resources/frankfurt.drl index 9723cec43..8169e1cdc 100644 --- a/controlloop/common/controller-frankfurt/src/main/resources/frankfurt.drl +++ b/controlloop/common/controller-frankfurt/src/main/resources/frankfurt.drl @@ -25,7 +25,7 @@ import org.onap.policy.controlloop.CanonicalOnset; import org.onap.policy.controlloop.VirtualControlLoopEvent; import org.onap.policy.controlloop.VirtualControlLoopNotification; import org.onap.policy.controlloop.ControlLoopNotificationType; -import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager2; +import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager2Drools; import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager2.NewEventStatus; import org.onap.policy.controlloop.eventmanager.ControlLoopOperationManager2; import org.onap.policy.controlloop.utils.ControlLoopUtils; @@ -98,7 +98,7 @@ rule "EVENT" when $params : ControlLoopParams( $clName : getClosedLoopControlName() ) $event : CanonicalOnset( closedLoopControlName == $clName ) - not ( ControlLoopEventManager2( closedLoopControlName == $event.getClosedLoopControlName(), + not ( ControlLoopEventManager2Drools( closedLoopControlName == $event.getClosedLoopControlName(), getContext().getEvent() == $event ) ) then @@ -116,7 +116,7 @@ rule "EVENT" try { // // Check the event, because we need it to not be null when - // we create the ControlLoopEventManager2. The ControlLoopEventManager2 + // we create the ControlLoopEventManager2Drools. The ControlLoopEventManager2Drools // will do extra syntax checking as well as check if the closed loop is disabled. // if ($event.getRequestId() == null) { @@ -129,7 +129,7 @@ rule "EVENT" notification.setPolicyVersion($params.getPolicyVersion()); } else { - ControlLoopEventManager2 manager = new ControlLoopEventManager2($params, $event, drools.getWorkingMemory()); + ControlLoopEventManager2Drools manager = new ControlLoopEventManager2Drools($params, $event, drools.getWorkingMemory()); insert(manager); try { manager.start(); @@ -171,7 +171,7 @@ end rule "EVENT.MANAGER.NEW.EVENT" when $event : VirtualControlLoopEvent( ) - $manager : ControlLoopEventManager2( closedLoopControlName == $event.getClosedLoopControlName(), + $manager : ControlLoopEventManager2Drools( closedLoopControlName == $event.getClosedLoopControlName(), getContext().getEvent() == $event ) then @@ -224,7 +224,7 @@ end */ rule "EVENT.MANAGER.PROCESSING" when - $manager : ControlLoopEventManager2( isUpdated(), isActive(), $notification : getNotification() ) + $manager : ControlLoopEventManager2Drools( isUpdated(), isActive(), $notification : getNotification() ) then Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage()); @@ -271,7 +271,7 @@ end */ rule "EVENT.MANAGER.FINAL" when - $manager : ControlLoopEventManager2( !isActive(), $notification : getNotification() ) + $manager : ControlLoopEventManager2Drools( !isActive(), $notification : getNotification() ) then Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage()); -- cgit 1.2.3-korg