Save OperationStartupHandler in data holder

11788^2
Pasindu Rupasinghe 2 months ago
parent c37cf31ffe
commit f59208f6e7

@ -100,6 +100,7 @@ public class DeviceManagementDataHolder {
private DeviceStatusManagementService deviceStatusManagementService; private DeviceStatusManagementService deviceStatusManagementService;
private APIApplicationServices apiApplicationServices; private APIApplicationServices apiApplicationServices;
private PublisherRESTAPIServices publisherRESTAPIServices; private PublisherRESTAPIServices publisherRESTAPIServices;
private OperationStartupHandler operationStartupHandler;
private final Map<DeviceType, DeviceStatusTaskPluginConfig> deviceStatusTaskPluginConfigs = Collections.synchronizedMap( private final Map<DeviceType, DeviceStatusTaskPluginConfig> deviceStatusTaskPluginConfigs = Collections.synchronizedMap(
new HashMap<>()); new HashMap<>());
@ -457,4 +458,12 @@ public class DeviceManagementDataHolder {
public void setGroupAccessAuthorizationService(GroupAccessAuthorizationService groupAccessAuthorizationService) { public void setGroupAccessAuthorizationService(GroupAccessAuthorizationService groupAccessAuthorizationService) {
this.groupAccessAuthorizationService = groupAccessAuthorizationService; this.groupAccessAuthorizationService = groupAccessAuthorizationService;
} }
public OperationStartupHandler getOperationStartupHandler() {
return operationStartupHandler;
}
public void setOperationStartupHandler(OperationStartupHandler operationStartupHandler) {
this.operationStartupHandler = operationStartupHandler;
}
} }

@ -262,7 +262,9 @@ public class DeviceManagementServiceComponent {
UserRoleCreateObserver userRoleCreateObserver = new UserRoleCreateObserver(); UserRoleCreateObserver userRoleCreateObserver = new UserRoleCreateObserver();
bundleContext.registerService(ServerStartupObserver.class.getName(), userRoleCreateObserver, null); bundleContext.registerService(ServerStartupObserver.class.getName(), userRoleCreateObserver, null);
/* Registering Device Operation Management Startup Handler */
OperationStartupHandler operationStartupHandler = new OperationStartupHandler(); OperationStartupHandler operationStartupHandler = new OperationStartupHandler();
DeviceManagementDataHolder.getInstance().setOperationStartupHandler(operationStartupHandler);
bundleContext.registerService(ServerStartupObserver.class.getName(), operationStartupHandler, null); bundleContext.registerService(ServerStartupObserver.class.getName(), operationStartupHandler, null);
/* Registering Device Management Service */ /* Registering Device Management Service */

Loading…
Cancel
Save