ClusterId clusterId = getClusterId();
ClusterAccessor clusterAccessor = getConnection().createClusterAccessor(clusterId);
ResourceId resourceId = ResourceId.from(_serviceName);
Resource resource = clusterAccessor.readResource(resourceId);
UserConfig userConfig = resource.getUserConfig();
ServiceConfig serviceConfig = new ServiceConfig(Scope.resource(resourceId));
serviceConfig.setSimpleFields(userConfig.getSimpleFields());
serviceConfig.setListFields(userConfig.getListFields());
serviceConfig.setMapFields(userConfig.getMapFields());
LOG.info("Starting service:" + _serviceName + " with configuration:" + serviceConfig);
StatelessServiceStateModelFactory stateModelFactory =
new StatelessServiceStateModelFactory(this);
getParticipant().getStateMachineEngine().registerStateModelFactory(
StateModelDefId.from("StatelessService"), stateModelFactory);