/**
* @see AnalysisEngineServiceStub#callProcess(CAS)
*/
public void callProcess(CAS aCAS) throws ResourceServiceException {
try {
AFrame requestFrame = new AFrame();
requestFrame.fset(Constants.VINCI_COMMAND, Constants.ANNOTATE);
// serialize CAS (including type system)
CASMgr cas = (CASMgr) aCAS;
CASCompleteSerializer serializer = Serialization.serializeCASComplete(cas);
requestFrame.fsetTrueBinary("BinaryCAS", SerializationUtils.serialize(serializer));
AFrame responseFrame = (AFrame) mVinciClient.sendAndReceive(requestFrame, mTimeout);
// deserialize CAS from response frame
byte[] responseCasBytes = responseFrame.fgetTrueBinary("BinaryCAS");
CASSerializer responseSerializer = (CASSerializer) SerializationUtils
.deserialize(responseCasBytes);
((CASImpl) cas).reinit(responseSerializer);
// also read annotation time and enter into AnalysisEngineManagementMBean
int annotationTime = responseFrame.fgetInt(Constants.ANNOTATION_TIME);
if (annotationTime > 0) {
AnalysisEngineManagementImpl mbean = (AnalysisEngineManagementImpl) mOwner
.getManagementInterface();
mbean.reportAnalysisTime(annotationTime);
}