Code refactor

app-icon-change
Rajitha Kumara 2 years ago
parent 4c2a02fdf0
commit 9c9c391fd4

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

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

Loading…
Cancel
Save