本文整理汇总了C#中Ice.stringToIdentity方法的典型用法代码示例。如果您正苦于以下问题:C# Ice.stringToIdentity方法的具体用法?C# Ice.stringToIdentity怎么用?C# Ice.stringToIdentity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ice
的用法示例。
在下文中一共展示了Ice.stringToIdentity方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: run
private static int run(string[] args, Ice.Communicator communicator,
Ice.InitializationData initData)
{
//
// Register the server manager. The server manager creates a new
// 'server' (a server isn't a different process, it's just a new
// communicator and object adapter).
//
Ice.Properties properties = communicator.getProperties();
properties.setProperty("Ice.ThreadPool.Server.Size", "2");
properties.setProperty("ServerManagerAdapter.Endpoints", "default -p 12010:udp");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("ServerManagerAdapter");
//
// We also register a sample server locator which implements the
// locator interface, this locator is used by the clients and the
// 'servers' created with the server manager interface.
//
ServerLocatorRegistry registry = new ServerLocatorRegistry();
Ice.Object @object = new ServerManagerI(registry, initData);
adapter.add(@object, communicator.stringToIdentity("ServerManager"));
registry.addObject(adapter.createProxy(communicator.stringToIdentity("ServerManager")));
Ice.LocatorRegistryPrx registryPrx = Ice.LocatorRegistryPrxHelper.uncheckedCast(
adapter.add(registry, communicator.stringToIdentity("registry")));
ServerLocator locator = new ServerLocator(registry, registryPrx);
adapter.add(locator, communicator.stringToIdentity("locator"));
adapter.activate();
communicator.waitForShutdown();
return 0;
}
示例2: run
private static int run(string[] args, Ice.Communicator communicator)
{
communicator.getProperties().setProperty("TestAdapter1.Endpoints", "default -p 12010:udp");
communicator.getProperties().setProperty("TestAdapter1.ThreadPool.Size", "5");
communicator.getProperties().setProperty("TestAdapter1.ThreadPool.SizeMax", "5");
communicator.getProperties().setProperty("TestAdapter1.ThreadPool.SizeWarn", "0");
communicator.getProperties().setProperty("TestAdapter1.ThreadPool.Serialize", "0");
Ice.ObjectAdapter adapter1 = communicator.createObjectAdapter("TestAdapter1");
adapter1.add(new HoldI(adapter1), communicator.stringToIdentity("hold"));
communicator.getProperties().setProperty("TestAdapter2.Endpoints", "default -p 12011:udp");
communicator.getProperties().setProperty("TestAdapter2.ThreadPool.Size", "5");
communicator.getProperties().setProperty("TestAdapter2.ThreadPool.SizeMax", "5");
communicator.getProperties().setProperty("TestAdapter2.ThreadPool.SizeWarn", "0");
communicator.getProperties().setProperty("TestAdapter2.ThreadPool.Serialize", "1");
Ice.ObjectAdapter adapter2 = communicator.createObjectAdapter("TestAdapter2");
adapter2.add(new HoldI(adapter2), communicator.stringToIdentity("hold"));
adapter1.activate();
adapter2.activate();
communicator.waitForShutdown();
return 0;
}
示例3: run
private static int run(string[] args, Ice.Communicator communicator)
{
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
Initial initial = new InitialI(adapter);
adapter.add(initial, communicator.stringToIdentity("initial"));
UnexpectedObjectExceptionTestI uet = new UnexpectedObjectExceptionTestI();
adapter.add(uet, communicator.stringToIdentity("uoet"));
AllTests.allTests(communicator);
// We must call shutdown even in the collocated case for cyclic dependency cleanup
initial.shutdown();
return 0;
}
示例4: run
public static int run(string[] args, Ice.Communicator communicator)
{
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
adapter.add(new MetricsI(), communicator.stringToIdentity("metrics"));
adapter.activate();
communicator.getProperties().setProperty("ControllerAdapter.Endpoints", "default -p 12011");
Ice.ObjectAdapter controllerAdapter = communicator.createObjectAdapter("ControllerAdapter");
controllerAdapter.add(new ControllerI(adapter), communicator.stringToIdentity("controller"));
controllerAdapter.activate();
communicator.waitForShutdown();
return 0;
}
示例5: run
private static int run(string[] args, Ice.Communicator communicator)
{
Ice.Properties properties = communicator.getProperties();
int port = 12010;
try
{
port += args.Length == 1 ? System.Int32.Parse(args[0]) : 0;
}
catch(System.FormatException)
{
}
properties.setProperty("ControlAdapter.Endpoints", "tcp -p " + port);
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("ControlAdapter");
adapter.add(new TestIntfI(), communicator.stringToIdentity("control"));
adapter.activate();
if(port == 12010)
{
properties.setProperty("TestAdapter.Endpoints", "udp -p 12010");
Ice.ObjectAdapter adapter2 = communicator.createObjectAdapter("TestAdapter");
adapter2.add(new TestIntfI(), communicator.stringToIdentity("test"));
adapter2.activate();
}
string endpoint;
if(properties.getProperty("Ice.IPv6").Equals("1"))
{
if(IceInternal.AssemblyUtil.osx_)
{
endpoint = "udp -h \"ff15::1:1\" -p 12020 --interface \"::1\"";
}
else
{
endpoint = "udp -h \"ff15::1:1\" -p 12020";
}
}
else
{
endpoint = "udp -h 239.255.1.1 -p 12020";
}
properties.setProperty("McastTestAdapter.Endpoints", endpoint);
Ice.ObjectAdapter mcastAdapter = communicator.createObjectAdapter("McastTestAdapter");
mcastAdapter.add(new TestIntfI(), communicator.stringToIdentity("test"));
mcastAdapter.activate();
communicator.waitForShutdown();
return 0;
}
示例6: run
private static int run(string[] args, Ice.Communicator communicator)
{
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
adapter.add(new MetricsI(), communicator.stringToIdentity("metrics"));
//adapter.activate(); // Don't activate OA to ensure collocation is used.
communicator.getProperties().setProperty("ControllerAdapter.Endpoints", "default -p 12011");
Ice.ObjectAdapter controllerAdapter = communicator.createObjectAdapter("ControllerAdapter");
controllerAdapter.add(new ControllerI(adapter), communicator.stringToIdentity("controller"));
//controllerAdapter.activate(); // Don't activate OA to ensure collocation is used.
Test.MetricsPrx metrics = AllTests.allTests(communicator, _observer);
metrics.shutdown();
return 0;
}
示例7: run
private static int run(string[] args, Ice.Communicator communicator)
{
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010");
communicator.getProperties().setProperty("ControllerAdapter.Endpoints", "tcp -p 12011");
communicator.getProperties().setProperty("ControllerAdapter.ThreadPool.Size", "1");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
Ice.ObjectAdapter adapter2 = communicator.createObjectAdapter("ControllerAdapter");
adapter.add(new TestI(), communicator.stringToIdentity("test"));
adapter.activate();
adapter2.add(new TestControllerI(adapter), communicator.stringToIdentity("testController"));
adapter2.activate();
communicator.waitForShutdown();
return 0;
}
示例8: run
private static int run(string[] args, Ice.Communicator communicator)
{
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010");
communicator.getProperties().setProperty("ControllerAdapter.Endpoints", "default -p 12011");
communicator.getProperties().setProperty("ControllerAdapter.ThreadPool.Size", "1");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
Ice.ObjectAdapter adapter2 = communicator.createObjectAdapter("ControllerAdapter");
adapter.add(new TestI(), communicator.stringToIdentity("test"));
//adapter.activate(); // Collocated test doesn't need to activate the OA
adapter2.add(new TestControllerI(adapter), communicator.stringToIdentity("testController"));
//adapter2.activate(); // Collocated test doesn't need to activate the OA
AllTests.allTests(communicator, true);
return 0;
}
示例9: start
public void start(string name, Ice.Communicator communicator, string[] args)
{
_adapter = communicator.createObjectAdapter("Hello-" + name);
string helloIdentity = communicator.getProperties().getProperty("Hello.Identity");
_adapter.add(new HelloI(name), communicator.stringToIdentity(helloIdentity));
_adapter.activate();
}
示例10: run
private static int run(string[] args, Ice.Communicator communicator)
{
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
adapter.add(new MyClassI(), communicator.stringToIdentity("test"));
adapter.activate();
communicator.waitForShutdown();
return 0;
}
示例11: run
private static int run(string[] args, Ice.Communicator communicator)
{
communicator.getProperties().setProperty("TestAdapter.Endpoints", "tcp -p 12010");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
Ice.Identity id = communicator.stringToIdentity("factory");
adapter.add(new ServerFactoryI(), id);
adapter.activate();
communicator.waitForShutdown();
return 0;
}
示例12: run
private static int run(string[] args, Ice.Communicator communicator)
{
Ice.Properties properties = communicator.getProperties();
properties.setProperty("Ice.Warn.Dispatch", "0");
properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 2000");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
Ice.Object obj = new TestI();
adapter.add(obj, communicator.stringToIdentity("Test"));
adapter.activate();
communicator.waitForShutdown();
return 0;
}
示例13: run
private static int run(string[] args, Ice.Communicator communicator)
{
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
adapter.add(new decimalI(), communicator.stringToIdentity("test"));
adapter.add(new Test1I(), communicator.stringToIdentity("test1"));
adapter.add(new Test2I(), communicator.stringToIdentity("test2"));
adapter.activate();
Console.Out.Write("testing operation name... ");
Console.Out.Flush();
@[email protected] p = @[email protected](
adapter.createProxy(communicator.stringToIdentity("test")));
[email protected]();
Console.Out.WriteLine("ok");
Console.Out.Write("testing System as module name... ");
Console.Out.Flush();
@abstract.System.TestPrx t1 = @abstract.System.TestPrxHelper.uncheckedCast(
adapter.createProxy(communicator.stringToIdentity("test1")));
t1.op();
System.TestPrx t2 = System.TestPrxHelper.uncheckedCast(
adapter.createProxy(communicator.stringToIdentity("test2")));
t2.op();
Console.Out.WriteLine("ok");
Console.Out.Write("testing types... ");
Console.Out.Flush();
testtypes();
Console.Out.WriteLine("ok");
return 0;
}
示例14: run
private static int run(string[] args, Ice.Communicator communicator)
{
Ice.Properties properties = communicator.getProperties();
// We don't need to disable warnings because we have a dummy logger.
//properties.setProperty("Ice.Warn.Dispatch", "0");
properties.setProperty("TestAdapter.Endpoints", "default -p 12010:udp");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
Ice.Object @object = new ThrowerI();
adapter.add(@object, communicator.stringToIdentity("thrower"));
adapter.activate();
communicator.waitForShutdown();
return 0;
}
示例15: run
private static int run(String[] args, Ice.Communicator communicator)
{
communicator.getProperties().setProperty("TestAdapter.AdapterId", "test");
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
Ice.ObjectPrx prx = adapter.add(new MyDerivedClassI(), communicator.stringToIdentity("test"));
//adapter.activate(); // Don't activate OA to ensure collocation is used.
if(prx.ice_getConnection() != null)
{
throw new System.Exception();
}
AllTests.allTests(communicator);
return 0;
}