Merge pull request #1202 from rasika/fix-1724

Fix the issue of an error printed when shutting down the IoT Server
merge-requests/1/head
Rasika Perera 7 years ago committed by GitHub
commit 88e1b925bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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;
@ -167,10 +168,14 @@ public class DeviceManagementPluginRepository implements DeviceManagerStartupLis
} }
} }
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