From e5704ac05dab7dd12cbe8e2c1a14ecedcfb11dec Mon Sep 17 00:00:00 2001 From: sinthuja Date: Wed, 14 Jun 2017 16:10:54 +0530 Subject: [PATCH] Using the platformManger service instead of using the DAO. --- .../application/mgt/core/impl/ApplicationManagerImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java index 45dcae7c97..4cc2ce7fa9 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java @@ -23,12 +23,14 @@ import org.wso2.carbon.device.application.mgt.common.*; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; +import org.wso2.carbon.device.application.mgt.common.services.PlatformManager; import org.wso2.carbon.device.application.mgt.core.dao.ApplicationDAO; import org.wso2.carbon.device.application.mgt.core.dao.LifecycleStateDAO; import org.wso2.carbon.device.application.mgt.core.dao.PlatformDAO; import org.wso2.carbon.device.application.mgt.core.dao.common.DAOFactory; import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; import org.wso2.carbon.device.application.mgt.core.exception.ValidationException; +import org.wso2.carbon.device.application.mgt.core.internal.DataHolder; import org.wso2.carbon.device.application.mgt.core.util.ConnectionManagerUtil; import org.wso2.carbon.device.application.mgt.core.util.HelperUtil; @@ -66,9 +68,9 @@ public class ApplicationManagerImpl implements ApplicationManager { lifecycle.setGetLifecycleStateModifiedBy(application.getUser().getUserName()); application.setCurrentLifecycle(lifecycle); - PlatformDAO platformDAO = DAOFactory.getPlatformDAO(); - Platform platform = platformDAO.getPlatform(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(true), - application.getPlatform().getIdentifier()); + PlatformManager platformManager = DataHolder.getInstance().getPlatformManager(); + Platform platform = platformManager.getPlatform(PrivilegedCarbonContext.getThreadLocalCarbonContext(). + getTenantDomain(true), application.getPlatform().getIdentifier()); if (platform == null) { throw new NotFoundException("Invalid platform"); }