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


Java Delegate.orb方法代码示例

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


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

示例1: connect

import org.omg.CORBA.portable.Delegate; //导入方法依赖的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

示例2: write_Object

import org.omg.CORBA.portable.Delegate; //导入方法依赖的package包/类
/**
 * Read the CORBA object. The object is written form of the plain (not a
 * string-encoded) IOR profile without the heading endian indicator. The
 * responsible method for reading such data is {@link IOR.write_no_endian}.
 *
 * The null value is written as defined in OMG specification (zero length
 * string, followed by an empty set of profiles).
 */
public void write_Object(org.omg.CORBA.Object x)
{
  ORB w_orb = orb;
  if (x instanceof IorProvider)
    {
      ((IorProvider) x).getIor()._write_no_endian(this);
      return;
    }
  else if (x == null)
    {
      IOR.write_null(this);
      return;
    }
  else if (x instanceof ObjectImpl)
    {
      Delegate d = ((ObjectImpl) x)._get_delegate();

      if (d instanceof IorProvider)
        {
          ((IorProvider) d).getIor()._write_no_endian(this);
          return;
        }
      else
        {
          ORB d_orb = d.orb(x);
          if (d_orb != null)
            w_orb = d_orb;
        }
    }

  // Either this is not an ObjectImpl or it has the
  // unexpected delegate. Try to convert via ORBs
  // object_to_string().
  if (w_orb != null)
    {
      IOR ior = IOR.parse(w_orb.object_to_string(x));
      ior._write_no_endian(this);
      return;
    }
  else
    throw new BAD_OPERATION(
      "Please set the ORB for this stream, cannot write "
        + x.getClass().getName());
}
 
开发者ID:vilie,项目名称:javify,代码行数:53,代码来源:AbstractCdrOutput.java

示例3: write_Object

import org.omg.CORBA.portable.Delegate; //导入方法依赖的package包/类
/**
 * Read the CORBA object. The object is written form of the plain (not a
 * string-encoded) IOR profile without the heading endian indicator. The
 * responsible method for reading such data is {@link IOR.write_no_endian}.
 * 
 * The null value is written as defined in OMG specification (zero length
 * string, followed by an empty set of profiles).
 */
public void write_Object(org.omg.CORBA.Object x)
{
  ORB w_orb = orb;
  if (x instanceof IorProvider)
    {
      ((IorProvider) x).getIor()._write_no_endian(this);
      return;
    }
  else if (x == null)
    {
      IOR.write_null(this);
      return;
    }
  else if (x instanceof ObjectImpl)
    {
      Delegate d = ((ObjectImpl) x)._get_delegate();

      if (d instanceof IorProvider)
        {
          ((IorProvider) d).getIor()._write_no_endian(this);
          return;
        }
      else
        {
          ORB d_orb = d.orb(x);
          if (d_orb != null)
            w_orb = d_orb;
        }
    }

  // Either this is not an ObjectImpl or it has the
  // unexpected delegate. Try to convert via ORBs
  // object_to_string().
  if (w_orb != null)
    {
      IOR ior = IOR.parse(w_orb.object_to_string(x));
      ior._write_no_endian(this);
      return;
    }
  else
    throw new BAD_OPERATION(
      "Please set the ORB for this stream, cannot write "
        + x.getClass().getName());
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:53,代码来源:AbstractCdrOutput.java


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