当前位置: 首页>>代码示例>>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: checkState

private void checkState()
{
    while ( state.value() != State._ACTIVE ) {
        switch ( state.value() ) {
            case State._HOLDING:
                while ( state.value() == State._HOLDING ) {
                    countedWait() ;
                }
                break;

            case State._DISCARDING:
                throw factory.getWrapper().poaDiscarding() ;

            case State._INACTIVE:
                throw factory.getWrapper().poaInactive() ;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:POAManagerImpl.java

示例2: stateToString

private String stateToString( State state )
{
    switch (state.value()) {
        case State._HOLDING : return "State[HOLDING]" ;
        case State._ACTIVE : return "State[ACTIVE]" ;
        case State._DISCARDING : return "State[DISCARDING]" ;
        case State._INACTIVE : return "State[INACTIVE]" ;
    }

    return "State[UNKNOWN]" ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:POAManagerImpl.java

示例3: getORTState

public short getORTState()
{
    switch (state.value()) {
        case State._HOLDING    : return HOLDING.value ;
        case State._ACTIVE     : return ACTIVE.value ;
        case State._INACTIVE   : return INACTIVE.value ;
        case State._DISCARDING : return DISCARDING.value ;
        default                : return NON_EXISTENT.value ;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源: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: set_delegate

/**
 * This method is called by RMI-IIOP {@link javax.rmi.Tie#orb(ORB)}, passing
 * <code>this</code> as parameter. The ORB will try to connect that tie as
 * one of its objects, if it is not already connected. If the wrapper is an
 * instance of Servant this method also activates the root poa (if not already
 * active).
 */
public void set_delegate(java.lang.Object wrapper)
{
  if (wrapper instanceof org.omg.CORBA.Object)
    {
      org.omg.CORBA.Object object = (org.omg.CORBA.Object) wrapper;
      if (connected_objects.getKey(object) == null)
        connect(object);
    }
  else if (wrapper instanceof Servant)
    {
      Servant s = (Servant) wrapper;
      if (rootPOA.findServant(s) == null)
        try
          {
            rootPOA.servant_to_reference(s);
            if (rootPOA.the_POAManager().get_state().value() == State._HOLDING)
              rootPOA.the_POAManager().activate();
          }
        catch (Exception e)
          {
            BAD_OPERATION bad = new BAD_OPERATION("Unable to connect "
              + wrapper + " to " + this);
            throw bad;
          }
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:33,代码来源:ORB_1_4.java

示例6: connect

/**
 * Connect when the POA is specified.
 */
public static void connect(Stub self, ORB orb, POA poa)
  throws RemoteException
{
  ORB oorb = null;
  try
    {
      Delegate d = self._get_delegate();
      if (d != null)
        oorb = d.orb(self);
    }
  catch (Exception e)
    {
      // Failed to get Delegate or ORB.
      // (possible ony for user-written Stubs).
    }

  if (oorb != null)
    {
      if (!oorb.equals(orb))
        throw new RemoteException("Stub " + self
          + " is connected to another ORB, " + orb);
      else
        return;
    }

  Tie t = null;
  if (self instanceof Remote)
    t = Util.getTie((Remote) self);

  // Find by name pattern.
  if (t == null)
    t = getTieFromStub(self);

  Delegate delegate;

  if (t instanceof Servant)
    {
      try
        {
          if (poa == null)
            {
              poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
              // Activate if not active.
              if (poa.the_POAManager().get_state().value() == State._HOLDING)
                poa.the_POAManager().activate();
            }

          ObjectImpl obj = (ObjectImpl) poa.servant_to_reference((Servant) t);
          delegate = obj._get_delegate();
        }
      catch (Exception ex)
        {
          throw new Unexpected(ex);
        }
    }
  else if (t instanceof ObjectImpl)
    {
      ObjectImpl o = (ObjectImpl) t;
      orb.connect(o);
      delegate = o._get_delegate();
    }
  else
    throw new BAD_PARAM("The Tie must be either Servant or ObjectImpl");

  self._set_delegate(delegate);
}
 
开发者ID:vilie,项目名称:javify,代码行数:69,代码来源:StubDelegateImpl.java


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