Examples of AFrame


Examples of org.apache.vinci.transport.document.AFrame

   * @see CasObjectProcessor#batchProcessComplete(org.apache.uima.util.ProcessTrace)
   */
  public void callBatchProcessComplete() throws ResourceServiceException {
    try {
      // create Vinci Frame ( Data Cargo)
      AFrame queryFrame = new AFrame();
      // Add Vinci Command, so that the receiving service knows what to do
      queryFrame.fadd("vinci:COMMAND", Constants.BATCH_PROCESS_COMPLETE);

      mVinciClient.send(queryFrame); // oneway call
    } catch (Exception e) {
      throw new ResourceServiceException(e);
    }
View Full Code Here

Examples of org.apache.vinci.transport.document.AFrame

   * @see CasObjectProcessor#collectionProcessComplete(org.apache.uima.util.ProcessTrace)
   */
  public void callCollectionProcessComplete() throws ResourceServiceException {
    try {
      // create Vinci Frame ( Data Cargo)
      AFrame queryFrame = new AFrame();
      // Add Vinci Command, so that the receiving service knows what to do
      queryFrame.fadd("vinci:COMMAND", Constants.COLLECTION_PROCESS_COMPLETE);

      // make RPC call (no return val)
      mVinciClient.rpc(queryFrame, mTimeout);
    } catch (Exception e) {
      throw new ResourceServiceException(e);
View Full Code Here

Examples of org.apache.vinci.transport.document.AFrame

   * @see CasObjectProcessor#isReadOnly()
   */
  public boolean callIsReadOnly() throws ResourceServiceException {
    try {
      // create Vinci Frame ( Data Cargo)
      AFrame queryFrame = new AFrame();
      // Add Vinci Command, so that the receiving service knows what to do
      queryFrame.fadd("vinci:COMMAND", Constants.IS_READONLY);

      // make RPC call
      VinciFrame resultFrame = mVinciClient.rpc(queryFrame);
      boolean result = resultFrame.fgetBoolean("Result");
      return result;
View Full Code Here

Examples of org.apache.vinci.transport.document.AFrame

   * @see CasObjectProcessor#isStateless()
   */
  public boolean callIsStateless() throws ResourceServiceException {
    try {
      // create Vinci Frame ( Data Cargo)
      AFrame queryFrame = new AFrame();
      // Add Vinci Command, so that the receiving service knows what to do
      queryFrame.fadd("vinci:COMMAND", Constants.IS_STATELESS);

      // make RPC call
      VinciFrame resultFrame = mVinciClient.rpc(queryFrame);
      boolean result = resultFrame.fgetBoolean("Result");
      return result;
View Full Code Here

Examples of org.apache.vinci.transport.document.AFrame

  }

  public List callGetSupportedXCasVersions() throws ResourceServiceException {
    try {
      // create Vinci Frame ( Data Cargo)
      AFrame queryFrame = new AFrame();
      // Add Vinci Command, so that the receiving service knows what to do
      queryFrame.fadd("vinci:COMMAND", Constants.GET_SUPPORTED_XCAS_VERSIONS);

      // make RPC call
      VinciFrame resultFrame = mVinciClient.rpc(queryFrame);
      String result = resultFrame.fgetString("Result");
      if (result != null) {
View Full Code Here

Examples of org.apache.vinci.transport.document.AFrame

  /**
   * @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);
      }
View Full Code Here

Examples of org.apache.vinci.transport.document.AFrame

   * @see AnalysisEngineServiceStub#callBatchProcessComplete()
   */
  public void callBatchProcessComplete() throws ResourceServiceException {
    try {
      // create Vinci Frame ( Data Cargo)
      AFrame queryFrame = new AFrame();
      // Add Vinci Command, so that the receiving service knows what to do
      queryFrame.fadd("vinci:COMMAND", Constants.BATCH_PROCESS_COMPLETE);

      mVinciClient.send(queryFrame); // oneway call
    } catch (Exception e) {
      throw new ResourceServiceException(e);
    }
View Full Code Here

Examples of org.apache.vinci.transport.document.AFrame

   * @see AnalysisEngineServiceStub#callCollectionProcessComplete()
   */
  public void callCollectionProcessComplete() throws ResourceServiceException {
    try {
      // create Vinci Frame ( Data Cargo)
      AFrame queryFrame = new AFrame();
      // Add Vinci Command, so that the receiving service knows what to do
      queryFrame.fadd("vinci:COMMAND", Constants.COLLECTION_PROCESS_COMPLETE);

      // make RPC call (return val ignored)
      mVinciClient.rpc(queryFrame, mTimeout);
    } catch (Exception e) {
      throw new ResourceServiceException(e);
View Full Code Here

Examples of org.apache.vinci.transport.document.AFrame

  private Frame getMetaData() throws Exception {
    UIMAFramework.getLogger().log(Level.FINEST, "VinciAnalysisEngineService.getMetaData()");
    // get metadata
    ProcessingResourceMetaData md = mAE.getProcessingResourceMetaData();
    // convert to vinci frame
    AFrame response = new AFrame();
    SaxVinciFrameBuilder vinciFrameBuilder = new SaxVinciFrameBuilder();
    vinciFrameBuilder.setParentFrame(response);
    vinciFrameBuilder.startDocument();
    md.toXML(vinciFrameBuilder);
    vinciFrameBuilder.endDocument();
View Full Code Here

Examples of org.apache.vinci.transport.document.AFrame

        mAE.collectionProcessComplete();
        return new VinciFrame(); // no return value - return empty
        // frame
      } else if (Constants.IS_STATELESS.equals(op)) {
        ct.cleanup();
        return new AFrame().fadd("Result", mAE.isStateless());
      } else if (Constants.IS_READONLY.equals(op)) {
        ct.cleanup();
        return new AFrame().fadd("Result", mAE.isReadOnly());
      } else if (Constants.GET_SUPPORTED_XCAS_VERSIONS.equals(op)) {
        return new AFrame().fadd("Result", Constants.SUPPORTED_XCAS_VERSIONS_RESPONSE);
      } else if (Constants.SHUTDOWN.equals(op)) {
        stop();
        System.exit(1);
      }
      ct.cleanup();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.