本文整理汇总了C#中Ice.setRequestHandler__方法的典型用法代码示例。如果您正苦于以下问题:C# Ice.setRequestHandler__方法的具体用法?C# Ice.setRequestHandler__怎么用?C# Ice.setRequestHandler__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ice
的用法示例。
在下文中一共展示了Ice.setRequestHandler__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: connect
public RequestHandler connect(Ice.ObjectPrxHelperBase proxy)
{
lock(this)
{
try
{
if(!initialized())
{
_proxies.Add(proxy);
}
}
catch(Ice.LocalException ex)
{
//
// Only throw if the connection didn't get established. If
// it died after being established, we allow the caller to
// retry the connection establishment by not throwing here.
//
if(_connection == null)
{
throw ex;
}
}
return proxy.setRequestHandler__(_requestHandler);
}
}
示例2: getRequestHandler
getRequestHandler(RoutableReference rf, Ice.ObjectPrxHelperBase proxy)
{
if(rf.getCollocationOptimized())
{
Ice.ObjectAdapter adapter = _instance.objectAdapterFactory().findObjectAdapter(proxy);
if(adapter != null)
{
return proxy.setRequestHandler__(new CollocatedRequestHandler(rf, adapter));
}
}
bool connect = false;
ConnectRequestHandler handler;
if(rf.getCacheConnection())
{
lock(this)
{
if(!_handlers.TryGetValue(rf, out handler))
{
handler = new ConnectRequestHandler(rf, proxy);
_handlers.Add(rf, handler);
connect = true;
}
}
}
else
{
handler = new ConnectRequestHandler(rf, proxy);
connect = true;
}
if(connect)
{
rf.getConnection(handler);
}
return proxy.setRequestHandler__(handler.connect(proxy));
}
示例3: connect
public RequestHandler connect(Ice.ObjectPrxHelperBase proxy)
{
//
// Initiate the connection if connect() is called by the proxy that
// created the handler.
//
if(Object.ReferenceEquals(proxy, _proxy) && _connect)
{
_connect = false; // Call getConnection only once
_reference.getConnection(this);
}
try
{
lock(this)
{
if(!initialized())
{
_proxies.Add(proxy);
return this;
}
}
}
catch(Ice.LocalException ex)
{
throw ex;
}
if(_connectionRequestHandler != null)
{
proxy.setRequestHandler__(this, _connectionRequestHandler);
return _connectionRequestHandler;
}
else
{
return this;
}
}