本文整理汇总了C#中IServiceAddress.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceAddress.ToString方法的具体用法?C# IServiceAddress.ToString怎么用?C# IServiceAddress.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServiceAddress
的用法示例。
在下文中一共展示了IServiceAddress.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Set
public void Set(String path, IServiceAddress rootAddress)
{
string rootAddrStr = null;
if (rootAddress != null)
rootAddrStr = rootAddress.ToString();
dictionary.SetValue(path, rootAddrStr);
}
示例2: ToString
public string ToString(IServiceAddress address)
{
return address.ToString();
}
示例3: ProcessSingleRoot
private Message ProcessSingleRoot(IEnumerable<Message> outputStream, IServiceAddress rootServer)
{
IMessageProcessor processor = connector.Connect(rootServer, ServiceType.Root);
IEnumerable<Message> inputStream = processor.Process(outputStream);
Message lastM = null;
foreach (Message m in inputStream) {
lastM = m;
if (m.HasError) {
// If it's a connection failure, inform the service tracker and throw
// service not available exception.
if (IsConnectionFailMessage(m)) {
serviceTracker.ReportServiceDownClientReport(rootServer, ServiceType.Root);
throw new ServiceNotConnectedException(rootServer.ToString());
}
string errorSource = m.Error.Source;
// Rethrow InvalidPathInfoException locally,
if (errorSource.Equals("Deveel.Data.Net.InvalidPathInfoException")) {
throw new InvalidPathInfoException(m.ErrorMessage);
}
}
}
return lastM;
}
示例4: RegisterBlockServer
private void RegisterBlockServer(IServiceAddress blockServerAddress)
{
// Get the block server uid,
Message message = new Message("serverGUID");
// Connect to the block server,
IMessageProcessor processor = connector.Connect(blockServerAddress, ServiceType.Block);
IEnumerable<Message> response = processor.Process(message.AsStream());
Message rm = null;
foreach (Message m in response) {
if (m.HasError)
throw new ApplicationException(m.ErrorMessage);
rm = m;
}
long serverGuid = (long) rm.Arguments[0].Value;
// Add lookup for this server_guid <-> service address to the db,
managerDb.SetValue("block.sguid." + serverGuid, blockServerAddress.ToString());
managerDb.SetValue("block.addr." + blockServerAddress, serverGuid.ToString());
// TODO: Block discovery on the introduced machine,
// Set the status and guid
BlockServiceInfo blockServer = new BlockServiceInfo(serverGuid, blockServerAddress);
// Add it to the map
lock (blockServersMap) {
blockServersMap[serverGuid] = blockServer;
blockServersList.Add(blockServer);
PersistBlockServers(blockServersList);
}
}
示例5: OnBindingWithManager
protected override void OnBindingWithManager(IServiceAddress managerAddress)
{
// Contains the root properties,
string propFile = Path.Combine(basePath, "00.properties");
using(FileStream fileStream = new FileStream(propFile, FileMode.OpenOrCreate, FileAccess.ReadWrite)) {
// Write the manager server address to the properties file,
Properties p = new Properties();
if (fileStream.Length > 0)
p.Load(fileStream);
p.SetProperty("manager_address", managerAddress.ToString());
fileStream.SetLength(0);
p.Store(fileStream, null);
fileStream.Close();
}
}