diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceDetailsRetrieverTask.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceDetailsRetrieverTask.java index 7dc2d97079..4a8ace7bbd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceDetailsRetrieverTask.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/task/impl/DeviceDetailsRetrieverTask.java @@ -66,11 +66,9 @@ public class DeviceDetailsRetrieverTask implements Task { if(executeForTenants){ this.executeForAllTenants(); } else { - if (log.isDebugEnabled()) { log.debug("Device details retrieving task started to run."); } - DeviceTaskManager deviceTaskManager = new DeviceTaskManagerImpl(deviceType, operationMonitoringTaskConfig); //pass the configurations also from here, monitoring tasks @@ -78,13 +76,11 @@ public class DeviceDetailsRetrieverTask implements Task { deviceTaskManager.addOperations(); } catch (DeviceMgtTaskException e) { log.error( - "Error occurred while trying to add the operations to device to retrieve device details.", - e); + "Error occurred while trying to add the operations to device to retrieve device details.", e); } } } - private void executeForAllTenants() { if (log.isDebugEnabled()) { @@ -119,7 +115,6 @@ public class DeviceDetailsRetrieverTask implements Task { log.error("Error occurred while trying to get the available tenants " + "from device manager provider service.", e); } - } } diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/task/MonitoringTask.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/task/MonitoringTask.java index 0656343019..3be4e2a562 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/task/MonitoringTask.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/task/MonitoringTask.java @@ -88,7 +88,6 @@ public class MonitoringTask implements Task { return false; } - private void executeforAllTenants() { if (log.isDebugEnabled()) { @@ -104,9 +103,7 @@ public class MonitoringTask implements Task { PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(tenant); - this.executeTask(); - } finally { PrivilegedCarbonContext.endTenantFlow(); } @@ -116,10 +113,8 @@ public class MonitoringTask implements Task { } catch (DeviceManagementException e) { log.error("Error occurred while trying to get the available tenants from device manager service ", e); } - } - private void executeTask(){ MonitoringManager monitoringManager = PolicyManagementDataHolder.getInstance().getMonitoringManager();