本文整理汇总了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;
}
示例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;
}
示例3: CreateBootstrap
protected IConfigurationSource CreateBootstrap(string configFile)
{
IBootstrap newBootstrap;
var configSrc = CreateBootstrap(configFile, out newBootstrap);
m_BootStrap = newBootstrap;
return configSrc;
}
示例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;
}
示例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;
}
示例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));
}
}
示例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;
}
示例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));
}
}
示例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>();
}
示例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());
}
示例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;
}
示例12: ClearBootstrap
public void ClearBootstrap()
{
if(m_BootStrap != null)
{
m_BootStrap.Stop();
m_BootStrap = null;
}
}
示例13: OnBootstrapCleared
protected override void OnBootstrapCleared()
{
if (m_ActiveServerBootstrap != null)
{
m_ActiveServerBootstrap.Stop();
m_ActiveServerBootstrap = null;
AppDomain.CurrentDomain.SetData("Bootstrap", null);
}
}
示例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;
}