示例#1
0
        public static bool Initialize(int iPortNumber)
        {
            try
            {
                TcpChannel tcpChannel = new TcpChannel();
                ChannelServices.RegisterChannel(tcpChannel, true);
            }
            catch (System.Runtime.Remoting.RemotingException)
            {
                // We have already registered a channel
            }
            catch (Exception)
            {
                // Other error
                return(false);
            }
            try
            {
                ms_jobStatusManager = Activator.GetObject(
                    typeof(IJobStatusManager),
                    // The remote object should be at the same machine
                    "tcp://localhost:" + iPortNumber.ToString() + "/GalaxyJobStatusManager") as IJobStatusManager;
            }
            catch (Exception)
            {
                return(false);
            }

            return(true);
        }
 public JobService(StatefulServiceContext context, IPaymentLogger logger, IJobStatusManager jobStatusManager, ILifetimeScope lifetimeScope)
     : base(context)
 {
     this.logger           = logger ?? throw new ArgumentNullException(nameof(logger));
     this.jobStatusManager = jobStatusManager ?? throw new ArgumentNullException(nameof(jobStatusManager));
     this.lifetimeScope    = lifetimeScope;
 }
 public RecordEarningsJobBatchHandler(IPaymentLogger logger, IEarningsJobService earningsJobService, IEarningsJobStatusManager jobStatusManager)
 {
     this.logger             = logger ?? throw new ArgumentNullException(nameof(logger));
     this.earningsJobService = earningsJobService ?? throw new ArgumentNullException(nameof(earningsJobService));
     this.jobStatusManager   = jobStatusManager ?? throw new ArgumentNullException(nameof(jobStatusManager));
 }