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


Java Stub._get_delegate方法代码示例

本文整理汇总了Java中javax.rmi.CORBA.Stub._get_delegate方法的典型用法代码示例。如果您正苦于以下问题:Java Stub._get_delegate方法的具体用法?Java Stub._get_delegate怎么用?Java Stub._get_delegate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.rmi.CORBA.Stub的用法示例。


在下文中一共展示了Stub._get_delegate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: equals

import javax.rmi.CORBA.Stub; //导入方法依赖的package包/类
/**
 * Compare two stubs for equality.
 */
public boolean equals(Stub self, java.lang.Object obj)
{
  if (obj instanceof ObjectImpl)
    {
      ObjectImpl other = (ObjectImpl) obj;
      Delegate d1 = other._get_delegate();
      Delegate d2 = self._get_delegate();
      if (d1 == null || d2 == null)
        return d1 == d2;
      else
        return d1.equals(d2);
    }
  else return false;
}
 
开发者ID:vilie,项目名称:javify,代码行数:18,代码来源:StubDelegateImpl.java

示例2: connect

import javax.rmi.CORBA.Stub; //导入方法依赖的package包/类
/**
 * Connect when the POA is specified.
 */
public static void connect(Stub self, ORB orb, POA poa)
  throws RemoteException
{
  ORB oorb = null;
  try
    {
      Delegate d = self._get_delegate();
      if (d != null)
        oorb = d.orb(self);
    }
  catch (Exception e)
    {
      // Failed to get Delegate or ORB.
      // (possible ony for user-written Stubs).
    }

  if (oorb != null)
    {
      if (!oorb.equals(orb))
        throw new RemoteException("Stub " + self
          + " is connected to another ORB, " + orb);
      else
        return;
    }

  Tie t = null;
  if (self instanceof Remote)
    t = Util.getTie((Remote) self);

  // Find by name pattern.
  if (t == null)
    t = getTieFromStub(self);

  Delegate delegate;

  if (t instanceof Servant)
    {
      try
        {
          if (poa == null)
            {
              poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
              // Activate if not active.
              if (poa.the_POAManager().get_state().value() == State._HOLDING)
                poa.the_POAManager().activate();
            }

          ObjectImpl obj = (ObjectImpl) poa.servant_to_reference((Servant) t);
          delegate = obj._get_delegate();
        }
      catch (Exception ex)
        {
          throw new Unexpected(ex);
        }
    }
  else if (t instanceof ObjectImpl)
    {
      ObjectImpl o = (ObjectImpl) t;
      orb.connect(o);
      delegate = o._get_delegate();
    }
  else
    throw new BAD_PARAM("The Tie must be either Servant or ObjectImpl");

  self._set_delegate(delegate);
}
 
开发者ID:vilie,项目名称:javify,代码行数:70,代码来源:StubDelegateImpl.java

示例3: hashCode

import javax.rmi.CORBA.Stub; //导入方法依赖的package包/类
/**
 * Get the hash code (from IOR reference).
 */
public int hashCode(Stub self)
{
  Delegate d = self._get_delegate();
  return d==null?0:d.hashCode();
}
 
开发者ID:vilie,项目名称:javify,代码行数:9,代码来源:StubDelegateImpl.java


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