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


Java WrongAdapter类代码示例

本文整理汇总了Java中org.omg.PortableServer.POAPackage.WrongAdapter的典型用法代码示例。如果您正苦于以下问题:Java WrongAdapter类的具体用法?Java WrongAdapter怎么用?Java WrongAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: internalReferenceToId

import org.omg.PortableServer.POAPackage.WrongAdapter; //导入依赖的package包/类
private byte[] internalReferenceToId(
    org.omg.CORBA.Object reference ) throws WrongAdapter
{
    IOR ior = ORBUtility.getIOR( reference ) ;
    IORTemplateList thisTemplate = ior.getIORTemplates() ;

    ObjectReferenceFactory orf = getCurrentFactory() ;
    IORTemplateList poaTemplate =
        IORFactories.getIORTemplateList( orf ) ;

    if (!poaTemplate.isEquivalent( thisTemplate ))
        throw new WrongAdapter();

    // Extract the ObjectId from the first TaggedProfile in the IOR.
    // If ior was created in this POA, the same ID was used for
    // every profile through the profile templates in the currentFactory,
    // so we will get the same result from any profile.
    Iterator iter = ior.iterator() ;
    if (!iter.hasNext())
        throw iorWrapper().noProfilesInIor() ;
    TaggedProfile prof = (TaggedProfile)(iter.next()) ;
    ObjectId oid = prof.getObjectId() ;

    return oid.getId();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:POAImpl.java

示例2: reference_to_servant

import org.omg.PortableServer.POAPackage.WrongAdapter; //导入依赖的package包/类
/**
 * <code>reference_to_servant</code>
 * <b>3.3.8.21</b>
 */
public Servant reference_to_servant(org.omg.CORBA.Object reference)
    throws ObjectNotActive, WrongPolicy, WrongAdapter
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling reference_to_servant(reference=" +
                reference + ") on poa " + this ) ;
        }

        if ( state >= STATE_DESTROYING ) {
            throw lifecycleWrapper().adapterDestroyed() ;
        }

        // reference_to_id should throw WrongAdapter
        // if the objref was not created by this POA
        byte [] id = internalReferenceToId(reference);

        return mediator.idToServant( id ) ;
    } finally {
        unlock() ;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:POAImpl.java

示例3: reference_to_id

import org.omg.PortableServer.POAPackage.WrongAdapter; //导入依赖的package包/类
/**
 * <code>reference_to_id</code>
 * <b>3.3.8.22</b>
 */
public byte[] reference_to_id(org.omg.CORBA.Object reference)
    throws WrongAdapter, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling reference_to_id(reference=" +
                reference + ") on poa " + this ) ;
        }

        if( state >= STATE_DESTROYING ) {
            throw lifecycleWrapper().adapterDestroyed() ;
        }

        return internalReferenceToId( reference ) ;
    } finally {
        unlock() ;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:POAImpl.java

示例4: reference_to_servant

import org.omg.PortableServer.POAPackage.WrongAdapter; //导入依赖的package包/类
/**
 * Returns the servant that is serving this object.
 *
 * @return if the RETAIN policy applies and the object is in the Active Object
 * Map, the method returns the servant, associated with this object.
 * Otherwise, if the USE_DEFAULT_SERVANT policy applies, the method returns
 * the default servant (if one was set).
 *
 * @throws ObjectNotActive if none of the conditions above are satisfied.
 * @throws WrongAdapter if the object reference was not created with this POA.
 * @throws WrongPolicy. This method requires either RETAIN or
 * USE_DEFAULT_SERVANT policies and reaises the WrongPolicy if none of them
 * apply to this POA.
 */
public Servant reference_to_servant(org.omg.CORBA.Object the_Object)
  throws ObjectNotActive, WrongPolicy, WrongAdapter
{
  if (applies(ServantRetentionPolicyValue.RETAIN))
    {
      AOM.Obj ref = aom.findObject(the_Object);
      if (ref == null)
        {
          String object;
          if (the_Object == null)
            object = "null passed";
          else if (the_Object instanceof gnuServantObject)
            {
              gnuServantObject gs = (gnuServantObject) the_Object;
              object = "Wrong owner POA " + gs.poa.the_name();
            }
          else
            object = "Unknown " + the_Object.getClass().getName();

          throw new WrongAdapter(object + " for '" + the_name() + "'");
        }
      else if (ref.isDeactiveted() || ref.servant == null)
        {
          if (default_servant != null)
            return default_servant;
          else
            throw new ObjectNotActive();
        }
      else
        return ref.servant;
    }
  else if (default_servant != null)
    {
      return default_servant;
    }
  else
    throw new WrongPolicy("Either RETAIN or USE_DEFAULT_SERVANT required.");
}
 
开发者ID:vilie,项目名称:javify,代码行数:53,代码来源:gnuPOA.java

示例5: reference_to_servant

import org.omg.PortableServer.POAPackage.WrongAdapter; //导入依赖的package包/类
/**
 * Returns the servant that is serving this object.
 * 
 * @return if the RETAIN policy applies and the object is in the Active Object
 * Map, the method returns the servant, associated with this object.
 * Otherwise, if the USE_DEFAULT_SERVANT policy applies, the method returns
 * the default servant (if one was set).
 * 
 * @throws ObjectNotActive if none of the conditions above are satisfied.
 * @throws WrongAdapter if the object reference was not created with this POA.
 * @throws WrongPolicy. This method requires either RETAIN or
 * USE_DEFAULT_SERVANT policies and reaises the WrongPolicy if none of them
 * apply to this POA.
 */
public Servant reference_to_servant(org.omg.CORBA.Object the_Object)
  throws ObjectNotActive, WrongPolicy, WrongAdapter
{
  if (applies(ServantRetentionPolicyValue.RETAIN))
    {
      AOM.Obj ref = aom.findObject(the_Object);
      if (ref == null)
        {
          String object;
          if (the_Object == null)
            object = "null passed"; 
          else if (the_Object instanceof gnuServantObject)
            {
              gnuServantObject gs = (gnuServantObject) the_Object;
              object = "Wrong owner POA " + gs.poa.the_name();
            }
          else
            object = "Unknown " + the_Object.getClass().getName();

          throw new WrongAdapter(object + " for '" + the_name() + "'");
        }
      else if (ref.isDeactiveted() || ref.servant == null)
        {
          if (default_servant != null)
            return default_servant;
          else
            throw new ObjectNotActive();
        }
      else
        return ref.servant;
    }
  else if (default_servant != null)
    {
      return default_servant;
    }
  else
    throw new WrongPolicy("Either RETAIN or USE_DEFAULT_SERVANT required.");
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:53,代码来源:gnuPOA.java

示例6: reference_to_id

import org.omg.PortableServer.POAPackage.WrongAdapter; //导入依赖的package包/类
/**
 * Returns the Object Id, encapsulated in the given object reference.
 *
 * @param the_Object the object that has been previously created with this
 * POA. It need not be active.
 *
 * @throws WrongAdapter if the passed object is not known for this POA.
 * @throws WrongPolicy never (declared for the future extensions only).
 */
public byte[] reference_to_id(org.omg.CORBA.Object the_Object)
                       throws WrongAdapter, WrongPolicy
{
  AOM.Obj ref = aom.findObject(the_Object);
  if (ref == null)
    throw new WrongAdapter();
  return ref.key;
}
 
开发者ID:vilie,项目名称:javify,代码行数:18,代码来源:gnuPOA.java

示例7: reference_to_id

import org.omg.PortableServer.POAPackage.WrongAdapter; //导入依赖的package包/类
/**
 * Returns the Object Id, encapsulated in the given object reference.
 *
 * @param the_Object the object that has been previously created with this
 * POA. It need not be active.
 *
 * @throws WrongAdapter if the passed object has not been previously created
 * with this POA.
 * @throws WrongPolicy never (declared for the future extensions only).
 */
byte[] reference_to_id(org.omg.CORBA.Object the_Object)
                throws WrongAdapter, WrongPolicy;
 
开发者ID:vilie,项目名称:javify,代码行数:13,代码来源:POAOperations.java

示例8: reference_to_servant

import org.omg.PortableServer.POAPackage.WrongAdapter; //导入依赖的package包/类
/**
 * Returns the servant that is serving this object.
 *
 * @return if the RETAIN policy applies and the object is in the Active
 * Object Map, the method returns the servant, associated with this object.
 * Otherwise, if the USE_DEFAULT_SERVANT policy applies, the method returns
 * the default servant (if one was set).
 *
 * @throws ObjectNotActive if none of the conditions above are satisfied.
 * @throws WrongAdapter if the object reference was not created with this POA.
 * @throws WrongPolicy This method requires either RETAIN or
 * USE_DEFAULT_SERVANT policies and reaises the WrongPolicy if none of them
 * apply to this POA.
 */
Servant reference_to_servant(org.omg.CORBA.Object the_Object)
                      throws ObjectNotActive, WrongPolicy, WrongAdapter;
 
开发者ID:vilie,项目名称:javify,代码行数:17,代码来源:POAOperations.java


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