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


Java State.INACTIVE属性代码示例

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


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

示例1: deactivate

/**
 *
 * Turns the asociated POAs into inactive state. The POAs in the incative
 * state will reject new requests. If the POA is once inactivated, it
 * cannot be activated again. The operation is used when
 * the associated POAs are to be shut down.
 *
 * @param etherealize_objects if true, the servant managers of the
 * associated POAs, having RETAIN and USE_SERVANT_MANAGER policies,
 * will receive a call of {@link ServantActivatorOperations#etherealize}.
 *
 * @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 already in the inactive state.
 *
 * @see POAOperations#destroy
 */
public void deactivate(boolean etherealize_objects,
                       boolean wait_for_completion
                      )
                throws AdapterInactive
{
  if (state == State.INACTIVE)
    throw new AdapterInactive("Repetetive inactivation");
  state = State.INACTIVE;

  notifyInterceptors(state.value());

  if (wait_for_completion)
    waitForIdle();

  Iterator iter = POAs.iterator();
  while (iter.hasNext())
    {
      gnuPOA poa = (gnuPOA) iter.next();

      // If the servant activator is non null, this means it has been
      // set - hence the policies are appropriate.
      if (poa.servant_activator != null)
        poa.etherealizeAll();
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:44,代码来源:gnuPOAManager.java

示例2: deactivate

/**
 *
 * Turns the asociated POAs into inactive state. The POAs in the incative
 * state will reject new requests. If the POA is once inactivated, it
 * cannot be activated again. The operation is used when
 * the associated POAs are to be shut down.
 *
 * @param etherealize_objects if true, the servant managers of the
 * associated POAs, having RETAIN and USE_SERVANT_MANAGER policies,
 * will receive a call of {@link ServantActivatorOperations#etherealize}.
 *
 * @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 already in the inactive state.
 *
 * @see POAOperations#destroy
 */
public void deactivate(boolean etherealize_objects,
                       boolean wait_for_completion
                      )
                throws AdapterInactive
{
  if (state == State.INACTIVE)
    throw new AdapterInactive("Repetetive inactivation");
  state = State.INACTIVE;
  
  notifyInterceptors(state.value());    
  
  if (wait_for_completion)
    waitForIdle();

  Iterator iter = POAs.iterator();
  while (iter.hasNext())
    {
      gnuPOA poa = (gnuPOA) iter.next();

      // If the servant activator is non null, this means it has been
      // set - hence the policies are appropriate.
      if (poa.servant_activator != null)
        poa.etherealizeAll();
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:44,代码来源:gnuPOAManager.java

示例3: activate

/**
 * This operation changes the POA manager to ACTIVE.
 * 
 * @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive
 *                If POA manager state is INACTIVE.
 */
public void activate()
    throws org.omg.PortableServer.POAManagerPackage.AdapterInactive
{
    // State change -> ACTIVE
    synchronized (m_state_mutex) {
        if (m_state == State.INACTIVE) {
            throw new AdapterInactive();
        }
        if (m_state != State.ACTIVE) {
            m_completion.stopWaiting();
            m_state = State.ACTIVE;
            m_state_mutex.notifyAll();
        }
    }
}
 
开发者ID:AlvaroVega,项目名称:TIDorbJ,代码行数:21,代码来源:POAManagerImpl.java

示例4: 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

示例5: discard_requests

/**
 * This operation changes the POA manager to DISCARDING.
 * 
 * @param wait_for_completion
 *            Wait-for-completion flag.
 * @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive
 *                If POA manager state is INACTIVE.
 */
public void discard_requests(boolean wait_for_completion)
    throws org.omg.PortableServer.POAManagerPackage.AdapterInactive
{
    // State change -> DISCARDING
    synchronized (m_state_mutex) {
        if (m_state == State.INACTIVE) {
            throw new AdapterInactive();
        }
        if (m_state != State.DISCARDING) {
            m_completion.stopWaiting();
            m_state = State.DISCARDING;
            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

示例6: activate

/**
 * Turns the associated POAs into active state, allowing them to receive
 * and process requests.
 *
 * @throws AdapterInactive if the POAs are in the inactive state.
 * If once inactivated, the POA cannot be activated again. This
 * method can only be called to leave the holding or discarding state.
 */
public void activate()
              throws AdapterInactive
{
  if (state != State.INACTIVE)
    state = State.ACTIVE;
  else
    throw new AdapterInactive();

  notifyInterceptors(state.value());
}
 
开发者ID:vilie,项目名称:javify,代码行数:18,代码来源:gnuPOAManager.java

示例7: 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

示例8: discard_requests

/**
 * Turns the associated POAs into discaring state. In this state, the POAs
 * discard the incoming requests. This mode is used in situations when
 * the server is flooded with requests. The client receives remote exception
 * ({@link org.omg.CORBA.TRANSIENT}, minor code 1).
 *
 * @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 discard_requests(boolean wait_for_completion)
                      throws AdapterInactive
{
  if (state != State.INACTIVE)
    state = State.DISCARDING;
  else
    throw new AdapterInactive();

  notifyInterceptors(state.value());

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

示例9: activate

/**
 * Turns the associated POAs into active state, allowing them to receive
 * and process requests.
 *
 * @throws AdapterInactive if the POAs are in the inactive state.
 * If once inactivated, the POA cannot be activated again. This
 * method can only be called to leave the holding or discarding state.
 */
public void activate()
              throws AdapterInactive
{
  if (state != State.INACTIVE)
    state = State.ACTIVE;
  else
    throw new AdapterInactive();
  
  notifyInterceptors(state.value());    
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:18,代码来源:gnuPOAManager.java

示例10: 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

示例11: discard_requests

/**
 * Turns the associated POAs into discaring state. In this state, the POAs
 * discard the incoming requests. This mode is used in situations when
 * the server is flooded with requests. The client receives remote exception
 * ({@link org.omg.CORBA.TRANSIENT}, minor code 1).
 *
 * @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 discard_requests(boolean wait_for_completion)
                      throws AdapterInactive
{
  if (state != State.INACTIVE)
    state = State.DISCARDING;
  else
    throw new AdapterInactive();
  
  notifyInterceptors(state.value());    
  
  if (wait_for_completion)
    waitForIdle();
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:25,代码来源:gnuPOAManager.java

示例12: deactivate

/**
 * <code>deactivate</code>
 * <b>Spec: pages 3-14 thru 3-18</b>
 * Note: INACTIVE is a permanent state.
 */

public void deactivate(boolean etherealize_objects, boolean wait_for_completion)
    throws org.omg.PortableServer.POAManagerPackage.AdapterInactive
{
    explicitStateChange = true ;

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

            if ( state.value() == State._INACTIVE )
                throw new org.omg.PortableServer.POAManagerPackage.AdapterInactive();

            state = State.INACTIVE;

            pihandler.adapterManagerStateChanged( myId, getORTState() ) ;

            // Notify any invocations that were waiting because the previous
            // state was HOLDING. Those invocations will then be rejected with
            // an OBJ_ADAPTER exception. Also notify any threads that were waiting
            // inside hold_requests() or discard_requests().
            notifyWaiters();
        }

        POAManagerDeactivator deactivator = new POAManagerDeactivator( this,
            etherealize_objects, debug ) ;

        if (wait_for_completion)
            deactivator.run() ;
        else {
            Thread thr = new Thread(deactivator) ;
            thr.start() ;
        }
    } finally {
        synchronized(this) {
            if (debug) {
                ORBUtility.dprint( this,
                    "Exiting deactivate on POAManager " + this ) ;
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:50,代码来源:POAManagerImpl.java

示例13: deactivate

/**
 * <code>deactivate</code>
 * <b>Spec: pages 3-14 thru 3-18</b>
 * Note: INACTIVE is a permanent state.
 */

public void deactivate(boolean etherealize_objects, boolean wait_for_completion)
    throws org.omg.PortableServer.POAManagerPackage.AdapterInactive
{
    explicitStateChange = true ;

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

            if ( state.value() == State._INACTIVE )
                throw new org.omg.PortableServer.POAManagerPackage.AdapterInactive();

            state = State.INACTIVE;

            pihandler.adapterManagerStateChanged( myId, getORTState() ) ;

            // Notify any invocations that were waiting because the previous
            // state was HOLDING. Those invocations will then be rejected with
            // an OBJ_ADAPTER exception. Also notify any threads that were waiting
            // inside hold_requests() or discard_requests().
            notifyWaiters();
        }

        POAManagerDeactivator deactivator = new POAManagerDeactivator( this,
            etherealize_objects, debug ) ;

        if (wait_for_completion)
            deactivator.run() ;
        else {
            Thread thr = new Thread(null, deactivator, "POA-Deactivator-Thread", 0, false) ;
            thr.start() ;
        }
    } finally {
        synchronized(this) {
            if (debug) {
                ORBUtility.dprint( this,
                    "Exiting deactivate on POAManager " + this ) ;
            }
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:50,代码来源:POAManagerImpl.java

示例14: deactivate

/**
 * This operation changes the POA manager to DEACTIVATE.
 * 
 * @param etherealize_object
 *            If it is true, then all objects must be etherealized.
 * @param wait_for_completion
 *            Wait-for-completion flag.
 * @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive
 *                If POA manager state is INACTIVE.
 */
public void deactivate(boolean etherealize_objects,
                       boolean wait_for_completion)
    throws org.omg.PortableServer.POAManagerPackage.AdapterInactive
{

    // State change -> INACTIVE
    synchronized (m_state_mutex) {
        if (m_state == State.INACTIVE) {
            throw new AdapterInactive();
        }

        // reset the last completion waiters
        m_completion.stopWaiting();

        m_pool.deactivation();

        m_request_queue.deactivation();

        m_state = State.INACTIVE;
        synchronized (m_orb.m_POAManagers) {
            for (int i = 0; i < m_orb.m_POAManagers.size(); i++) {
                if (m_orb.m_POAManagers.elementAt(i) == this)
                    m_orb.m_POAManagers.removeElementAt(i);
            }
        }
    }

    // Wait for completion, if necessary
    if (wait_for_completion && m_completion.conditionToWait()) {
        m_completion.waitForCompletion(); //synchronized
        if (etherealize_objects) {
            // Etherealize objects (blocking)
            etherealizeAllPOAs();
        }
    } else if (etherealize_objects) {
        // Etherealize in background
        EtherealizerThread t = new EtherealizerThread(this);
        t.start();
    }
}
 
开发者ID:AlvaroVega,项目名称:TIDorbJ,代码行数:50,代码来源:POAManagerImpl.java


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