internal ClusteredServiceAgent(ClusteredServiceContainer.Context ctx) { this.ctx = ctx; archiveCtx = ctx.ArchiveContext(); aeron = ctx.Aeron(); shouldCloseResources = ctx.OwnsAeronClient(); service = ctx.ClusteredService(); recordingLog = ctx.RecordingLog(); idleStrategy = ctx.IdleStrategy(); serviceId = ctx.ServiceId(); epochClock = ctx.EpochClock(); markFile = ctx.MarkFile(); serviceControlPublisher = new ServiceControlPublisher( aeron.AddPublication(ctx.ServiceControlChannel(), ctx.ServiceControlStreamId()) ); serviceControlAdapter = new ServiceControlAdapter( aeron.AddSubscription(ctx.ServiceControlChannel(), ctx.ServiceControlStreamId()), this ); }