@Override public void run() { ((EntityInternal)application).destroy(); mgmt.getEntityManager().unmanage(application); } });
@Override public void run() { ((EntityInternal)application).destroy(); mgmt.getEntityManager().unmanage(application); } });
/** stops, destroys, and unmanages the given entity -- does as many as are valid given the type and state */ public static void destroy(Entity e) { if (isManaged(e)) { if (e instanceof Startable) Entities.invokeEffector((EntityLocal)e, e, Startable.STOP).getUnchecked(); if (e instanceof EntityInternal) ((EntityInternal)e).destroy(); unmanage(e); log.debug("destroyed and unmanaged "+e+"; mgmt now "+ (e.getApplicationId()==null ? "(no app)" : e.getApplication().getManagementContext())+" - managed? "+isManaged(e)); } else { log.debug("skipping destroy of "+e+": not managed"); } }