コード例 #1
0
 /// <summary>
 /// Construct a <see cref="InstanceController"/>
 /// </summary>
 /// <param name="databaseContext">The <see cref="IDatabaseContext"/> for the <see cref="ApiController"/></param>
 /// <param name="authenticationContextFactory">The <see cref="IAuthenticationContextFactory"/> for the <see cref="ApiController"/></param>
 /// <param name="jobManager">The value of <see cref="jobManager"/></param>
 /// <param name="instanceManager">The value of <see cref="instanceManager"/></param>
 /// <param name="ioManager">The value of <see cref="ioManager"/></param>
 /// <param name="platformIdentifier">The value of <see cref="platformIdentifier"/></param>
 /// <param name="portAllocator">The value of <see cref="IPortAllocator"/>.</param>
 /// <param name="generalConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="generalConfiguration"/>.</param>
 /// <param name="swarmConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="swarmConfiguration"/>.</param>
 /// <param name="logger">The <see cref="ILogger"/> for the <see cref="ApiController"/>.</param>
 public InstanceController(
     IDatabaseContext databaseContext,
     IAuthenticationContextFactory authenticationContextFactory,
     IJobManager jobManager,
     IInstanceManager instanceManager,
     IIOManager ioManager,
     IPortAllocator portAllocator,
     IPlatformIdentifier platformIdentifier,
     IOptions <GeneralConfiguration> generalConfigurationOptions,
     IOptions <SwarmConfiguration> swarmConfigurationOptions,
     ILogger <InstanceController> logger)
     : base(
         databaseContext,
         authenticationContextFactory,
         logger,
         true)
 {
     this.jobManager         = jobManager ?? throw new ArgumentNullException(nameof(jobManager));
     this.instanceManager    = instanceManager ?? throw new ArgumentNullException(nameof(instanceManager));
     this.ioManager          = ioManager ?? throw new ArgumentNullException(nameof(ioManager));
     this.platformIdentifier = platformIdentifier ?? throw new ArgumentNullException(nameof(platformIdentifier));
     this.portAllocator      = portAllocator ?? throw new ArgumentNullException(nameof(portAllocator));
     generalConfiguration    = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions));
     swarmConfiguration      = swarmConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(swarmConfigurationOptions));
 }
コード例 #2
0
        public VlcDriver(IVlcStarter starter = null, IPortAllocator allocator = null, IVlcLocator locator = null, ILogger logger = null)
        {
            this.logger = logger;
            this.logger = this.logger ?? LogManager.GetCurrentClassLogger();

            Starter = starter ?? new VlcStarter(this.logger);

            Locator = locator ?? new VlcLocator();

            var portAllocator = allocator ?? new PortAllocator(this.logger)
            {
                StartPort = Properties.Settings.Default.StartPort
            };

            container = new WindsorContainer();
            container.Register(Component.For <VlcAudioJob>().LifestyleTransient());
            container.Register(Component.For <VlcVideoJob>().LifestyleTransient());
            container.Register(Component.For <IAudioConfiguration>().ImplementedBy <AudioConfiguration>().LifestyleTransient());
            container.Register(Component.For <IVideoConfiguration>().ImplementedBy <VideoConfiguration>().LifestyleTransient());

            container.Register(Component.For <IPortAllocator>().Instance(portAllocator));
            container.Register(Component.For <ILogger>().Instance(this.logger));

            container.Register(Component.For <IStatusParser>().ImplementedBy <StatusParser>().LifestyleTransient());
            container.Register(Component.For <IVlcStatusSource>().ImplementedBy <HttpVlcStatusSource>().LifestyleTransient());
            container.Register(Component.For <ITimeSouce>().ImplementedBy <TimeSouce>().LifestyleTransient());

            LogCurrentAssemblyInfo();
        }
コード例 #3
0
ファイル: VlcDriver.cs プロジェクト: jonlawley/VlcDriver
        public VlcDriver(IVlcStarter starter = null, IPortAllocator allocator = null, IVlcLocator locator = null, ILogger logger = null)
        {
            this.logger = logger;
            this.logger = this.logger ?? LogManager.GetCurrentClassLogger();

            Starter = starter ?? new VlcStarter(this.logger);

            Locator = locator ?? new VlcLocator();

            var portAllocator = allocator ?? new PortAllocator(this.logger){ StartPort = Properties.Settings.Default.StartPort };

            container = new WindsorContainer();
            container.Register(Component.For<VlcAudioJob>().LifestyleTransient());
            container.Register(Component.For<VlcVideoJob>().LifestyleTransient());
            container.Register(Component.For<IAudioConfiguration>().ImplementedBy<AudioConfiguration>().LifestyleTransient());
            container.Register(Component.For<IVideoConfiguration>().ImplementedBy<VideoConfiguration>().LifestyleTransient());

            container.Register(Component.For<IPortAllocator>().Instance(portAllocator));
            container.Register(Component.For<ILogger>().Instance(this.logger));

            container.Register(Component.For<IStatusParser>().ImplementedBy<StatusParser>().LifestyleTransient());
            container.Register(Component.For<IVlcStatusSource>().ImplementedBy<HttpVlcStatusSource>().LifestyleTransient());
            container.Register(Component.For<ITimeSouce>().ImplementedBy<TimeSouce>().LifestyleTransient());

            LogCurrentAssemblyInfo();
        }
コード例 #4
0
ファイル: VlcJob.cs プロジェクト: PlumpMath/VlcDriver
 protected VlcJob(IPortAllocator allocator, IStatusParser statusParser, IVlcStatusSource statusSource, ITimeSouce timeSouce, ILogger logger)
 {
     this.logger   = logger;
     PortAllocator = allocator;
     StatusParser  = statusParser;
     StatusSource  = statusSource;
     TimeSouce     = timeSouce;
 }
コード例 #5
0
ファイル: VlcJob.cs プロジェクト: jonlawley/VlcDriver
 protected VlcJob(IPortAllocator allocator, IStatusParser statusParser, IVlcStatusSource statusSource, ITimeSouce timeSouce, ILogger logger)
 {
     this.logger = logger;
     PortAllocator = allocator;
     StatusParser = statusParser;
     StatusSource = statusSource;
     TimeSouce = timeSouce;
 }
コード例 #6
0
ファイル: VlcAudioJob.cs プロジェクト: jonlawley/VlcDriver
 public VlcAudioJob(IAudioConfiguration audioConfig, IPortAllocator allocator, IStatusParser statusParser, IVlcStatusSource statusSouce, ITimeSouce timeSouce, ILogger logger)
     : base(allocator, statusParser, statusSouce, timeSouce, logger)
 {
     if(audioConfig == null)
     {
         var argumentNullException = new ArgumentNullException("audioConfig");
         logger.Error(argumentNullException);
         throw argumentNullException;
     }
     AudioConfiguration = audioConfig;
 }
コード例 #7
0
ファイル: VlcAudioJob.cs プロジェクト: PlumpMath/VlcDriver
 public VlcAudioJob(IAudioConfiguration audioConfig, IPortAllocator allocator, IStatusParser statusParser, IVlcStatusSource statusSouce, ITimeSouce timeSouce, ILogger logger)
     : base(allocator, statusParser, statusSouce, timeSouce, logger)
 {
     if (audioConfig == null)
     {
         var argumentNullException = new ArgumentNullException("audioConfig");
         logger.Error(argumentNullException);
         throw argumentNullException;
     }
     AudioConfiguration = audioConfig;
 }
コード例 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DreamMakerController"/> class.
 /// </summary>
 /// <param name="databaseContext">The <see cref="IDatabaseContext"/> for the <see cref="ApiController"/>.</param>
 /// <param name="authenticationContextFactory">The <see cref="IAuthenticationContextFactory"/> for the <see cref="ApiController"/>.</param>
 /// <param name="jobManager">The value of <see cref="jobManager"/>.</param>
 /// <param name="instanceManager">The <see cref="IInstanceManager"/> for the <see cref="InstanceRequiredController"/>.</param>
 /// <param name="portAllocator">The value of <see cref="IPortAllocator"/>.</param>
 /// <param name="logger">The <see cref="ILogger"/> for the <see cref="ApiController"/>.</param>
 public DreamMakerController(
     IDatabaseContext databaseContext,
     IAuthenticationContextFactory authenticationContextFactory,
     IJobManager jobManager,
     IInstanceManager instanceManager,
     IPortAllocator portAllocator,
     ILogger <DreamMakerController> logger)
     : base(
         instanceManager,
         databaseContext,
         authenticationContextFactory,
         logger)
 {
     this.jobManager    = jobManager ?? throw new ArgumentNullException(nameof(jobManager));
     this.portAllocator = portAllocator ?? throw new ArgumentNullException(nameof(portAllocator));
 }
コード例 #9
0
ファイル: VlcVideoJob.cs プロジェクト: jonlawley/VlcDriver
 public VlcVideoJob(IVideoConfiguration videoConfiguration, IAudioConfiguration audioConfiguration, IPortAllocator allocator, IStatusParser statusParser, IVlcStatusSource statusSouce, ITimeSouce timeSouce, ILogger logger)
     : base(allocator, statusParser, statusSouce, timeSouce, logger)
 {
     VideoConfiguration = videoConfiguration;
     AudioConfiguration = audioConfiguration;
 }
コード例 #10
0
ファイル: VlcVideoJob.cs プロジェクト: PlumpMath/VlcDriver
 public VlcVideoJob(IVideoConfiguration videoConfiguration, IAudioConfiguration audioConfiguration, IPortAllocator allocator, IStatusParser statusParser, IVlcStatusSource statusSouce, ITimeSouce timeSouce, ILogger logger)
     : base(allocator, statusParser, statusSouce, timeSouce, logger)
 {
     VideoConfiguration = videoConfiguration;
     AudioConfiguration = audioConfiguration;
 }