当前位置: 首页>>代码示例>>Java>>正文


Java ObjectImpl._set_delegate方法代码示例

本文整理汇总了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));
        }
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:34,代码来源:OrbFunctional.java

示例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;
}
 
开发者ID:vilie,项目名称:javify,代码行数:32,代码来源:OrbFunctional.java


注:本文中的org.omg.CORBA.portable.ObjectImpl._set_delegate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。