Add listner to Data source service

revert-70aa11f8
manoj 10 years ago
parent 105bc2c6cf
commit 9a1ffa6ab7

@ -80,7 +80,8 @@
org.wso2.carbon.apimgt.api.model, org.wso2.carbon.apimgt.api.model,
org.wso2.carbon.apimgt.impl, org.wso2.carbon.apimgt.impl,
org.wso2.carbon.identity.oauth.stub, org.wso2.carbon.identity.oauth.stub,
org.wso2.carbon.identity.oauth.stub.dto org.wso2.carbon.identity.oauth.stub.dto,
org.wso2.carbon.ndatasource.core
</Import-Package> </Import-Package>
<Export-Package> <Export-Package>
!org.wso2.carbon.device.mgt.core.internal, !org.wso2.carbon.device.mgt.core.internal,
@ -132,6 +133,10 @@
<groupId>org.wso2.carbon</groupId> <groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.core</artifactId> <artifactId>org.wso2.carbon.core</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.ndatasource.core</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.h2database.wso2</groupId> <groupId>com.h2database.wso2</groupId>
<artifactId>h2-database-engine</artifactId> <artifactId>h2-database-engine</artifactId>

@ -50,6 +50,7 @@ import org.wso2.carbon.device.mgt.core.service.AppManager;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementService; import org.wso2.carbon.device.mgt.core.service.DeviceManagementService;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementServiceImpl; import org.wso2.carbon.device.mgt.core.service.DeviceManagementServiceImpl;
import org.wso2.carbon.device.mgt.core.util.DeviceManagementSchemaInitializer; import org.wso2.carbon.device.mgt.core.util.DeviceManagementSchemaInitializer;
import org.wso2.carbon.ndatasource.core.DataSourceService;
import org.wso2.carbon.registry.core.service.RegistryService; import org.wso2.carbon.registry.core.service.RegistryService;
import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.user.core.service.RealmService;
@ -82,6 +83,12 @@ import java.util.List;
* policy="dynamic" * policy="dynamic"
* bind="setAPIManagerConfigurationService" * bind="setAPIManagerConfigurationService"
* unbind="unsetAPIManagerConfigurationService" * unbind="unsetAPIManagerConfigurationService"
* @scr.reference name="org.wso2.carbon.ndatasource"
* interface="org.wso2.carbon.ndatasource.core.DataSourceService"
* cardinality="1..1"
* policy="dynamic"
* bind="setDataSourceService"
* unbind="unsetDataSourceService"
*/ */
public class DeviceManagementServiceComponent { public class DeviceManagementServiceComponent {
@ -312,4 +319,15 @@ public class DeviceManagementServiceComponent {
//do nothing //do nothing
} }
protected void setDataSourceService(DataSourceService dataSourceService) {
/* This is to avoid mobile device management component getting initialized before the underlying datasources
are registered */
if (log.isDebugEnabled()) {
log.debug("Data source service set to mobile service component");
}
}
protected void unsetDataSourceService(DataSourceService dataSourceService) {
//do nothing
}
} }

@ -574,6 +574,12 @@
<version>${carbon.commons.version}</version> <version>${carbon.commons.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.ndatasource.core</artifactId>
<version>${carbon.kernel.version}</version>
</dependency>
<!-- API Management dependencies --> <!-- API Management dependencies -->
<dependency> <dependency>
<groupId>org.wso2.carbon.apimgt</groupId> <groupId>org.wso2.carbon.apimgt</groupId>

Loading…
Cancel
Save