Fix error log printed when undeploying the devicemgt provider

Resolves https://github.com/wso2/product-iots/issues/1724

(cherry picked from commit c72d4ea)
revert-70aa11f8
Rasika Perera 7 years ago
parent 6b99197b54
commit 7ad790be54

@ -23,6 +23,7 @@ import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.DeviceStatusTaskPluginConfig; import org.wso2.carbon.device.mgt.common.DeviceStatusTaskPluginConfig;
import org.wso2.carbon.device.mgt.common.InvalidConfigurationException;
import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig; import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig;
import org.wso2.carbon.device.mgt.common.ProvisioningConfig; import org.wso2.carbon.device.mgt.common.ProvisioningConfig;
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManager; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManager;
@ -153,10 +154,14 @@ public class DeviceManagementPluginRepository implements DeviceManagerStartupLis
OperationManager operationManager = operationManagerRepository.getOperationManager( OperationManager operationManager = operationManagerRepository.getOperationManager(
deviceTypeIdentifier); deviceTypeIdentifier);
if (operationManager != null) { if (operationManager != null) {
try {
NotificationStrategy notificationStrategy = operationManager.getNotificationStrategy(); NotificationStrategy notificationStrategy = operationManager.getNotificationStrategy();
if (notificationStrategy != null) { if (notificationStrategy != null) {
notificationStrategy.undeploy(); notificationStrategy.undeploy();
} }
} catch (InvalidConfigurationException ignore) {
//error occurred while undeploying strategy, ignore error
}
operationManagerRepository.removeOperationManager(deviceTypeIdentifier); operationManagerRepository.removeOperationManager(deviceTypeIdentifier);
} }
} }

Loading…
Cancel
Save