Fixing DAOFactory initialzation related issues

revert-dabc3590
prabathabey 10 years ago
parent 172ab10ac0
commit 0acf34ae51

@ -149,4 +149,27 @@ public class Device {
public void setProperties(List<Property> properties) { public void setProperties(List<Property> properties) {
this.properties = 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;
}
}
} }

@ -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;
}
}

@ -58,12 +58,12 @@ public class DeviceManagementServiceComponent {
DeviceManagementConfig config = DeviceConfigurationManager.getInstance().getDeviceManagementConfig(); DeviceManagementConfig config = DeviceConfigurationManager.getInstance().getDeviceManagementConfig();
DeviceManager deviceManager = new DeviceManager(config, this.getPluginRepository());
DeviceManagementDataHolder.getInstance().setDeviceManager(deviceManager);
DataSourceConfig dsConfig = config.getDeviceMgtRepository().getDataSourceConfig(); DataSourceConfig dsConfig = config.getDeviceMgtRepository().getDataSourceConfig();
DeviceManagementDAOFactory.init(dsConfig); DeviceManagementDAOFactory.init(dsConfig);
DeviceManager deviceManager = new DeviceManager(config, this.getPluginRepository());
DeviceManagementDataHolder.getInstance().setDeviceManager(deviceManager);
/* If -Dsetup option enabled then create device management database schema */ /* If -Dsetup option enabled then create device management database schema */
String setupOption = System.getProperty("setup"); String setupOption = System.getProperty("setup");
if (setupOption != null) { if (setupOption != null) {

Loading…
Cancel
Save