*/
void doRedeploy() {
notifyListeners(new SLAPolicyEvent(this,
getSLA(),
Action.REDEPLOY_PENDING.name()));
ServiceBeanManager mgr = context.getServiceBeanManager();
try {
mgr.getOperationalStringManager().redeploy(context.getServiceElement(),
mgr.getServiceBeanInstance(),
false,
true,
0,
null);
} catch (OperationalStringException e) {
notifyListeners(new SLAPolicyEvent(this,
getSLA(),
Action.REDEPLOY_FAILURE.name()));
if(!e.isManaged()) {
logger.warn("Attempt to redeploy service [{}] failed, it is not under management control. Terminating the service.",
context.getServiceElement().getName());
try {
Administrable admin =
(Administrable)mgr.getServiceBeanInstance().getService();
DestroyAdmin dAdmin = (DestroyAdmin) admin.getAdmin();
dAdmin.destroy();
} catch(Exception ex) {
logger.error("Unable to destroy service ["+context.getServiceElement().getName()+"] ", ex);
}