/** * Activate the POAManager if no explicit state change has ever been previously invoked. */ public synchronized void implicitActivation() { if (!explicitStateChange) try { activate(); } catch (org.omg.PortableServer.POAManagerPackage.AdapterInactive ai) { // ignore the exception. } } }
/**************************************************************************** * The following methods are used on the invocation path. ****************************************************************************/ // called from POA.find_POA before calling AdapterActivator.unknown_adapter. synchronized void checkIfActive() { try { if (debug) { ORBUtility.dprint(this, "Calling checkIfActive for POAManagerImpl " + this); } checkState(); } finally { if (debug) { ORBUtility.dprint(this, "Exiting checkIfActive for POAManagerImpl " + this); } } }
public int getManagerId() { return manager.getManagerId(); }
pihandler.adapterManagerStateChanged(myId, getORTState()); notifyWaiters(); countedWait();
newManager = new POAManagerImpl(manager.getFactory(), manager.getPIHandler());
/** * <code>activate</code> <b>Spec: pages 3-14 thru 3-18</b> */ public synchronized void activate() throws org.omg.PortableServer.POAManagerPackage.AdapterInactive { explicitStateChange = true; if (debug) { ORBUtility.dprint(this, "Calling activate on POAManager " + this); } try { if (state.value() == State._INACTIVE) throw new org.omg.PortableServer.POAManagerPackage.AdapterInactive(); // set the state to ACTIVE state = State.ACTIVE; pihandler.adapterManagerStateChanged(myId, getORTState()); // Notify any invocations that were waiting because the previous state was HOLDING, as well as notify any // threads that were waiting inside hold_requests() or discard_requests(). notifyWaiters(); } finally { if (debug) { ORBUtility.dprint(this, "Exiting activate on POAManager " + this); } } }
protected void deactivateHelper(ActiveObjectMap.Key key, AOMEntry entry, Servant s) throws ObjectNotActive, WrongPolicy { // Default does nothing, but the USE_SERVANT_MANAGER case must handle etherealization activeObjectMap.remove(key); if (Util.instance != null) { POAManagerImpl pm = (POAManagerImpl) poa.the_POAManager(); POAFactory factory = pm.getFactory(); factory.unregisterPOAForServant(poa, s); } }
static POAImpl makeRootPOA(ORB orb) { POAManagerImpl poaManager = new POAManagerImpl(getPOAFactory(orb), orb.getPIHandler()); POAImpl result = new POAImpl(ORBConstants.ROOT_POA_NAME, null, orb, STATE_START); result.initialize(poaManager, Policies.rootPOAPolicies); return result; }
public short getState() { return manager.getORTState(); }
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(); } } }
public void exit() { try { lock(); if (debug) { ORBUtility.dprint(this, "Calling exit on poa " + this); } invocationCount--; if ((invocationCount == 0) && (state == STATE_DESTROYING)) { invokeCV.broadcast(); } } finally { if (debug) { ORBUtility.dprint(this, "Exiting exit on poa " + this); } unlock(); } manager.exit(); }
manager.addPOA(this);
pihandler.adapterManagerStateChanged(myId, getORTState()); notifyWaiters(); countedWait();
newManager = new POAManagerImpl(manager.getFactory(), manager.getPIHandler());
/** * <code>activate</code> <b>Spec: pages 3-14 thru 3-18</b> */ public synchronized void activate() throws org.omg.PortableServer.POAManagerPackage.AdapterInactive { explicitStateChange = true; if (debug) { ORBUtility.dprint(this, "Calling activate on POAManager " + this); } try { if (state.value() == State._INACTIVE) throw new org.omg.PortableServer.POAManagerPackage.AdapterInactive(); // set the state to ACTIVE state = State.ACTIVE; pihandler.adapterManagerStateChanged(myId, getORTState()); // Notify any invocations that were waiting because the previous state was HOLDING, as well as notify any // threads that were waiting inside hold_requests() or discard_requests(). notifyWaiters(); } finally { if (debug) { ORBUtility.dprint(this, "Exiting activate on POAManager " + this); } } }
protected void deactivateHelper(ActiveObjectMap.Key key, AOMEntry entry, Servant s) throws ObjectNotActive, WrongPolicy { // Default does nothing, but the USE_SERVANT_MANAGER case must handle etherealization activeObjectMap.remove(key); if (Util.instance != null) { POAManagerImpl pm = (POAManagerImpl) poa.the_POAManager(); POAFactory factory = pm.getFactory(); factory.unregisterPOAForServant(poa, s); } }
static POAImpl makeRootPOA(ORB orb) { POAManagerImpl poaManager = new POAManagerImpl(getPOAFactory(orb), orb.getPIHandler()); POAImpl result = new POAImpl(ORBConstants.ROOT_POA_NAME, null, orb, STATE_START); result.initialize(poaManager, Policies.rootPOAPolicies); return result; }
public short getState() { return manager.getORTState(); }
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(); } } }