cancelDecrementTask();
/* If we have pending increment tasks, trim them up. Make sure however
* that we are not trimming pending requests that will drop the
* minServices and/or maintain value below what has been declared */
OperationalStringManager opMgr = context.getServiceBeanManager().
getOperationalStringManager();
int pendingCount = getPendingRequestCount(opMgr);
logger.trace("[{}] ScalingPolicyHandler [{}] totalServices={}, pendingCount={}, pendingRequests={}, planned={}",
getName(), getID(), totalServices, pendingCount, pendingRequests, getServiceElement().getPlanned());
if(((totalServices+pendingCount)+pendingRequests) >
getServiceElement().getPlanned()) {
try {
int numTrimmed = opMgr.trim(getServiceElement(), pendingRequests);
logger.trace("[{}] numTrimmed={}", getID(), numTrimmed);
} catch(NoSuchObjectException e) {
logger.warn("Remote manager decomissioned for [{}] ScalingPolicyHandler [{}], force disconnect",
getName(), getID());
disconnect();