From 0acf34ae513a4812851cb6da52308a9c216780a7 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Mon, 15 Dec 2014 09:57:24 +0530 Subject: [PATCH] Fixing DAOFactory initialzation related issues --- .../wso2/carbon/device/mgt/common/Device.java | 23 +++++++++++ .../carbon/device/mgt/common/Property.java | 39 ------------------- .../DeviceManagementServiceComponent.java | 6 +-- 3 files changed, 26 insertions(+), 42 deletions(-) delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Property.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Device.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Device.java index 8675c8af89..cb0b2ebad7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Device.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Device.java @@ -149,4 +149,27 @@ public class Device { public void setProperties(List properties) { this.properties = properties; } + + public static class Property { + + private String name; + private String value; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + } + } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Property.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Property.java deleted file mode 100644 index 399ee67077..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Property.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.wso2.carbon.device.mgt.common; - -public class Property { - - private String name; - private String value; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java index 9fa547c87d..85ae3ec4e5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java @@ -58,12 +58,12 @@ public class DeviceManagementServiceComponent { DeviceManagementConfig config = DeviceConfigurationManager.getInstance().getDeviceManagementConfig(); - DeviceManager deviceManager = new DeviceManager(config, this.getPluginRepository()); - DeviceManagementDataHolder.getInstance().setDeviceManager(deviceManager); - DataSourceConfig dsConfig = config.getDeviceMgtRepository().getDataSourceConfig(); DeviceManagementDAOFactory.init(dsConfig); + DeviceManager deviceManager = new DeviceManager(config, this.getPluginRepository()); + DeviceManagementDataHolder.getInstance().setDeviceManager(deviceManager); + /* If -Dsetup option enabled then create device management database schema */ String setupOption = System.getProperty("setup"); if (setupOption != null) {