本文整理汇总了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: POAManagerImpl
/**
* Constructor.
*
* @param orb
* The ORB.
*/
public POAManagerImpl(es.tid.TIDorbj.core.TIDORB orb)
{
m_orb = orb;
synchronized (orb.m_POAManagers) {
orb.m_POAManagers.addElement(this);
}
m_manager_name = "POAManager " + st_serial.inc();
m_state = State.HOLDING;
m_state_mutex = new Boolean(true);
m_conf = new POAManagerConf(orb.m_conf.poa_min_threads,
orb.m_conf.poa_max_threads,
orb.m_conf.poa_max_queued_requests,
orb.m_conf.poa_starving_time);
m_completion = new CompletionWaiter(orb);
m_poas = new Vector();
m_pool = new ThreadPool(this);
m_conf.setListener(m_pool);
m_request_queue = new RequestQueue(this, m_pool, new TemporalRequestComparator());
m_pool.minThreadsHasChanged();
m_queue_order = ORDER_TEMPORAL.value;
}
示例2: 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
}
}
示例3: POAManagerImpl
POAManagerImpl( POAFactory factory, PIHandler pihandler )
{
this.factory = factory ;
factory.addPoaManager(this);
this.pihandler = pihandler ;
myId = factory.newPOAManagerId() ;
state = State.HOLDING;
debug = factory.getORB().poaDebugFlag ;
explicitStateChange = false ;
if (debug) {
ORBUtility.dprint( this, "Creating POAManagerImpl " + this ) ;
}
}
示例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 ) ;
}
}
}
示例5: 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();
}
示例6: 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();
}