本文整理汇总了Java中org.omg.CORBA.portable.ObjectImpl._set_delegate方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectImpl._set_delegate方法的具体用法?Java ObjectImpl._set_delegate怎么用?Java ObjectImpl._set_delegate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.omg.CORBA.portable.ObjectImpl
的用法示例。
在下文中一共展示了ObjectImpl._set_delegate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareObject
import org.omg.CORBA.portable.ObjectImpl; //导入方法依赖的package包/类
/**
* Prepare object for connecting it to this ORB.
*
* @param object the object being connected.
*
* @throws BAD_PARAM if the object does not implement the
* {@link InvokeHandler}).
*/
protected void prepareObject(org.omg.CORBA.Object object, IOR ior)
throws BAD_PARAM
{
/*
* if (!(object instanceof InvokeHandler)) throw new
* BAD_PARAM(object.getClass().getName() + " does not implement
* InvokeHandler. " );
*/
// If no delegate is set, set the default delegate.
if (object instanceof ObjectImpl)
{
ObjectImpl impl = (ObjectImpl) object;
try
{
if (impl._get_delegate() == null)
impl._set_delegate(new SimpleDelegate(this, ior));
}
catch (BAD_OPERATION ex)
{
// Some colaborants may throw this exception.
impl._set_delegate(new SimpleDelegate(this, ior));
}
}
}
示例2: ior_to_object
import org.omg.CORBA.portable.ObjectImpl; //导入方法依赖的package包/类
/**
* Convert ior reference to CORBA object.
*/
public org.omg.CORBA.Object ior_to_object(IOR ior)
{
org.omg.CORBA.Object object = find_local_object(ior);
if (object == null)
{
// Check maybe the local object on another ORB, but same VM.
object = CollocatedOrbs.searchLocalObject(ior);
if (object == null)
{
// Surely remote object.
ObjectImpl impl = StubLocator.search(this, ior);
try
{
if (impl._get_delegate() == null)
impl._set_delegate(new IorDelegate(this, ior));
}
catch (BAD_OPERATION ex)
{
// Some colaborants may throw this exception
// in response to the attempt to get the unset delegate.
impl._set_delegate(new IorDelegate(this, ior));
}
object = impl;
}
}
return object;
}