当前位置: 首页>>代码示例>>C#>>正文


C# IBootstrap类代码示例

本文整理汇总了C#中IBootstrap的典型用法代码示例。如果您正苦于以下问题:C# IBootstrap类的具体用法?C# IBootstrap怎么用?C# IBootstrap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IBootstrap类属于命名空间,在下文中一共展示了IBootstrap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Setup

 /// <summary>
 /// Setups the specified root config.
 /// </summary>
 /// <param name="bootstrap">The bootstrap.</param>
 /// <param name="config">The socket server instance config.</param>
 /// <param name="factories">The factories.</param>
 /// <returns></returns>
 public bool Setup(IBootstrap bootstrap, IServerConfig config, ProviderFactoryInfo[] factories)
 {
     m_Bootstrap = bootstrap;
     m_ServerConfig = config;
     m_Factories = factories;
     return true;
 }
开发者ID:kinghuc,项目名称:521266750_qq_com,代码行数:14,代码来源:AppDomainAppServer.cs

示例2: Setup

        public virtual bool Setup(IBootstrap bootstrap, IServerConfig config)
        {
            Bootstrap = bootstrap;

            var loggerProvider = bootstrap as ILoggerProvider;

            if (loggerProvider != null)
                Logger = loggerProvider.Logger;

            State = ServerState.Initializing;
            Config = config;
            Name = config.Name;            
            State = ServerState.NotStarted;

            AppWorkingDir = config.Options.Get("appWorkingDir") ?? GetAppWorkingDir(Name);

            if (!Directory.Exists(AppWorkingDir))
                Directory.CreateDirectory(AppWorkingDir);

            var appConfigFilePath = GetAppConfigFile();

            // use the application's own config file if it has
            //AppRoot\AppName\App.config
            if (!string.IsNullOrEmpty(appConfigFilePath))
                StartupConfigFile = appConfigFilePath;

            m_NotStartedStatus = new Lazy<StatusInfoCollection>(() =>
                {
                    var status = new StatusInfoCollection(m_Metadata.Name);
                    status[StatusInfoKeys.IsRunning] = false;
                    return status;
                });

            return true;
        }
开发者ID:weitaoxiao,项目名称:NDock,代码行数:35,代码来源:IsolationApp.cs

示例3: CreateBootstrap

 protected IConfigurationSource CreateBootstrap(string configFile)
 {
     IBootstrap newBootstrap;
     var configSrc = CreateBootstrap(configFile, out newBootstrap);
     m_BootStrap = newBootstrap;
     return configSrc;
 }
开发者ID:iraychen,项目名称:SuperSocket,代码行数:7,代码来源:BootstrapTestBase.cs

示例4: ListCommand

        static bool ListCommand(IBootstrap bootstrap, string[] arguments)
        {
            foreach (var s in bootstrap.AppServers)
            {
                Console.WriteLine("{0} - {1}", s.Name, s.State);
            }

            return false;
        }
开发者ID:qq799309118,项目名称:SuperSocket,代码行数:9,代码来源:Program.cs

示例5: Setup

        public bool Setup(IBootstrap bootstrap, IServerConfig config)
        {
            Config = config;

            foreach (var item in Items)
            {
                if (!item.Setup(bootstrap, config))
                    return false;
            }

            return true;
        }
开发者ID:weitaoxiao,项目名称:NDock,代码行数:12,代码来源:RemoteAppGroup.cs

示例6: RemoteBootstrapProxy

        public RemoteBootstrapProxy()
        {
            m_Bootstrap = (IBootstrap)AppDomain.CurrentDomain.GetData("Bootstrap");

            foreach (var s in m_Bootstrap.AppServers)
            {
                if (s is MarshalByRefObject)
                    m_Servers.Add(s);
                else
                    m_Servers.Add(new ServerProxy(s));
            }
        }
开发者ID:huamanhtuyen,项目名称:TagLo2,代码行数:12,代码来源:RemoteBootstrapProxy.cs

示例7: Setup

        public override bool Setup(IBootstrap bootstrap, IServerConfig config)
        {
            if (!base.Setup(bootstrap, config))
                return false;

            var metadata = GetMetadata() as ExternalProcessAppServerMetadata;

            var appFile = metadata.AppFile;

            if(string.IsNullOrEmpty(appFile))
            {
                OnExceptionThrown(new ArgumentNullException("appFile"));
                return false;
            }

            var workDir = AppWorkingDir;

            if (!string.IsNullOrEmpty(metadata.AppDir))
                appFile = Path.Combine(metadata.AppDir, appFile);

            if(!Path.IsPathRooted(appFile))
            {
                appFile = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, appFile));
            }

            if (!File.Exists(appFile))
            {
                OnExceptionThrown(new FileNotFoundException("The app file was not found.", appFile));
                return false;
            }

            workDir = Path.GetDirectoryName(appFile);

            m_ExternalAppDir = workDir;

            var args = metadata.AppArgs;

            var startInfo = new ProcessStartInfo(appFile, args);
            startInfo.WorkingDirectory = workDir;
            startInfo.CreateNoWindow = true;
            startInfo.WindowStyle = ProcessWindowStyle.Hidden;
            startInfo.UseShellExecute = false;
            startInfo.RedirectStandardError = true;
            startInfo.RedirectStandardInput = true;

            m_StartInfo = startInfo;

            m_ExitCommand = config.Options.Get("exitCommand");

            m_Status = new StatusInfoCollection { Name = config.Name };

            return true;
        }
开发者ID:kerryjiang,项目名称:NRack,代码行数:53,代码来源:ExternalProcessApp.cs

示例8: RemoteBootstrapProxy

        public RemoteBootstrapProxy(IBootstrap innerBootstrap)
        {
            m_Bootstrap = innerBootstrap;
            m_ManagedApps = new List<IManagedApp>();

            foreach (var s in m_Bootstrap.AppServers)
            {
                if (s is MarshalByRefObject)
                    m_ManagedApps.Add(s);
                else
                    m_ManagedApps.Add(new ServerProxy(s));
            }
        }
开发者ID:weitaoxiao,项目名称:NDock,代码行数:13,代码来源:RemoteBootstrapProxy.cs

示例9: IsolationBootstrap

 public IsolationBootstrap(IConfigSource configSource)
     : base(GetSerializableConfigSource(configSource)) // make the configuration source serializable
 {
     HandleConfigSource(configSource);
     m_RemoteBootstrapWrap = new RemoteBootstrapProxy(this);
     m_RecycleTriggers = AppDomain.CurrentDomain.GetCurrentAppDomainExportProvider().GetExports<IRecycleTrigger, IProviderMetadata>();
 }
开发者ID:weitaoxiao,项目名称:NDock,代码行数:7,代码来源:IsolationBootstrap.cs

示例10: Setup

 public void Setup()
 {
     m_Bootstrap = BootstrapFactory.CreateBootstrapFromConfigFile("SuperSocket.config");
     Assert.IsTrue(m_Bootstrap.Initialize());
     m_Port = ((IAppServer) m_Bootstrap.AppServers.FirstOrDefault()).Config.Port;
     Assert.AreEqual(StartResult.Success, m_Bootstrap.Start());
 }
开发者ID:RocChing,项目名称:SuperSocket,代码行数:7,代码来源:UnitTest.cs

示例11: GetResponses

 public ICollection<IPointToLaceProvider> GetResponses(ICollection<IPointToLaceRequest> request)
 {
     _buildSourceChain = new CreateSourceChain();
     _bootstrap = new Initialize(new Collection<IPointToLaceProvider>(), request, _bus, _buildSourceChain);
     _bootstrap.Execute(ChainType.All);
     return _bootstrap.DataProviderResponses ?? EmptyResponse;
 }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:7,代码来源:MetadataEntryPointService.cs

示例12: ClearBootstrap

 public void ClearBootstrap()
 {
     if(m_BootStrap != null)
     {
         m_BootStrap.Stop();
         m_BootStrap = null;
     }
 }
开发者ID:MengPeng,项目名称:SuperSocket,代码行数:8,代码来源:BootstrapTest.cs

示例13: OnBootstrapCleared

 protected override void OnBootstrapCleared()
 {
     if (m_ActiveServerBootstrap != null)
     {
         m_ActiveServerBootstrap.Stop();
         m_ActiveServerBootstrap = null;
         AppDomain.CurrentDomain.SetData("Bootstrap", null);
     }
 }
开发者ID:RocChing,项目名称:SuperSocket,代码行数:9,代码来源:TcpSocketServerTest.cs

示例14: when_initializing_lace_handlers_for_ivid_request

 public when_initializing_lace_handlers_for_ivid_request()
 {
     _command = BusFactory.WorkflowBus();
     _request = new LicensePlateRequestBuilder().ForIvid();
     _buildSourceChain = new CreateSourceChain();
     //_buildSourceChain = new CreateSourceChain(_request.GetFromRequest<IPointToLaceRequest>().Package);
     //_buildSourceChain.Build();
     _initialize = new Initialize(new Collection<IPointToLaceProvider>(),  _request, _command, _buildSourceChain);
 }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:9,代码来源:when_initializing_lace_handlers_for_ivid_request.cs

示例15: GetResponsesForCarId

        public ICollection<IPointToLaceProvider> GetResponsesForCarId(ICollection<IPointToLaceRequest> request)
        {
            _buildSourceChain = new FakeSourceChain();
            if (_checkForDuplicateRequests.IsRequestDuplicated(request.First())) return null;

            _bootstrap = new Initialize(new Collection<IPointToLaceProvider>(), request, _bus, _buildSourceChain);
            _bootstrap.Execute(ChainType.CarId);

            return _bootstrap.DataProviderResponses;
        }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:10,代码来源:FakeEntryPoint.cs


注:本文中的IBootstrap类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。