public void stop() { LOG.debug("Stopping drools session and removing all rules."); final KieSession activeSession = session.getAndSet(null); if (activeSession != null) { activeSession.dispose(); } if (currentReleaseId != null) { kieServices.getRepository().removeKieModule(currentReleaseId); } }
private boolean commitRules() { final ReleaseId previousReleaseId = currentReleaseId; final ReleaseId newReleaseId = nextRulesPackageVersion(); LOG.debug("Committing rules as version {}", newReleaseId); final boolean deployed = deployRules(newReleaseId); if (deployed && previousReleaseId != null) { kieServices.getRepository().removeKieModule(previousReleaseId); } return deployed; }
@Override public void onDispose(RuntimeEngine runtime) { try { scanner.stop(); scanner.shutdown(); } catch (Throwable t) { CommonKnowledgeLogger.ROOT_LOGGER.problemStopppingKieScanner(t.getMessage()); } finally { if (releaseId != null) { // fix for SWITCHYARD-2241 _kieServices.getRepository().removeKieModule(releaseId); } } } });
@Override public void onDispose(RuntimeEngine runtime) { try { scanner.stop(); scanner.shutdown(); } catch (Throwable t) { CommonKnowledgeLogger.ROOT_LOGGER.problemStopppingKieScanner(t.getMessage()); } finally { if (releaseId != null) { // fix for SWITCHYARD-2241 _kieServices.getRepository().removeKieModule(releaseId); } } } });
if (KieServices.Factory.get().getRepository().removeKieModule(releaseIdForContainerUsedByKieSession) != null) { LOG.info("Successfully removed previous KIE module with ID: {}.", releaseIdForContainerUsedByKieSession); } else {
if (KieServices.Factory.get().getRepository().removeKieModule(releaseIdForContainerUsedByKieSession) != null) { LOG.info("Successfully removed previous KIE module with ID: {}.", releaseIdForContainerUsedByKieSession); } else {
ks.getRepository().removeKieModule(releaseId); logger.info("Container {} (for release id {}) successfully stopped", containerId, kci.getResource().getReleaseId());
ks.getRepository().removeKieModule(originalReleaseId);
@Test public void testSpringKieImportReleaseId() throws Exception { KieServices ks = KieServices.Factory.get(); //step 1: deploy the test module to MAVEN Repo createAndInstallModule( ks, FIRST_VALUE ); //step 2: load the spring context createSpringContext(); //step 3: check the basic spring objects lookupReleaseId(); lookupNamedKieBase(); //step 4: cleanup. Remove the module ks.getRepository().removeKieModule(releaseId); }
@Test public void testSpringKieImportReleaseId() throws Exception { KieServices ks = KieServices.Factory.get(); //step 1: deploy the test module to MAVEN Repo createAndInstallModule( ks, FIRST_VALUE ); //step 2: load the spring context createSpringContext(); //step 3: check the basic spring objects lookupReleaseId(); lookupNamedKieBase(); //step 4: cleanup. Remove the module ks.getRepository().removeKieModule(releaseId); }
@Test public void testBlueprintKieScanner() throws Exception { KieServices ks = KieServices.Factory.get(); KieMavenRepository repository = createAndInstallModule( ks, FIRST_VALUE ); container = createContainer(); checkForValue(FIRST_VALUE); reinstallModule( repository, ks ); KieScanner kscanner = (KieScanner)container.getComponentInstance( "blueprint-scanner-releaseId-scanner" ); kscanner.scanNow(); checkForValue(SECOND_VALUE); ks.getRepository().removeKieModule(releaseId); }
@Test public void testSpringKieScanner() throws Exception { KieServices ks = KieServices.Factory.get(); //step 1: deploy the test module to MAVEN Repo KieMavenRepository repository = createAndInstallModule( ks, FIRST_VALUE ); //step 2: load the spring context createSpringContext(); //step 3: check the basic spring objects lookupNamedKieBase(); lookupReleaseId(); lookupReleaseIdScanner(); //step 4: test the value checkForValue(FIRST_VALUE); //step 5: reploy the module reinstallModule( repository, ks ); //step 6: force the kie-scanner to scan KieScanner releaseIdScanner = context.getBean("spring-scanner-releaseId#scanner", KieScanner.class); releaseIdScanner.scanNow(); //step 7: retest the value to ensure the scanner has picked up the new value checkForValue(SECOND_VALUE); //step 8: cleanup. Remove the module ks.getRepository().removeKieModule(releaseId); }
@Test public void testSpringKieScanner() throws Exception { KieServices ks = KieServices.Factory.get(); //step 1: deploy the test module to MAVEN Repo KieMavenRepository repository = createAndInstallModule( ks, FIRST_VALUE ); //step 2: load the spring context createSpringContext(); //step 3: check the basic spring objects lookupNamedKieBase(); lookupReleaseId(); lookupReleaseIdScanner(); //step 4: test the value checkForValue(FIRST_VALUE); //step 5: reploy the module reinstallModule( repository, ks ); //step 6: force the kie-scanner to scan KieScanner releaseIdScanner = context.getBean("spring-scanner-releaseId#scanner", KieScanner.class); releaseIdScanner.scanNow(); //step 7: retest the value to ensure the scanner has picked up the new value checkForValue(SECOND_VALUE); //step 8: cleanup. Remove the module ks.getRepository().removeKieModule(releaseId); }