@Override public PrimaryBackupServer build() { Logger log = ContextualLoggerFactory.getLogger(PrimaryBackupServer.class, LoggerContext.builder(PrimaryBackupServer.class) .addValue(serverName) .build()); // If a ThreadContextFactory was not provided, create one and ensure it's closed when the server is stopped. boolean closeOnStop; ThreadContextFactory threadContextFactory; if (this.threadContextFactory == null) { threadContextFactory = threadModel.factory("backup-server-" + serverName + "-%d", threadPoolSize, log); closeOnStop = true; } else { threadContextFactory = this.threadContextFactory; closeOnStop = false; } return new PrimaryBackupServer(new PrimaryBackupServerContext( serverName, membershipService, new DefaultMemberGroupService(membershipService, memberGroupProvider), protocol, primitiveTypes != null ? primitiveTypes : new ClasspathScanningPrimitiveTypeRegistry(Thread.currentThread().getContextClassLoader()), primaryElection, threadContextFactory, closeOnStop)); } }
serverName, membershipService, new DefaultMemberGroupService(membershipService, memberGroupProvider), protocol, primaryElection,
serverName, membershipService, new DefaultMemberGroupService(membershipService, memberGroupProvider), protocol, primaryElection,