Example #1
0
    private void _init() {
      var physicalApplicationPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
      physicalApplicationPath = Utl.NormalizeDir(Directory.GetParent(physicalApplicationPath).FullName);
      this.logFileName = physicalApplicationPath + "xlfrpt2_srvc.log";
      this.log_msg("*************************************** Инициализация \"Очереди отчетов\"... ***************************************************");
      this.log_msg("\tЗагрузка конфигурации...");
      this._cfg = CConfigSys.load(physicalApplicationPath, this.logFileName);
      this._cfg.msgLogWriter = this.log_msg;
      this._cfg.errLogWriter = this.log_err;
      this.log_msg("\tКонфигурация загружена.");

      this.log_msg("\tИнициализация сервера Ipc...");
      // Create the server channel.

      SecurityIdentifier sid = new SecurityIdentifier(WellKnownSidType.AuthenticatedUserSid, null);
      NTAccount account = sid.Translate(typeof(NTAccount)) as NTAccount;

      IDictionary channelProperties = new Hashtable();
      channelProperties["portName"] = "Bio.Handlers.XLFRpt2.CQueueRemoteControl.Ipc";
      channelProperties["exclusiveAddressUse"] = false;
      channelProperties["authorizedGroup"] = account.Value;
      channelProperties["typeFilterLevel"] = TypeFilterLevel.Full;
      IpcChannel serverChannel = new IpcChannel(channelProperties, null, null);
      ChannelServices.RegisterChannel(serverChannel, false);

      // Expose an object for remote calls.
      RemotingConfiguration.RegisterWellKnownServiceType(
              typeof(CQueueRemoteControl), "QueueRemoteControl.rem",
              WellKnownObjectMode.Singleton);

      this.log_msg("\tСервер Ipc инициализирован.");
      this.log_msg("*************************************** Инициализация \"Очереди отчетов\" выполнена. ***************************************************");
    }
Example #2
0
 internal static CQueue creQueue(Object opener, CConfigSys cfg) {
   CQueue v_rslt = null;
   var v_type = Type.GetType(cfg.queueImplementationType);
   if (v_type != null) {
     var v_parTypes = new[] { typeof(Object), typeof(CConfigSys)};
     var v_parVals = new[] { opener, cfg };
     var v_ci = v_type.GetConstructor(v_parTypes);
     if (v_ci != null) v_rslt = (CQueue)v_ci.Invoke(v_parVals);
   }
   return v_rslt;
 }
Example #3
0
    protected CQueue(Object opener, CConfigSys cfg) {
      instOfQueue = this;
      this.cfg = cfg;
      this._opener = opener;
      this._runningReports = new Dictionary<String, IRemoteProcInst>();
      String v_srvName = null;
      if (this._opener is Service)
        v_srvName = (this._opener as Service).ServiceName;
      this._thread = new CBackgroundThread(
        v_srvName,
        this.cfg.adminEmail,
        this.cfg.smtp,
        this.cfg.errLogWriter, 
        this._processQueue);
		}
 public CQueueDefaultImpl(Object pOpener, CConfigSys cfg) :
   base(pOpener, cfg) { }