use of org.alfresco.filesys.repo.ResultCallback in project alfresco-repository by Alfresco.
the class ScenarioOpenFileInstance method newOpenFileCallbackCommand.
/**
* Called for open file.
*/
private ResultCallback newOpenFileCallbackCommand() {
return new ResultCallback() {
@Override
public void execute(Object result) {
if (result instanceof NetworkFile) {
// Now update the state of this scenario - we have an open fileHandle
NetworkFile fileHandle = (NetworkFile) result;
state = InternalState.OPEN;
if (isReadOnly(fileHandle)) {
openReadOnlyCount++;
fileHandleReadOnly = fileHandle;
if (logger.isDebugEnabled()) {
logger.debug("file opened read only:" + result + ", name:" + name);
}
} else {
openReadWriteCount++;
fileHandleReadWrite = fileHandle;
if (logger.isDebugEnabled()) {
logger.debug("file opened read write :" + result + ", name:" + name);
}
}
}
}
@Override
public TxnReadState getTransactionRequired() {
return TxnReadState.TXN_NONE;
}
};
}
Aggregations