diff --git a/pom.xml b/pom.xml index 93e9738ce..2407281cd 100644 --- a/pom.xml +++ b/pom.xml @@ -14,8 +14,8 @@ - 2.2.15 - 2.2.14 + 2.2.16-SNAPSHOT + 2.2.15 UTF-8 1.8 3.0 diff --git a/sofa-ark-parent/core-impl/container/src/main/java/com/alipay/sofa/ark/container/model/BizModel.java b/sofa-ark-parent/core-impl/container/src/main/java/com/alipay/sofa/ark/container/model/BizModel.java index dbc409837..d157a7b45 100644 --- a/sofa-ark-parent/core-impl/container/src/main/java/com/alipay/sofa/ark/container/model/BizModel.java +++ b/sofa-ark-parent/core-impl/container/src/main/java/com/alipay/sofa/ark/container/model/BizModel.java @@ -421,7 +421,7 @@ public void stop() { BizManagerService bizManagerService = ArkServiceContainerHolder.getContainer() .getService(BizManagerService.class); bizManagerService.unRegisterBiz(bizName, bizVersion); - setBizState(BizState.UNRESOLVED, StateChangeReason.STOPPED); + setBizState(BizState.STOPPED, StateChangeReason.STOPPED); eventAdminService.sendEvent(new BeforeBizRecycleEvent(this)); urls = null; denyImportPackages = null; diff --git a/sofa-ark-parent/core-impl/container/src/test/java/com/alipay/sofa/ark/container/model/BizModelTest.java b/sofa-ark-parent/core-impl/container/src/test/java/com/alipay/sofa/ark/container/model/BizModelTest.java index dcf86a811..38ff3d0fd 100644 --- a/sofa-ark-parent/core-impl/container/src/test/java/com/alipay/sofa/ark/container/model/BizModelTest.java +++ b/sofa-ark-parent/core-impl/container/src/test/java/com/alipay/sofa/ark/container/model/BizModelTest.java @@ -145,7 +145,7 @@ public void testStopFailedWithClean() { bizModel.stop(); } catch (RuntimeException e) { } - assertEquals(BizState.UNRESOLVED, bizModel.getBizState()); + assertEquals(BizState.STOPPED, bizModel.getBizState()); } bizModel.setBizState(BizState.ACTIVATED); @@ -186,7 +186,7 @@ public void testStopSucceedWithClean() { mockedStatic.when(ArkServiceContainerHolder::getContainer).thenReturn(arkServiceContainer); bizModel.stop(); - assertEquals(BizState.UNRESOLVED, bizModel.getBizState()); + assertEquals(BizState.STOPPED, bizModel.getBizState()); } bizModel.setBizState(BizState.ACTIVATED); @@ -201,7 +201,7 @@ public void testStopSucceedWithClean() { mockedStatic.when(ArkServiceContainerHolder::getContainer).thenReturn(arkServiceContainer); bizModel.stop(); - assertEquals(BizState.UNRESOLVED, bizModel.getBizState()); + assertEquals(BizState.STOPPED, bizModel.getBizState()); } finally { ArkConfigs.putStringValue(AUTO_UNINSTALL_WHEN_FAILED_ENABLE, "true"); } diff --git a/sofa-ark-parent/core/spi/src/main/java/com/alipay/sofa/ark/spi/model/BizState.java b/sofa-ark-parent/core/spi/src/main/java/com/alipay/sofa/ark/spi/model/BizState.java index bc7e5e7fe..8df894378 100644 --- a/sofa-ark-parent/core/spi/src/main/java/com/alipay/sofa/ark/spi/model/BizState.java +++ b/sofa-ark-parent/core/spi/src/main/java/com/alipay/sofa/ark/spi/model/BizState.java @@ -24,9 +24,7 @@ */ public enum BizState { /** - * init but not start install yet - * or - * uninstalled + * not init or not start install yet */ UNRESOLVED("unresolved"), /** @@ -45,9 +43,14 @@ public enum BizState { DEACTIVATED("deactivated"), /** - * install failed. + * install or uninstall failed. */ - BROKEN("broken"); + BROKEN("broken"), + + /** + * uninstall succeed + */ + STOPPED("stopped"); private String state; @@ -73,6 +76,8 @@ public static BizState of(String state) { return ACTIVATED; } else if (DEACTIVATED.name().equalsIgnoreCase(state)) { return DEACTIVATED; + } else if (STOPPED.name().equalsIgnoreCase(state)) { + return STOPPED; } else { return BROKEN; }