Ejemplo n.º 1
0
        public static CoreControler Create()
        {
            AppDomain domain = AppDomainFactory.Create("AgentCore");
            Assembly  asm    = Assembly.GetAssembly(typeof(CoreFactory));

            CoreInitializer initializer = (CoreInitializer)domain.CreateInstanceFromAndUnwrap(
                typeof(CoreInitializer).Assembly.Location, typeof(CoreInitializer).FullName);
            Guid coreId = initializer.Id;

            if (coreId == Guid.Empty)
            {
                AppDomain.Unload(domain);
                throw new Exception("Error in CoreInitializer");
            }
            _cores.AddOrUpdate(coreId, new CoreFactoryItem(domain, initializer, null),
                               (id, tuple) => tuple);

            CoreControler remoteControl = new CoreControler(coreId);

            remoteControl.OnDispose += Destroy;
            return(remoteControl);
        }
Ejemplo n.º 2
0
 public CoreFactoryItem(AppDomain domain, CoreInitializer initializer, ILog logger)
 {
     Domain = domain;
     Initializer = initializer;
     Logger = logger;
 }
Ejemplo n.º 3
0
 public CoreFactoryItem(AppDomain domain, CoreInitializer initializer, ILog logger)
 {
     Domain      = domain;
     Initializer = initializer;
     Logger      = logger;
 }