Code refactor

apim420
Rajitha Kumara 2 years ago
parent 4c2a02fdf0
commit 9c9c391fd4

@ -18,6 +18,9 @@
package io.entgra.tenant.mgt.common.exception;
public class TenantMgtException extends Exception {
private static final long serialVersionUID = 4304028531230841553L;
public TenantMgtException(String msg, Throwable ex) {
super(msg, ex);
}

@ -61,9 +61,14 @@ public class TenantMgtServiceComponent {
whiteLabelManagementService, null);
TenantMgtDataHolder.getInstance().setWhiteLabelManagementService(whiteLabelManagementService);
DeviceMgtTenantListener deviceMgtTenantListener = new DeviceMgtTenantListener();
if(log.isDebugEnabled()) {
log.info("Tenant management listener is registering");
}
componentContext.getBundleContext().
registerService(TenantMgtListener.class.getName(), deviceMgtTenantListener, null);
if(log.isDebugEnabled()) {
log.info("Tenant management service activated");
}
} catch (Throwable t) {
String msg = "Error occurred while activating tenant management service";
log.error(msg, t);
@ -76,18 +81,30 @@ public class TenantMgtServiceComponent {
}
protected void setApplicationManager(ApplicationManager applicationManager) {
if(log.isDebugEnabled()) {
log.info("Application manager service is binding");
}
TenantMgtDataHolder.getInstance().setApplicationManager(applicationManager);
}
protected void unsetApplicationManager(ApplicationManager applicationManager) {
if(log.isDebugEnabled()) {
log.info("Application manager service is unbinding");
}
TenantMgtDataHolder.getInstance().setApplicationManager(null);
}
protected void setRealmService(RealmService realmService) {
if(log.isDebugEnabled()) {
log.info("Realm Service service is binding");
}
TenantMgtDataHolder.getInstance().setRealmService(realmService);
}
protected void unsetRealmService(RealmService realmService) {
if(log.isDebugEnabled()) {
log.info("Realm Service service is unbinding");
}
TenantMgtDataHolder.getInstance().setRealmService(null);
}
}

Loading…
Cancel
Save