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


Java POAManager类代码示例

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


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

示例1: activateServant

import org.omg.PortableServer.POAManager; //导入依赖的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: shutdown

import org.omg.PortableServer.POAManager; //导入依赖的package包/类
public void shutdown( boolean waitForCompletion )
{
    // It is important to copy the list of POAManagers first because
    // pm.deactivate removes itself from poaManagers!
    Iterator managers = null ;
    synchronized (this) {
        isShuttingDown = true ;
        managers = (new HashSet(poaManagers)).iterator();
    }

    while ( managers.hasNext() ) {
        try {
            ((POAManager)managers.next()).deactivate(true, waitForCompletion);
        } catch ( org.omg.PortableServer.POAManagerPackage.AdapterInactive e ) {}
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:POAFactory.java

示例3: createPoaInstance

import org.omg.PortableServer.POAManager; //导入依赖的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

示例4: the_POAManager

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

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

示例5: gnuPOA

import org.omg.PortableServer.POAManager; //导入依赖的package包/类
/**
 * Create a new abstract POA.
 *
 * @param a_parent the parent of this POA.
 * @param a_name a name for this POA.
 * @param a_manager a manager for this POA. If null, a new
 * {@link gnuPOAManager} will be instantiated.
 * @param a_policies an array of policies that apply to this POA.
 * @param an_orb an ORB for this POA.
 */
public gnuPOA(gnuPOA a_parent, String a_name, POAManager a_manager,
              Policy[] a_policies, ORB_1_4 an_orb
             )
       throws InvalidPolicy
{
  // Add default policies.
  Policy[] all_policies = StandardPolicies.withDefault(a_policies);

  name = a_name;
  parent = a_parent;
  m_orb = an_orb;

  if (a_manager != null)
    m_manager = a_manager;
  else
    m_manager = new gnuPOAManager();

  if (m_manager instanceof gnuPOAManager)
    {
      gnuPOAManager g = (gnuPOAManager) m_manager;
      g.addPoa(this);
    }

  m_policies = new HashSet(all_policies.length);

  s_policies = new Policy[ all_policies.length ];
  for (int i = 0; i < s_policies.length; i++)
    {
      s_policies [ i ] = all_policies [ i ].copy();
      m_policies.add(((AccessiblePolicy) s_policies [ i ]).getValue());
    }

  retain_servant = applies(ServantRetentionPolicyValue.RETAIN);

  validatePolicies(a_policies);

  refTemplate = new RefTemplate();
}
 
开发者ID:vilie,项目名称:javify,代码行数:49,代码来源:gnuPOA.java

示例6: gnuPOA

import org.omg.PortableServer.POAManager; //导入依赖的package包/类
/**
 * Create a new abstract POA.
 *
 * @param a_parent the parent of this POA.
 * @param a_name a name for this POA.
 * @param a_manager a manager for this POA. If null, a new
 * {@link gnuPOAManager} will be instantiated.
 * @param a_policies an array of policies that apply to this POA.
 * @param an_orb an ORB for this POA.
 */
public gnuPOA(gnuPOA a_parent, String a_name, POAManager a_manager,
              Policy[] a_policies, ORB_1_4 an_orb
             )
       throws InvalidPolicy
{
  // Add default policies.
  Policy[] all_policies = StandardPolicies.withDefault(a_policies);

  name = a_name;
  parent = a_parent;
  m_orb = an_orb;

  if (a_manager != null)
    m_manager = a_manager;
  else
    m_manager = new gnuPOAManager();

  if (m_manager instanceof gnuPOAManager)
    {
      gnuPOAManager g = (gnuPOAManager) m_manager;
      g.addPoa(this);
    }

  m_policies = new HashSet(all_policies.length);

  s_policies = new Policy[ all_policies.length ];
  for (int i = 0; i < s_policies.length; i++)
    {
      s_policies [ i ] = all_policies [ i ].copy();
      m_policies.add(((AccessiblePolicy) s_policies [ i ]).getValue());
    }

  retain_servant = applies(ServantRetentionPolicyValue.RETAIN);

  validatePolicies(a_policies);
  
  refTemplate = new RefTemplate();
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:49,代码来源:gnuPOA.java

示例7: create_POA

import org.omg.PortableServer.POAManager; //导入依赖的package包/类
/**
 * <code>create_POA</code>
 * <b>Section 3.3.8.2</b>
 */
public POA create_POA(String name, POAManager
    theManager, Policy[] policies) throws AdapterAlreadyExists,
    InvalidPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling create_POA(name=" + name +
                " theManager=" + theManager + " policies=" + policies +
                ") on poa " + this ) ;
        }

        // We cannot create children of a POA that is (being) destroyed.
        // This has been added to the CORBA 3.0 spec.
        if (state > STATE_RUN)
            throw omgLifecycleWrapper().createPoaDestroy() ;

        POAImpl poa = (POAImpl)(children.get(name)) ;

        if (poa == null) {
            poa = new POAImpl( name, this, getORB(), STATE_START ) ;
        }

        try {
            poa.lock() ;

            if (debug) {
                ORBUtility.dprint( this,
                    "Calling create_POA: new poa is " + poa ) ;
            }

            if ((poa.state != STATE_START) && (poa.state != STATE_INIT))
                throw new AdapterAlreadyExists();

            POAManagerImpl newManager = (POAManagerImpl)theManager ;
            if (newManager == null)
                newManager = new POAManagerImpl( manager.getFactory(),
                    manager.getPIHandler() );

            int defaultCopierId =
                getORB().getCopierManager().getDefaultId() ;
            Policies POAPolicies =
                new Policies( policies, defaultCopierId ) ;

            poa.initialize( newManager, POAPolicies ) ;

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

示例8: removePoaManager

import org.omg.PortableServer.POAManager; //导入依赖的package包/类
public synchronized void removePoaManager( POAManager manager )
{
    poaManagers.remove(manager);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:POAFactory.java


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