public RaftServiceContext(
PrimitiveId primitiveId,
String serviceName,
PrimitiveType primitiveType,
ServiceConfig config,
PrimitiveService service,
RaftContext raft,
ThreadContextFactory threadContextFactory) {
this.primitiveId = checkNotNull(primitiveId);
this.serviceName = checkNotNull(serviceName);
this.primitiveType = checkNotNull(primitiveType);
this.config = checkNotNull(config);
this.service = checkNotNull(service);
this.raft = checkNotNull(raft);
this.sessions = raft.getSessions();
this.threadContextFactory = threadContextFactory;
this.log = ContextualLoggerFactory.getLogger(getClass(), LoggerContext.builder(PrimitiveService.class)
.addValue(primitiveId)
.add("type", primitiveType)
.add("name", serviceName)
.build());
service.init(this);
}