in yoko-core/src/main/java/org/apache/yoko/orb/CORBA/Request.java [562:661]
public boolean poll_response() {
synchronized (stateMutex_) {
if (!pollable_)
throw new org.omg.CORBA.BAD_INV_ORDER(
org.apache.yoko.orb.OB.MinorCodes
.describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorSynchronousRequest),
org.apache.yoko.orb.OB.MinorCodes.MinorSynchronousRequest,
org.omg.CORBA.CompletionStatus.COMPLETED_NO);
if (polling_)
return false; // poll_response in progress
switch (state_) {
case RequestStateUnsent:
case RequestStatePending:
throw new org.omg.CORBA.BAD_INV_ORDER(
org.apache.yoko.orb.OB.MinorCodes
.describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorRequestNotSent),
org.apache.yoko.orb.OB.MinorCodes.MinorRequestNotSent,
org.omg.CORBA.CompletionStatus.COMPLETED_NO);
case RequestStateSent:
break;
case RequestStateReceiving: // get_response in progress
return false;
case RequestStateReceived:
return true;
case RequestStateDone:
throw new org.omg.CORBA.BAD_INV_ORDER(
org.apache.yoko.orb.OB.MinorCodes
.describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorResponseAlreadyReceived),
org.apache.yoko.orb.OB.MinorCodes.MinorResponseAlreadyReceived,
org.omg.CORBA.CompletionStatus.COMPLETED_NO);
}
polling_ = true;
}
org.apache.yoko.orb.OB.Assert._OB_assert(downcallStub_ != null);
org.apache.yoko.orb.OB.Assert._OB_assert(downcall_ != null);
boolean send = false;
try {
RetryInfo info = new RetryInfo();
while (true) {
try {
if (send)
downcallStub_ = delegate_._OB_getDowncallStub(target_);
while (true) {
if (send) {
downcall_ = downcallStub_.createPIDIIDowncall(
operation_, true, arguments_, result_,
exceptions_);
}
try {
if (send) {
marshal();
downcallStub_.deferred(downcall_);
send = false;
}
if (downcallStub_.poll(downcall_)) {
unmarshal();
synchronized (stateMutex_) {
state_ = RequestStateReceived;
polling_ = false;
stateMutex_.notify();
}
return true;
} else {
synchronized (stateMutex_) {
polling_ = false;
stateMutex_.notify();
}
return false;
}
} catch (org.apache.yoko.orb.OB.FailureException ex) {
downcallStub_.handleFailureException(downcall_, ex);
send = true;
}
} // while(true)
} catch (Exception ex) {
delegate_._OB_handleException(target_, ex, info, false);
send = true;
}
} // while(true)
} catch (org.omg.CORBA.SystemException ex) {
Logger logger = delegate_._OB_ORBInstance().getLogger();
logger.log(java.util.logging.Level.FINE, "Exception polling request response", ex);
environment_.exception(ex);
synchronized (stateMutex_) {
state_ = RequestStateReceived;
polling_ = false;
stateMutex_.notify();
}
if (raiseDIIExceptions_)
throw ex;
return true;
}
}