Java Code Examples for com.sun.corba.se.impl.orbutil.ORBUtility

Following code examples demonstrate how to use com.sun.corba.se.impl.orbutil.ORBUtilityfrom java. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use com.sun.corba.se.impl.orbutil.ORBUtilityand various code implementation of this class.

          }
          catch (InterruptedException localInterruptedException)
          {
            notify();
            throw localInterruptedException;
          } 


  
  void acquireAll(int paramInt)
    throws InterruptedException
  {
    if (Thread.interrupted()) {
      throw new InterruptedException();
    }
    synchronized (this)
    {
      try
      {
        if (debug) {
          ORBUtility.dprintTrace(this, "acquireAll enter: count=" + paramInt + " holder_=" + ORBUtility.getThreadName(holder_) + " counter_=" + counter_);
        }
        Thread localThread = Thread.currentThread();
        if (holder_ == localThread) {
          throw new INTERNAL("Cannot acquireAll while holding the mutex");
        }
        try
        {
          while (counter_ > 0) {
            wait();
          }
          if (counter_ != 0) {
            throw new INTERNAL("counter not 0 when first acquiring mutex");
          }
          holder_ = localThread;
        }
        catch (InterruptedException localInterruptedException)
        {
          notify();
          throw localInterruptedException;
        }
        counter_ = paramInt;
      }
      finally
      {
        if (debug) {
          ORBUtility.dprintTrace(this, "acquireAll exit: count=" + paramInt + " holder_=" + ORBUtility.getThreadName(holder_) + " counter_=" + counter_);
        }
      }
    }
  } 

  
  public boolean attempt(long paramLong)
    throws InterruptedException
  {
    if (Thread.interrupted()) {
      throw new InterruptedException();
    }
    synchronized (this)
    {
      try
      {
        if (debug) {
          ORBUtility.dprintTrace(this, "attempt enter: msecs=" + paramLong + " holder_=" + ORBUtility.getThreadName(holder_) + " counter_=" + counter_);
        }
        Thread localThread = Thread.currentThread();
        boolean bool1;
        if (counter_ == 0)
        {
          holder_ = localThread;
          counter_ = 1;
          bool1 = true;
          if (debug) {
            ORBUtility.dprintTrace(this, "attempt exit:  holder_=" + ORBUtility.getThreadName(holder_) + " counter_=" + counter_);
          }
          return bool1;
        }
        if (paramLong <= 0L)
        {
          bool1 = false;
          if (debug) {
            ORBUtility.dprintTrace(this, "attempt exit:  holder_=" + ORBUtility.getThreadName(holder_) + " counter_=" + counter_);
          }
          return bool1;
        }
        long l1 = paramLong;
        long l2 = System.currentTimeMillis();
        try
        {
          do
          {
            wait(l1);
            if (counter_ == 0)
            {
              holder_ = localThread;
              counter_ = 1;
              bool2 = true;
              if (debug) {
                ORBUtility.dprintTrace(this, "attempt exit:  holder_=" + ORBUtility.getThreadName(holder_) + " counter_=" + counter_);
              }
              return bool2;
            }
            l1 = paramLong - (System.currentTimeMillis() - l2);
          } while (l1 > 0L);
          boolean bool2 = false;
          if (debug) {
            ORBUtility.dprintTrace(this, "attempt exit:  holder_=" + ORBUtility.getThreadName(holder_) + " counter_=" + counter_);
          }
          return bool2;
        }
        catch (InterruptedException localInterruptedException)
        {
          notify();
          throw localInterruptedException;
        }
        localObject2 = finally;
      }
      finally
      {
        if (debug) {
          ORBUtility.dprintTrace(this, "attempt exit:  holder_=" + ORBUtility.getThreadName(holder_) + " counter_=" + counter_);
        }
      }
    }
  } 

        }
        catch (InterruptedException localInterruptedException)
        {
          notify();
          throw localInterruptedException;
        } 

  
  synchronized int releaseAll()
  {
    try
    {
      if (debug) {
        ORBUtility.dprintTrace(this, "releaseAll enter:  holder_=" + ORBUtility.getThreadName(holder_) + " counter_=" + counter_);
      }
      Thread localThread = Thread.currentThread();
      if (localThread != holder_) {
        throw new INTERNAL("Attempt to releaseAll Mutex by thread not holding the Mutex");
      }
      int i = counter_;
      counter_ = 0;
      holder_ = null;
      notify();
      int j = i;
      return j;
    }
    finally
    {
      if (debug) {
        ORBUtility.dprintTrace(this, "releaseAll exit:  holder_=" + ORBUtility.getThreadName(holder_) + " counter_=" + counter_);
      }
    }
  } 

  
  Element(int paramInt, Object paramObject)
  {
    this.servant = paramObject;
    this.index = paramInt;
  } 

      }
      catch (ForwardRequest localForwardRequest)
      {
        throw new ForwardException(getORB(), forward_reference);
      } 

      }
      if (bool1)
      {
        if (!bool2) {
          throw omgLifecycleWrapper().adapterActivatorException(paramString, poaId.toString());
        }
      } 

  
  public void set_servant(Servant paramServant)
    throws WrongPolicy
  {
  } 

  
  public org.omg.CORBA.Object id_to_reference(byte[] paramArrayOfByte)
    throws ObjectNotActive, WrongPolicy
  {
    try
    {
      lock();
      if (debug) {
        ORBUtility.dprint(this, "Calling id_to_reference(id=" + paramArrayOfByte + ") on poa " + this);
      }
      if (state >= 4) {
        throw lifecycleWrapper().adapterDestroyed();
      }
      Servant localServant = mediator.idToServant(paramArrayOfByte);
      String str = localServant._all_interfaces(this, paramArrayOfByte)[0];
      org.omg.CORBA.Object localObject = makeObject(str, paramArrayOfByte);
      return localObject;
    }
    finally
    {
      unlock();
    }
  } 

  
  private void initialize(POAManagerImpl paramPOAManagerImpl, Policies paramPolicies)
  {
    if (debug) {
      ORBUtility.dprint(this, "Initializing poa " + this + " with POAManager=" + paramPOAManagerImpl + " policies=" + paramPolicies);
    }
    manager = paramPOAManagerImpl;
    paramPOAManagerImpl.addPOA(this);
    mediator = POAPolicyMediatorFactory.create(paramPolicies, this);
    int i = mediator.getServerId();
    int j = mediator.getScid();
    String str = getORB().getORBData().getORBId();
    POAObjectKeyTemplate localPOAObjectKeyTemplate = new POAObjectKeyTemplate(getORB(), j, i, str, poaId);
    if (debug) {
      ORBUtility.dprint(this, "Initializing poa: oktemp=" + localPOAObjectKeyTemplate);
    }
    boolean bool = true;
    initializeTemplate(localPOAObjectKeyTemplate, bool, paramPolicies, null, null, localPOAObjectKeyTemplate.getObjectAdapterId());
    if (state == 0) {
      state = 3;
    } else if (state == 1) {
      state = 2;
    } else {
      throw lifecycleWrapper().illegalPoaStateTrans();
    }
  } 

    
    private boolean prepareForDestruction(POAImpl paramPOAImpl, Set paramSet)
    {
      POAImpl[] arrayOfPOAImpl = null;
      try
      {
        paramPOAImpl.lock();
        if (debug) {
          ORBUtility.dprint(this, "Calling performDestroy on poa " + paramPOAImpl);
        }
        if (state <= 3)
        {
          state = 4;
        }
        else
        {
          if (wait) {
            while (state != 5) {
              try
              {
                beingDestroyedCV.await();
              }
              catch (InterruptedException localInterruptedException) {}
            }
          }
          i = 0;
          return i;
        }
        isDestroying.set(Boolean.TRUE);
        arrayOfPOAImpl = (POAImpl[])children.values().toArray(new POAImpl[0]);
      }
      finally
      {
        paramPOAImpl.unlock();
      }
      for (int i = 0; i < arrayOfPOAImpl.length; i++) {
        performDestroy(arrayOfPOAImpl[i], paramSet);
      }
      return true;
    } 

  
  public org.omg.CORBA.Object servant_to_reference(Servant paramServant)
    throws ServantNotActive, WrongPolicy
  {
    try
    {
      lock();
      if (debug) {
        ORBUtility.dprint(this, "Calling servant_to_reference(servant=" + paramServant + ") on poa " + this);
      }
      byte[] arrayOfByte = mediator.servantToId(paramServant);
      String str = paramServant._all_interfaces(this, arrayOfByte)[0];
      org.omg.CORBA.Object localObject = create_reference_with_id(arrayOfByte, str);
      return localObject;
    }
    finally
    {
      unlock();
    }
  } 

  
  public POA find_POA(String paramString, boolean paramBoolean)
    throws AdapterNonExistent
  {
    POAImpl localPOAImpl = null;
    AdapterActivator localAdapterActivator = null;
    lock();
    if (debug) {
      ORBUtility.dprint(this, "Calling find_POA(name=" + paramString + " activate=" + paramBoolean + ") on poa " + this);
    }
    localPOAImpl = (POAImpl)children.get(paramString);
    if (localPOAImpl != null)
    {
      if (debug) {
        ORBUtility.dprint(this, "Calling find_POA: found poa " + localPOAImpl);
      }
      try
      {
        localPOAImpl.lock();
        unlock();
        if (!localPOAImpl.waitUntilRunning()) {
          throw omgLifecycleWrapper().poaDestroyed();
        }
      }
      finally
      {
        localPOAImpl.unlock();
      }
    }
    else
    {
      try
      {
        if (debug) {
          ORBUtility.dprint(this, "Calling find_POA: no poa found");
        }
        if ((paramBoolean) && (activator != null))
        {
          localPOAImpl = new POAImpl(paramString, this, getORB(), 1);
          if (debug) {
            ORBUtility.dprint(this, "Calling find_POA: created poa " + localPOAImpl);
          }
          localAdapterActivator = activator;
        }
        else
        {
          throw new AdapterNonExistent();
        }
      }
      finally
      {
        unlock();
      }
    }
    if (localAdapterActivator != null)
    {
      boolean bool1 = false;
      boolean bool2 = false;
      if (debug) {
        ORBUtility.dprint(this, "Calling find_POA: calling AdapterActivator");
      }
      try
      {
        synchronized (localAdapterActivator)
        {
          bool1 = localAdapterActivator.unknown_adapter(this, paramString);
        }
      }
      catch (SystemException localSystemException)
      {
        throw omgLifecycleWrapper().adapterActivatorException(localSystemException, paramString, poaId.toString());
      }
      catch (Throwable localThrowable)
      {
        lifecycleWrapper().unexpectedException(localThrowable, toString());
        if ((localThrowable instanceof ThreadDeath)) {
          throw ((ThreadDeath)localThrowable);
        }
      }
      finally
      {
        bool2 = localPOAImpl.destroyIfNotInitDone();
      }
      if (bool1)
      {
        if (!bool2) {
          throw omgLifecycleWrapper().adapterActivatorException(paramString, poaId.toString());
        }
      }
      else
      {
        if (debug) {
          ORBUtility.dprint(this, "Calling find_POA: AdapterActivator returned false");
        }
        throw new AdapterNonExistent();
      }
    }
    return localPOAImpl;
  } 

  
  public org.omg.CORBA.Object create_reference(String paramString)
    throws WrongPolicy
  {
    try
    {
      lock();
      if (debug) {
        ORBUtility.dprint(this, "Calling create_reference(repId=" + paramString + ") on poa " + this);
      }
      org.omg.CORBA.Object localObject = makeObject(paramString, mediator.newSystemId());
      return localObject;
    }
    finally
    {
      unlock();
    }
  } 

  
  public void getInvocationServant(OAInvocationInfo paramOAInvocationInfo)
  {
    try
    {
      lock();
      if (debug) {
        ORBUtility.dprint(this, "Calling getInvocationServant on poa " + this);
      }
      Object localObject1 = null;
      try
      {
        localObject1 = mediator.getInvocationServant(paramOAInvocationInfo.id(), paramOAInvocationInfo.getOperation());
      }
      catch (ForwardRequest localForwardRequest)
      {
        throw new ForwardException(getORB(), forward_reference);
      }
      paramOAInvocationInfo.setServant(localObject1);
    }
    finally
    {
      if (debug) {
        ORBUtility.dprint(this, "Exiting getInvocationServant on poa " + this);
      }
      unlock();
    }
  } 

  
  private boolean waitUntilRunning()
  {
    if (debug) {
      ORBUtility.dprint(this, "Calling waitUntilRunning on poa " + this);
    }
    while (state < 3) {
      try
      {
        adapterActivatorCV.await();
      }
      catch (InterruptedException localInterruptedException) {}
    }
    if (debug) {
      ORBUtility.dprint(this, "Exiting waitUntilRunning on poa " + this);
    }
    return state == 3;
  } 

  
  public Servant id_to_servant(byte[] paramArrayOfByte)
    throws ObjectNotActive, WrongPolicy
  {
    try
    {
      lock();
      if (debug) {
        ORBUtility.dprint(this, "Calling id_to_servant(id=" + paramArrayOfByte + ") on poa " + this);
      }
      if (state >= 4) {
        throw lifecycleWrapper().adapterDestroyed();
      }
      Servant localServant = mediator.idToServant(paramArrayOfByte);
      return localServant;
    }
    finally
    {
      unlock();
    }
  } 

    
    private void completeDestruction(POAImpl paramPOAImpl1, POAImpl paramPOAImpl2, Set paramSet)
    {
      if (debug) {
        ORBUtility.dprint(this, "Calling completeDestruction on poa " + paramPOAImpl1);
      }
      try
      {
        while (invocationCount != 0) {
          try
          {
            invokeCV.await();
          }
          catch (InterruptedException localInterruptedException) {}
        }
        if (mediator != null)
        {
          if (etherealize) {
            mediator.etherealizeAll();
          }
          mediator.clearAOM();
        }
        if (manager != null) {
          manager.removePOA(paramPOAImpl1);
        }
        if (paramPOAImpl2 != null) {
          children.remove(name);
        }
        paramSet.add(paramPOAImpl1.getAdapterTemplate());
      }
      catch (Throwable localThrowable)
      {
        if ((localThrowable instanceof ThreadDeath)) {
          throw ((ThreadDeath)localThrowable);
        }
        paramPOAImpl1.lifecycleWrapper().unexpectedException(localThrowable, paramPOAImpl1.toString());
      }
      finally
      {
        state = 5;
        beingDestroyedCV.broadcast();
        isDestroying.set(Boolean.FALSE);
        if (debug) {
          ORBUtility.dprint(this, "Exiting completeDestruction on poa " + paramPOAImpl1);
        }
      }
    } 

  
  public Servant reference_to_servant(org.omg.CORBA.Object paramObject)
    throws ObjectNotActive, WrongPolicy, WrongAdapter
  {
    try
    {
      lock();
      if (debug) {
        ORBUtility.dprint(this, "Calling reference_to_servant(reference=" + paramObject + ") on poa " + this);
      }
      if (state >= 4) {
        throw lifecycleWrapper().adapterDestroyed();
      }
      byte[] arrayOfByte = internalReferenceToId(paramObject);
      Servant localServant = mediator.idToServant(arrayOfByte);
      return localServant;
    }
    finally
    {
      unlock();
    }
  } 

  
  private POAImpl(String paramString, POAImpl paramPOAImpl, ORB paramORB, int paramInt)
  {
    super(paramORB);
    debug = poaDebugFlag;
    if (debug) {
      ORBUtility.dprint(this, "Creating POA with name=" + paramString + " parent=" + paramPOAImpl);
    }
    state = paramInt;
    name = paramString;
    parent = paramPOAImpl;
    children = new HashMap();
    activator = null;
    uniquePOAId = getPOAFactory(paramORB).newPOAId();
    if (paramPOAImpl == null)
    {
      numLevels = 1;
    }
    else
    {
      numLevels += 1;
      children.put(paramString, this);
    }
    String[] arrayOfString = new String[numLevels];
    POAImpl localPOAImpl = this;
    int i = numLevels - 1;
    while (localPOAImpl != null)
    {
      arrayOfString[(i--)] = name;
      localPOAImpl = parent;
    }
    poaId = new ObjectAdapterIdArray(arrayOfString);
    invocationCount = 0;
    poaMutex = new ReentrantMutex(poaConcurrencyDebugFlag);
    adapterActivatorCV = new CondVar(poaMutex, poaConcurrencyDebugFlag);
    invokeCV = new CondVar(poaMutex, poaConcurrencyDebugFlag);
    beingDestroyedCV = new CondVar(poaMutex, poaConcurrencyDebugFlag);
    isDestroying = new ThreadLocal()
    {
      protected Object initialValue()
      {
        return Boolean.FALSE;
      }
    };
  } 

  
  public org.omg.CORBA.Object create_reference_with_id(byte[] paramArrayOfByte, String paramString)
  {
    try
    {
      lock();
      if (debug) {
        ORBUtility.dprint(this, "Calling create_reference_with_id(oid=" + paramArrayOfByte + " repId=" + paramString + ") on poa " + this);
      }
      byte[] arrayOfByte = (byte[])paramArrayOfByte.clone();
      org.omg.CORBA.Object localObject = makeObject(paramString, arrayOfByte);
      return localObject;
    }
    finally
    {
      unlock();
    }
  } 

  
  public void returnServant()
  {
    try
    {
      lock();
      if (debug) {
        ORBUtility.dprint(this, "Calling returnServant on poa " + this);
      }
      mediator.returnServant();
    }
    catch (Throwable localThrowable)
    {
      if (debug) {
        ORBUtility.dprint(this, "Exception " + localThrowable + " in returnServant on poa " + this);
      }
      if ((localThrowable instanceof Error)) {
        throw ((Error)localThrowable);
      }
      if ((localThrowable instanceof RuntimeException)) {
        throw ((RuntimeException)localThrowable);
      }
    }
    finally
    {
      if (debug) {
        ORBUtility.dprint(this, "Exiting returnServant on poa " + this);
      }
      unlock();
    }
  } 

    }
    catch (Throwable localThrowable)
    {
      if (debug) {
        ORBUtility.dprint(this, "Exception " + localThrowable + " in returnServant on poa " + this);
      }
      if ((localThrowable instanceof Error)) {
        throw ((Error)localThrowable);
      }
      if ((localThrowable instanceof RuntimeException)) {
        throw ((RuntimeException)localThrowable);
      }
    } 

    
    public void doIt(POAImpl paramPOAImpl, boolean paramBoolean)
    {
      if (debug) {
        ORBUtility.dprint(this, "Calling DestroyThread.doIt(thePOA=" + paramPOAImpl + " wait=" + paramBoolean + " etherealize=" + etherealize);
      }
      thePoa = paramPOAImpl;
      wait = paramBoolean;
      if (paramBoolean)
      {
        run();
      }
      else
      {
        try
        {
          setDaemon(true);
        }
        catch (Exception localException) {}
        start();
      }
    } 

  
  public void activate_object_with_id(byte[] paramArrayOfByte, Servant paramServant)
    throws ObjectAlreadyActive, ServantAlreadyActive, WrongPolicy
  {
    try
    {
      lock();
      if (debug) {
        ORBUtility.dprint(this, "Calling activate_object_with_id on poa " + this + " (servant=" + paramServant + " id=" + paramArrayOfByte + ")");
      }
      byte[] arrayOfByte = (byte[])paramArrayOfByte.clone();
      mediator.activateObject(arrayOfByte, paramServant);
    }
    finally
    {
      if (debug) {
        ORBUtility.dprint(this, "Exiting activate_object_with_id on poa " + this);
      }
      unlock();
    }
  } 

  
  void unlock()
  {
    if (debug) {
      ORBUtility.dprint(this, "UNLOCKED poa " + this);
    }
    poaMutex.release();
  } 

  
  private boolean destroyIfNotInitDone()
  {
    try
    {
      lock();
      if (debug) {
        ORBUtility.dprint(this, "Calling destroyIfNotInitDone on poa " + this);
      }
      DestroyThread localDestroyThread1 = state == 2 ? 1 : 0;
      if (localDestroyThread1 != 0)
      {
        state = 3;
      }
      else
      {
        localDestroyThread2 = new DestroyThread(false, debug);
        localDestroyThread2.doIt(this, true);
      }
      DestroyThread localDestroyThread2 = localDestroyThread1;
      return localDestroyThread2;
    }
    finally
    {
      adapterActivatorCV.broadcast();
      if (debug) {
        ORBUtility.dprint(this, "Exiting destroyIfNotInitDone on poa " + this);
      }
      unlock();
    }
  } 

  
  POAManagerImpl(POAFactory paramPOAFactory, PIHandler paramPIHandler)
  {
    this.factory = paramPOAFactory;
    paramPOAFactory.addPoaManager(this);
    this.pihandler = paramPIHandler;
    this.myId = paramPOAFactory.newPOAManagerId();
    this.state = State.HOLDING;
    this.debug = paramPOAFactory.getORB().poaDebugFlag;
    this.explicitStateChange = false;
    if (this.debug) {
      ORBUtility.dprint(this, "Creating POAManagerImpl " + this);
    }
  } 

  
  synchronized void checkIfActive()
  {
    try
    {
      if (this.debug) {
        ORBUtility.dprint(this, "Calling checkIfActive for POAManagerImpl " + this);
      }
      checkState();
      if (this.debug) {
        ORBUtility.dprint(this, "Exiting checkIfActive for POAManagerImpl " + this);
      }
    }
    finally
    {
      if (this.debug) {
        ORBUtility.dprint(this, "Exiting checkIfActive for POAManagerImpl " + this);
      }
    }
  } 

  
  public synchronized void activate()
    throws AdapterInactive
  {
    this.explicitStateChange = true;
    if (this.debug) {
      ORBUtility.dprint(this, "Calling activate on POAManager " + this);
    }
    try
    {
      if (this.state.value() == 3) {
        throw new AdapterInactive();
      }
      this.state = State.ACTIVE;
      this.pihandler.adapterManagerStateChanged(this.myId, getORTState());
      notifyWaiters();
      if (this.debug) {
        ORBUtility.dprint(this, "Exiting activate on POAManager " + this);
      }
    }
    finally
    {
      if (this.debug) {
        ORBUtility.dprint(this, "Exiting activate on POAManager " + this);
      }
    }
  } 

        }
        if (this.etherealize_objects)
        {
          ??? = null;
          synchronized (this.pmi)
          {
            if (this.debug) {
              ORBUtility.dprint(this, "run: Preparing to etherealize with pmi=" + this.pmi);
            }
            ??? = new HashSet(this.pmi.poas).iterator();
          }
          while (???.hasNext()) {
            ((POAImpl)???.next()).etherealizeAll();
          }
          synchronized (this.pmi)
          {
            if (this.debug) {
              ORBUtility.dprint(this, "run: removing POAManager and clearing poas with pmi=" + this.pmi);
            }
            POAManagerImpl.this.factory.removePoaManager(this.pmi);
            POAManagerImpl.this.poas.clear();
          }
        } 

  
  synchronized void exit()
  {
    try
    {
      if (this.debug) {
        ORBUtility.dprint(this, "Calling exit for POAManagerImpl " + this);
      }
      this.nInvocations -= 1;
      if (this.nInvocations == 0) {
        notifyWaiters();
      }
      if (this.debug) {
        ORBUtility.dprint(this, "Exiting exit for POAManagerImpl " + this);
      }
    }
    finally
    {
      if (this.debug) {
        ORBUtility.dprint(this, "Exiting exit for POAManagerImpl " + this);
      }
    }
  } 

  
  synchronized void enter()
  {
    try
    {
      if (this.debug) {
        ORBUtility.dprint(this, "Calling enter for POAManagerImpl " + this);
      }
      checkState();
      this.nInvocations += 1;
      if (this.debug) {
        ORBUtility.dprint(this, "Exiting enter for POAManagerImpl " + this);
      }
    }
    finally
    {
      if (this.debug) {
        ORBUtility.dprint(this, "Exiting enter for POAManagerImpl " + this);
      }
    }
  } 

    {
      synchronized (this)
      {
        if (this.debug) {
          ORBUtility.dprint(this, "Calling deactivate on POAManager " + this);
        }
        if (this.state.value() == 3) {
          throw new AdapterInactive();
        }
        this.state = State.INACTIVE;
        this.pihandler.adapterManagerStateChanged(this.myId, getORTState());
        notifyWaiters();
      }
      ??? = new POAManagerDeactivator(this, paramBoolean1, this.debug);
      if (paramBoolean2)
      {
        ???.run();
      }
      else
      {
        Thread localThread = new Thread(???);
        localThread.start();
      }
    } 

  
  public synchronized void hold_requests(boolean paramBoolean)
    throws AdapterInactive
  {
    this.explicitStateChange = true;
    if (this.debug) {
      ORBUtility.dprint(this, "Calling hold_requests on POAManager " + this);
    }
    try
    {
      if (this.state.value() == 3) {
        throw new AdapterInactive();
      }
      this.state = State.HOLDING;
      this.pihandler.adapterManagerStateChanged(this.myId, getORTState());
      notifyWaiters();
      if (paramBoolean) {
        while ((this.state.value() == 0) && (this.nInvocations > 0)) {
          countedWait();
        }
      }
      if (this.debug) {
        ORBUtility.dprint(this, "Exiting hold_requests on POAManager " + this);
      }
    }
    finally
    {
      if (this.debug) {
        ORBUtility.dprint(this, "Exiting hold_requests on POAManager " + this);
      }
    }
  } 

      if (paramBoolean) {
        while ((this.state.value() == 0) && (this.nInvocations > 0)) {
          countedWait();
        }
      } 

  
  public synchronized void discard_requests(boolean paramBoolean)
    throws AdapterInactive
  {
    this.explicitStateChange = true;
    if (this.debug) {
      ORBUtility.dprint(this, "Calling hold_requests on POAManager " + this);
    }
    try
    {
      if (this.state.value() == 3) {
        throw new AdapterInactive();
      }
      this.state = State.DISCARDING;
      this.pihandler.adapterManagerStateChanged(this.myId, getORTState());
      notifyWaiters();
      if (paramBoolean) {
        while ((this.state.value() == 2) && (this.nInvocations > 0)) {
          countedWait();
        }
      }
      if (this.debug) {
        ORBUtility.dprint(this, "Exiting hold_requests on POAManager " + this);
      }
    }
    finally
    {
      if (this.debug) {
        ORBUtility.dprint(this, "Exiting hold_requests on POAManager " + this);
      }
    }
  } 

      {
        synchronized (this.pmi)
        {
          if (this.debug) {
            ORBUtility.dprint(this, "Calling run with etherealize_objects=" + this.etherealize_objects + " pmi=" + this.pmi);
          }
          while (this.pmi.nInvocations > 0) {
            POAManagerImpl.this.countedWait();
          }
        }
        if (this.etherealize_objects)
        {
          ??? = null;
          synchronized (this.pmi)
          {
            if (this.debug) {
              ORBUtility.dprint(this, "run: Preparing to etherealize with pmi=" + this.pmi);
            }
            ??? = new HashSet(this.pmi.poas).iterator();
          }
          while (???.hasNext()) {
            ((POAImpl)???.next()).etherealizeAll();
          }
          synchronized (this.pmi)
          {
            if (this.debug) {
              ORBUtility.dprint(this, "run: removing POAManager and clearing poas with pmi=" + this.pmi);
            }
            POAManagerImpl.this.factory.removePoaManager(this.pmi);
            POAManagerImpl.this.poas.clear();
          }
        }
      } 

    }

    public synchronized IOR getIOR()
    {
        if (ior == null) {
            ior = ORBUtility.getIOR( obj ) ;
        }

        return ior ;
    } 

    }

    public synchronized org.omg.CORBA.Object getObject()
    {
        if (obj == null) {
            obj = ORBUtility.makeObjectReference( ior ) ;
        }

        return obj ;
    } 

  
  public org.omg.CORBA.Object make_object(String paramString, byte[] paramArrayOfByte)
  {
    ObjectId localObjectId = IORFactories.makeObjectId(paramArrayOfByte);
    IOR localIOR = getIORFactory().makeIOR(this.orb, paramString, localObjectId);
    return ORBUtility.makeObjectReference(localIOR);
  } 

    }

    protected void dprint(String msg)
    {
        ORBUtility.dprint(toStringName(), msg);
    } 

Advertisement
Javadoc
Handy class full of static functions that don't belong in util.Utility for pure ORB reasons.
Advertisement