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


Java State.HOLDING属性代码示例

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


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

示例1: POAManagerImpl

/**
 * Constructor.
 * 
 * @param orb
 *            The ORB.
 */
public POAManagerImpl(es.tid.TIDorbj.core.TIDORB orb)
{
    m_orb = orb;
    synchronized (orb.m_POAManagers) {
        orb.m_POAManagers.addElement(this);
    }
    m_manager_name = "POAManager " + st_serial.inc();
    m_state = State.HOLDING;
    m_state_mutex = new Boolean(true);
    m_conf = new POAManagerConf(orb.m_conf.poa_min_threads,
                                orb.m_conf.poa_max_threads,
                                orb.m_conf.poa_max_queued_requests,
                                orb.m_conf.poa_starving_time);
    m_completion = new CompletionWaiter(orb);
    m_poas = new Vector();
    m_pool = new ThreadPool(this);
    m_conf.setListener(m_pool);
    m_request_queue = new RequestQueue(this, m_pool, new TemporalRequestComparator());
    m_pool.minThreadsHasChanged();
    m_queue_order = ORDER_TEMPORAL.value;
    
}
 
开发者ID:AlvaroVega,项目名称:TIDorbJ,代码行数:28,代码来源:POAManagerImpl.java

示例2: hold_requests

/**
 * This operation changes the POA manager to HOLDING.
 * 
 * @param wait_for_completion
 *            Wait-for-completion flag.
 * @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive
 *                If POA manager state is INACTIVE.
 */
public void hold_requests(boolean wait_for_completion)
    throws org.omg.PortableServer.POAManagerPackage.AdapterInactive
{
    // State change -> HOLDING
    synchronized (m_state_mutex) {
        if (m_state == State.INACTIVE) {
            throw new AdapterInactive();
        }
        if (m_state != State.HOLDING) {
            m_completion.stopWaiting();
            m_state = State.HOLDING;
            m_state_mutex.notifyAll();
        }
    }
    // Wait for completion, if necessary
    if (wait_for_completion && m_completion.conditionToWait()) {
        m_completion.waitForCompletion(); // synchronized
    }
}
 
开发者ID:AlvaroVega,项目名称:TIDorbJ,代码行数:27,代码来源:POAManagerImpl.java

示例3: POAManagerImpl

POAManagerImpl( POAFactory factory, PIHandler pihandler )
{
    this.factory = factory ;
    factory.addPoaManager(this);
    this.pihandler = pihandler ;
    myId = factory.newPOAManagerId() ;
    state = State.HOLDING;
    debug = factory.getORB().poaDebugFlag ;
    explicitStateChange = false ;

    if (debug) {
        ORBUtility.dprint( this, "Creating POAManagerImpl " + this ) ;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:POAManagerImpl.java

示例4: hold_requests

/**
 * <code>hold_requests</code>
 * <b>Spec: pages 3-14 thru 3-18</b>
 */
public synchronized void hold_requests(boolean wait_for_completion)
    throws org.omg.PortableServer.POAManagerPackage.AdapterInactive
{
    explicitStateChange = true ;

    if (debug) {
        ORBUtility.dprint( this,
            "Calling hold_requests on POAManager " + this ) ;
    }

    try {
        if ( state.value() == State._INACTIVE )
            throw new org.omg.PortableServer.POAManagerPackage.AdapterInactive();
        // set the state to HOLDING
        state  = State.HOLDING;

        pihandler.adapterManagerStateChanged( myId, getORTState() ) ;

        // Notify any threads that were waiting in the wait() inside
        // discard_requests. This will cause discard_requests to return
        // (which is in conformance with the spec).
        notifyWaiters();

        if ( wait_for_completion ) {
            while ( state.value() == State._HOLDING && nInvocations > 0 ) {
                countedWait() ;
            }
        }
    } finally {
        if (debug) {
            ORBUtility.dprint( this,
                "Exiting hold_requests on POAManager " + this ) ;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:POAManagerImpl.java

示例5: hold_requests

/**
 * Turns the associated POAs into holding state. In this state, the POAs
 * queue incoming requests but do not process them.
 *
 * @param wait_for_completion if true, the method call suspends the current
 * thread till POAs complete the requests they are currently processing. If
 * false, the method returns immediately.

 * @throws AdapterInactive if the POAs are in the inactive state.
 */
public void hold_requests(boolean wait_for_completion)
                   throws AdapterInactive
{
  if (state != State.INACTIVE)
    state = State.HOLDING;
  else
    throw new AdapterInactive();

  notifyInterceptors(state.value());

  if (wait_for_completion)
    waitForIdle();
}
 
开发者ID:vilie,项目名称:javify,代码行数:23,代码来源:gnuPOAManager.java

示例6: hold_requests

/**
 * Turns the associated POAs into holding state. In this state, the POAs
 * queue incoming requests but do not process them.
 *
 * @param wait_for_completion if true, the method call suspends the current
 * thread till POAs complete the requests they are currently processing. If
 * false, the method returns immediately.

 * @throws AdapterInactive if the POAs are in the inactive state.
 */
public void hold_requests(boolean wait_for_completion)
                   throws AdapterInactive
{
  if (state != State.INACTIVE)
    state = State.HOLDING;
  else
    throw new AdapterInactive();
  
  notifyInterceptors(state.value());
  
  if (wait_for_completion)
    waitForIdle();
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:23,代码来源:gnuPOAManager.java


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