本文整理汇总了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();
}
}
示例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();
}
}
示例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();
}
}
}
示例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
}
}
示例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
}
}
示例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());
}
示例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();
}
示例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();
}
示例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());
}
示例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();
}
示例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();
}
示例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 ) ;
}
}
}
}
示例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 ) ;
}
}
}
}
示例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();
}
}