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


Java POA类代码示例

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


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

示例1: activateServant

import org.omg.PortableServer.POA; //导入依赖的package包/类
/** Use implicit activation to get an object reference for the servant.
 */
public static org.omg.CORBA.Object activateServant( Servant servant )
{
    POA poa = servant._default_POA() ;
    org.omg.CORBA.Object ref = null ;

    try {
        ref = poa.servant_to_reference( servant ) ;
    } catch (ServantNotActive sna) {
        throw wrapper.getDelegateServantNotActive( sna ) ;
    } catch (WrongPolicy wp) {
        throw wrapper.getDelegateWrongPolicy( wp ) ;
    }

    // Make sure that the POAManager is activated if no other
    // POAManager state management has taken place.
    POAManager mgr = poa.the_POAManager() ;
    if (mgr instanceof POAManagerImpl) {
        POAManagerImpl mgrImpl = (POAManagerImpl)mgr ;
        mgrImpl.implicitActivation() ;
    }

    return ref ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:StubAdapter.java

示例2: TransientNamingContext

import org.omg.PortableServer.POA; //导入依赖的package包/类
/**
 * Constructs a new TransientNamingContext object.
 * @param orb an orb object.
 * @param initial the initial naming context.
 * @exception Exception a Java exception thrown of the base class cannot
 * initialize.
 */
public TransientNamingContext(com.sun.corba.se.spi.orb.ORB orb,
    org.omg.CORBA.Object initial,
    POA nsPOA )
    throws java.lang.Exception
{
    super(orb, nsPOA );
    wrapper = NamingSystemException.get( orb, CORBALogDomains.NAMING ) ;

    this.localRoot = initial;
    readLogger = orb.getLogger( CORBALogDomains.NAMING_READ);
    updateLogger = orb.getLogger( CORBALogDomains.NAMING_UPDATE);
    lifecycleLogger = orb.getLogger(
        CORBALogDomains.NAMING_LIFECYCLE);
    lifecycleLogger.fine( "Root TransientNamingContext LIFECYCLE.CREATED" );
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:TransientNamingContext.java

示例3: createbiPOA

import org.omg.PortableServer.POA; //导入依赖的package包/类
private synchronized void createbiPOA( ) {
    if( biPOA != null ) {
        return;
    }
    try {
        POA rootPOA = (POA) orb.resolve_initial_references(
            ORBConstants.ROOT_POA_NAME );
        rootPOA.the_POAManager().activate( );

        int i = 0;
        Policy[] poaPolicy = new Policy[3];
        poaPolicy[i++] = rootPOA.create_lifespan_policy(
            LifespanPolicyValue.TRANSIENT);
        poaPolicy[i++] = rootPOA.create_id_assignment_policy(
            IdAssignmentPolicyValue.SYSTEM_ID);
        poaPolicy[i++] = rootPOA.create_servant_retention_policy(
            ServantRetentionPolicyValue.RETAIN);
        biPOA = rootPOA.create_POA("BindingIteratorPOA", null, poaPolicy );
        biPOA.the_POAManager().activate( );
    } catch( Exception e ) {
        throw readWrapper.namingCtxBindingIteratorCreate( e ) ;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:NamingContextImpl.java

示例4: the_children

import org.omg.PortableServer.POA; //导入依赖的package包/类
/**
 * <code>the_children</code>
 */
public org.omg.PortableServer.POA[] the_children()
{
    try {
        lock() ;

        Collection coll = children.values() ;
        int size = coll.size() ;
        POA[] result = new POA[ size ] ;
        int index = 0 ;
        Iterator iter = coll.iterator() ;
        while (iter.hasNext()) {
            POA poa = (POA)(iter.next()) ;
            result[ index++ ] = poa ;
        }

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

示例5: getRootPOA

import org.omg.PortableServer.POA; //导入依赖的package包/类
public synchronized POA getRootPOA()
{
    if (rootPOA == null) {
        // See if we are trying to getRootPOA while shutting down the ORB.
        if (isShuttingDown) {
            throw omgWrapper.noObjectAdaptor( ) ;
        }

        try {
            Object obj = orb.resolve_initial_references(
                ORBConstants.ROOT_POA_NAME ) ;
            rootPOA = (POAImpl)obj ;
        } catch (InvalidName inv) {
            throw wrapper.cantResolveRootPoa( inv ) ;
        }
    }

    return rootPOA;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:POAFactory.java

示例6: has

import org.omg.PortableServer.POA; //导入依赖的package包/类
/**
 * Check if this Poa has some running threads.
 */
public boolean has(POA poa)
{
  synchronized (threads)
    {
      Iterator iter = threads.entrySet().iterator();
      while (iter.hasNext())
        {
          Map.Entry item = (Map.Entry) iter.next();
          try
            {
              if (((CurrentOperations) item.getValue()).get_POA() == poa)
                {
                  return true;
                }
            }
          catch (NoContext ex)
            {
              throw new InternalError();
            }
        }
    }
  return false;
}
 
开发者ID:vilie,项目名称:javify,代码行数:27,代码来源:gnuPoaCurrent.java

示例7: RefTemplate

import org.omg.PortableServer.POA; //导入依赖的package包/类
RefTemplate()
{
  // The adapter name is computed once.
  ArrayList names = new ArrayList();
  names.add(the_name());

  POA poa = the_parent();
  while (poa != null)
    {
      names.add(poa.the_name());
      poa = poa.the_parent();
    }

  // Fill in the string array in reverse (more natural) order,
  // root POA first.
  m_adapter_name = new String[names.size()];

  for (int i = 0; i < m_adapter_name.length; i++)
    m_adapter_name[i] = (String) names.get(m_adapter_name.length - i - 1);
}
 
开发者ID:vilie,项目名称:javify,代码行数:21,代码来源:gnuPOA.java

示例8: createPoaInstance

import org.omg.PortableServer.POA; //导入依赖的package包/类
/**
 * Create an instance of the POA with the given features.
 * This method is not responsible for duplicate checking
 * or adding the returned instance to any possible table.
 *
 * @param child_name the name of the poa being created.
 * @param a_manager the poa manager (never null).
 * @param policies the array of policies.
 * @param an_orb the ORB for this POA.
 *
 * @return the created POA.
 *
 * @throws InvalidPolicy for conflicting or otherwise invalid policies.|
 */
protected POA createPoaInstance(String child_name, POAManager a_manager,
                                Policy[] policies, ORB_1_4 an_orb
                               )
                         throws InvalidPolicy
{
  POAManager some_manager =
    a_manager == null ? new gnuPOAManager() : a_manager;

  if (some_manager instanceof gnuPOAManager)
    {
      ((gnuPOAManager) some_manager).addPoa(this);
    }

  return new gnuPOA(this, child_name, some_manager, policies, an_orb);
}
 
开发者ID:vilie,项目名称:javify,代码行数:30,代码来源:gnuPOA.java

示例9: id

import org.omg.PortableServer.POA; //导入依赖的package包/类
/**
 * Get the unique Id of the POA in the process in which it is created.
 * This Id is needed by portable interceptors. The id is unique
 * for the life span of the POA in the process. For persistent
 * POAs, if a POA is created in the same path with the same name as
 * another POA, these POAs are identical have the same id. All transient
 * POAs are assumed unique.
 */
public byte[] id()
{
  if (m_poa_id != null)
    return m_poa_id;
  else
    {
      BufferedCdrOutput buffer = new BufferedCdrOutput();
      POA p = this;
      while (p != null)
        {
          buffer.write_string(p.the_name());
          p = p.the_parent();
        }
      m_poa_id = buffer.buffer.toByteArray();
      return m_poa_id;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:26,代码来源:gnuPOA.java

示例10: preinvoke

import org.omg.PortableServer.POA; //导入依赖的package包/类
public Servant preinvoke(byte[] oid, POA adapter, String operation,
                         CookieHolder cookie) throws ForwardRequest
{

    String objKey = new String(oid);

    Servant servant = (Servant) contexts.get(objKey);

    if (servant == null)
    {
             servant =  readInContext(objKey);
    }

    return servant;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:ServantManagerImpl.java

示例11: NamingContextImpl

import org.omg.PortableServer.POA; //导入依赖的package包/类
/**
 * Create a naming context servant.
 * Runs the super constructor.
 * @param orb an ORB object.
 * @exception java.lang.Exception a Java exception.
 */
public NamingContextImpl(ORB orb, POA poa) throws java.lang.Exception {
    super();
    this.orb = orb;
    wrapper = NamingSystemException.get( orb,
        CORBALogDomains.NAMING_UPDATE ) ;

    insImpl = new InterOperableNamingImpl( );
    this.nsPOA = poa;
    readLogger = orb.getLogger( CORBALogDomains.NAMING_READ);
    updateLogger = orb.getLogger( CORBALogDomains.NAMING_UPDATE);
    lifecycleLogger = orb.getLogger(
        CORBALogDomains.NAMING_LIFECYCLE);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:NamingContextImpl.java

示例12: TransientBindingIterator

import org.omg.PortableServer.POA; //导入依赖的package包/类
/**
  * Constructs a new TransientBindingIterator object.
  * @param orb a org.omg.CORBA.ORB object.
  * @param aTable A hashtable containing InternalBindingValues which is
  * the content of the TransientNamingContext.
  * @param java.lang.Exception a Java exception.
  * @exception Exception a Java exception thrown of the base class cannot
  * initialize.
*/
 public TransientBindingIterator(ORB orb, Hashtable aTable,
     POA thePOA )
     throws java.lang.Exception
 {
     super(orb);
     theHashtable = aTable;
     theEnumeration = this.theHashtable.elements();
     currentSize = this.theHashtable.size();
     this.nsPOA = thePOA;
 }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:TransientBindingIterator.java

示例13: PersistentBindingIterator

import org.omg.PortableServer.POA; //导入依赖的package包/类
/**
  * Constructs a new PersistentBindingIterator object.
  * @param orb a org.omg.CORBA.ORB object.
  * @param aTable A hashtable containing InternalBindingValues which is
  * the content of the PersistentNamingContext.
  * @param java.lang.Exception a Java exception.
  * @exception Exception a Java exception thrown of the base class cannot
  * initialize.
*/
 public PersistentBindingIterator(org.omg.CORBA.ORB orb, Hashtable aTable,
     POA thePOA ) throws java.lang.Exception
 {
     super(orb);
     this.orb = orb;
     theHashtable = aTable;
     theEnumeration = this.theHashtable.keys();
     currentSize = this.theHashtable.size();
     biPOA = thePOA;
 }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:PersistentBindingIterator.java

示例14: the_parent

import org.omg.PortableServer.POA; //导入依赖的package包/类
/**
 * <code>the_parent</code>
 * <b>Section 3.3.8.7</b>
 */
public POA the_parent()
{
    try {
        lock() ;

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

示例15: get_POA

import org.omg.PortableServer.POA; //导入依赖的package包/类
public POA get_POA()
    throws
        NoContext
{
    POA poa = (POA)(peekThrowNoContext().oa());
    throwNoContextIfNull(poa);
    return poa;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:POACurrent.java


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