@Override public void run() { ((EntityInternal)application).destroy(); mgmt.getEntityManager().unmanage(application); } });
@Override public void run() { if (release) Entities.destroyCatching(entity); else mgmt.getEntityManager().unmanage(entity); } });
public static void unmanage(Entity entity) { if (((EntityInternal)entity).getManagementSupport().isDeployed()) { ((EntityInternal)entity).getManagementContext().getEntityManager().unmanage(entity); } }
getEntityManager().unmanage(this);
@Test(groups="Broken") public void testStartsThenChildFailsButWithQuorumCausesAppToSucceed() throws Exception { TestApplication app = mgmt.getEntityManager().createEntity(EntitySpec.create(TestApplication.class) .configure(StartableApplication.UP_QUORUM_CHECK, QuorumCheck.QuorumChecks.atLeastOne()) .configure(StartableApplication.RUNNING_QUORUM_CHECK, QuorumCheck.QuorumChecks.atLeastOne()) .child(EntitySpec.create(TestEntity.class)) .child(EntitySpec.create(TestEntity.class))); TestEntity child = (TestEntity) Iterables.get(app.getChildren(), 0); app.start(ImmutableList.<Location>of()); assertUpAndRunningEventually(app); for (Entity childr : app.getChildren()) { EntityAsserts.assertAttributeEquals(childr, TestEntity.SERVICE_STATE_ACTUAL, Lifecycle.RUNNING); } ServiceStateLogic.ServiceNotUpLogic.updateNotUpIndicator(child, "myIndicator", "Simulate not-up of child"); assertHealthContinually(app, Lifecycle.RUNNING, true); mgmt.getEntityManager().unmanage(app); }