diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventConfigurationProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventConfigurationProviderServiceImpl.java index d9acfa2c371..75e0439074f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventConfigurationProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventConfigurationProviderServiceImpl.java @@ -46,13 +46,11 @@ import java.util.concurrent.Executors; public class EventConfigurationProviderServiceImpl implements EventConfigurationProviderService { private static final Log log = LogFactory.getLog(EventConfigurationProviderServiceImpl.class); private final EventConfigDAO eventConfigDAO; - private final ExecutorService executorService; public EventConfigurationProviderServiceImpl() { eventConfigDAO = DeviceManagementDAOFactory.getEventConfigDAO(); EventOperationTaskConfiguration eventConfig = DeviceConfigurationManager.getInstance() .getDeviceManagementConfig().getEventOperationTaskConfiguration(); - this.executorService = Executors.newFixedThreadPool(eventConfig.getPoolSize()); } @Override @@ -251,6 +249,7 @@ public class EventConfigurationProviderServiceImpl implements EventConfiguration List groupIds) { GeoFenceEventOperationManager geoFenceEventOperationManager = new GeoFenceEventOperationManager(eventType, tenantId, null); EventOperationExecutor executor = geoFenceEventOperationManager.getEventOperationExecutor(groupIds, eventMeta); - this.executorService.submit(executor); + ExecutorService executorService = Executors.newFixedThreadPool(50); + executorService.submit(executor); } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventOperationTaskConfiguration.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventOperationTaskConfiguration.java index ac6a350d94a..a9fa405bf73 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventOperationTaskConfiguration.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/EventOperationTaskConfiguration.java @@ -32,13 +32,4 @@ public class EventOperationTaskConfiguration { public void setEnabled(boolean enabled) { this.isEnabled = enabled; } - - @XmlElement(name = "PoolSize", required = true) - public int getPoolSize() { - return poolSize; - } - - public void setPoolSize(int poolSize) { - this.poolSize = poolSize; - } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceImpl.java index 59a552c1139..1e19cbb42ba 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceImpl.java @@ -66,7 +66,6 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid private final GroupDAO groupDAO; private final DeviceDAO deviceDAO; - private final ExecutorService executorService; /** * Set groupDAO from GroupManagementDAOFactory when class instantiate. @@ -74,9 +73,6 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid public GroupManagementProviderServiceImpl() { this.groupDAO = GroupManagementDAOFactory.getGroupDAO(); this.deviceDAO = DeviceManagementDAOFactory.getDeviceDAO(); - EventOperationTaskConfiguration eventConfig = DeviceConfigurationManager.getInstance() - .getDeviceManagementConfig().getEventOperationTaskConfiguration(); - this.executorService = Executors.newFixedThreadPool(eventConfig.getPoolSize()); } /** @@ -1072,6 +1068,7 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid GeoFenceEventOperationManager eventManager = new GeoFenceEventOperationManager(eventOperationCode, tenantId, null); GroupAssignmentEventOperationExecutor eventOperationExecutor = eventManager .getGroupAssignmentEventExecutor(groupId, deviceIdentifiers); + ExecutorService executorService = Executors.newFixedThreadPool(50); if (eventOperationExecutor != null) { executorService.submit(eventOperationExecutor); } else { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml index 723662a8cda..675a58e80da 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml @@ -97,6 +97,9 @@ server environment--> 10000 + + true + false 86400 diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml index df2f0612414..51780af1fb7 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml @@ -121,6 +121,9 @@ false + + true + false false diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml index 1a313a50ba9..bbbd8511d40 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml @@ -96,8 +96,6 @@ true - - 50 true