use of alma.ACSErr.CompletionHolder in project ACS by ACS-Community.
the class RWCommonComparablePropertyImpl method incrementImpl.
/**
* Increment action implementation.
* @throws AcsJException thown on any failure.
*/
protected Completion incrementImpl() throws AcsJException {
CompletionHolder completionHolder = CompletionUtil.createCompletionHolder();
Object currentValue = getSync(completionHolder);
// TODO completion error (type != 0) check
// increment
Object incrementedValue = sum(currentValue, minStep, false);
return setSync(incrementedValue);
}
use of alma.ACSErr.CompletionHolder in project ACS by ACS-Community.
the class HistoryMonitorImpl method retrieveValueAndDispatch.
/**
* Retrieve property value via cached <code>mnemonicValue</code>
* and add response to the history buffer.
* @see alma.ACS.CommonMonitor#retrieveValueAndDispatch(long, boolean)
*/
protected void retrieveValueAndDispatch(long keyTime, boolean done) {
// create new holder (done expeditiously)
CompletionHolder completionHolder = CompletionUtil.createCompletionHolder();
// retrieve value
Object value = property.mnemonicValue(keyTime, completionHolder);
// TODO check completion error state - what do to then?
// add to history
property.addValueToHistory(value, completionHolder.value.timeStamp);
}
use of alma.ACSErr.CompletionHolder in project ACS by ACS-Community.
the class EnumPropertyTest method testSetNonBlockingSync.
public void testSetNonBlockingSync() {
RWproperty.set_nonblocking(States.SHUTDOWN);
// check value
CompletionHolder completionHolder = new CompletionHolder();
States value = RWproperty.get_sync(completionHolder);
assertEquals(States.SHUTDOWN, value);
}
use of alma.ACSErr.CompletionHolder in project ACS by ACS-Community.
the class PropertyDoubleTest method testSetAsync.
public void testSetAsync() {
CBvoidImpl cb = new CBvoidImpl();
CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
synchronized (cb) {
RWproperty.set_async(500.0, cb._this(orb), descIn);
try {
// wait for 5s
cb.wait(5000);
} catch (InterruptedException ie) {
}
}
// only 1 response is expected
//assertEquals(1, cb.getResponseQueue().size());
//CBResponse response = (CBResponse)cb.getResponseQueue().firstElement();
// check reponse type
//assertEquals(CBResponse.DONE_TYPE, response.type);
// check value
// TODO check value
CompletionHolder completionHolder = new CompletionHolder();
double value = RWproperty.get_sync(completionHolder);
assertEquals(500.0, value, 0.0);
}
use of alma.ACSErr.CompletionHolder in project ACS by ACS-Community.
the class PropertyDoubleTest method testGetSync.
public void testGetSync() {
CompletionHolder completionHolder = new CompletionHolder();
// TODO check value
/*double value =*/
ROproperty.get_sync(completionHolder);
//assertEquals(property.default_value(), value, 0.0);
assertEquals(0, completionHolder.value.code);
assertEquals(0, completionHolder.value.type);
assertEquals(0, completionHolder.value.previousError.length);
// less than 5s
assertTrue((UTCUtility.utcJavaToOmg(System.currentTimeMillis()) - completionHolder.value.timeStamp) < 50000000);
}
Aggregations