Examples of AnalysisEngineController


Examples of org.apache.uima.aae.controller.AnalysisEngineController

    // respones should be thrown away. Well perhaps logged first.
    ErrorContext errorContext = new ErrorContext();
    errorContext.add(AsynchAEMessage.CasReference, aCasReferenceId);
    errorContext.add(AsynchAEMessage.Command, AsynchAEMessage.Process);
    errorContext.add(AsynchAEMessage.Endpoint, anEndpoint);
    AnalysisEngineController controller = getController();
    controller.getErrorHandlerChain().handle(new ExpiredMessageException(), errorContext,
            controller);

  }
View Full Code Here

Examples of org.apache.uima.aae.controller.AnalysisEngineController

            (FileSystemXmlApplicationContext) ctx);
    // Find all deployed Controllers
    String[] controllers = ctx
            .getBeanNamesForType(org.apache.uima.aae.controller.AnalysisEngineController.class);
    for (int i = 0; controllers != null && i < controllers.length; i++) {
      AnalysisEngineController cntlr = (AnalysisEngineController) ctx.getBean(controllers[i]);
      if (cntlr instanceof org.apache.uima.aae.controller.UimacppServiceController) {
        cntlr.addControllerCallbackListener(this);
        topLevelController = cntlr;
      } else {
        // Pass a reference to the context to each of the Controllers
        cntlr.setUimaEEAdminContext(springAdminContext);
        if (cntlr.isTopLevelComponent()) {
          topLevelController = cntlr;
          initializeTopLevelController(cntlr, ctx);
        }
      }
    }
View Full Code Here

Examples of org.apache.uima.aae.controller.AnalysisEngineController

            (FileSystemXmlApplicationContext) ctx);
    // Find all deployed Controllers
    String[] controllers = ctx
            .getBeanNamesForType(org.apache.uima.aae.controller.AnalysisEngineController.class);
    for (int i = 0; controllers != null && i < controllers.length; i++) {
      AnalysisEngineController cntlr = (AnalysisEngineController) ctx.getBean(controllers[i]);
      if (cntlr instanceof org.apache.uima.aae.controller.UimacppServiceController) {
        cntlr.addControllerCallbackListener(this);
        topLevelController = cntlr;
      } else {
        // Pass a reference to the context to each of the Controllers
        cntlr.setUimaEEAdminContext(springAdminContext);
        if (cntlr.isTopLevelComponent()) {
          topLevelController = cntlr;
          initializeTopLevelController(cntlr, ctx);
        }
      }
    }
View Full Code Here

Examples of org.apache.uima.aae.controller.AnalysisEngineController

      if ((monitorCheckpointFrequency = System.getProperty(JmxMonitor.SamplingInterval)) != null) {
        // Found monitor checkpoint frequency parameter, configure and start the monitor.
        // If the monitor fails to initialize the service is not effected.
        service.startMonitor(Long.parseLong(monitorCheckpointFrequency));
      }
      AnalysisEngineController topLevelControllor = serviceDeployer.getTopLevelController();
      String prompt = "Press 'q'+'Enter' to quiesce and stop the service or 's'+'Enter' to stop it now.\nNote: selected option is not echoed on the console.";
      if (topLevelControllor != null) {
        System.out.println(prompt);
        // Loop forever or until the service is stopped
        while (!topLevelControllor.isStopped()) {
          if (System.in.available() > 0) {
            int c = System.in.read();
            if (c == 's') {
              serviceDeployer.undeploy(SpringContainerDeployer.STOP_NOW);
            } else if (c == 'q') {
              serviceDeployer.undeploy(SpringContainerDeployer.QUIESCE_AND_STOP);
            } else if (Character.isLetter(c) || Character.isDigit(c)) {
              System.out.println(prompt);
            }
          }
          // This is a polling loop. Sleep for 1 sec
          try {
          if (!topLevelControllor.isStopped())
              Thread.sleep(1000);
          } catch (InterruptedException ex) {
          }
        } // while
      }
View Full Code Here

Examples of org.apache.uima.aae.controller.AnalysisEngineController

      this.serviceDeployer = serviceDeployer;
    }

    public void run() {
      try {
      AnalysisEngineController topLevelController = serviceDeployer.getTopLevelController();
      if (topLevelController != null && !topLevelController.isStopped() ) {
          System.err.println("Uima AS Service Wrapper Caught Kill Signal - Initiating Quiesce and Stop");
          serviceDeployer.undeploy(SpringContainerDeployer.QUIESCE_AND_STOP);
      }
      } catch( Exception e) {
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
View Full Code Here

Examples of org.apache.uima.aae.controller.AnalysisEngineController

    String[] brokerDeployer = ctx.getBeanNamesForType(org.apache.uima.adapter.jms.activemq.BrokerDeployer.class);
    // Find all deployed Controllers
    String[] controllers = ctx.getBeanNamesForType(org.apache.uima.aae.controller.AnalysisEngineController.class);

    for (int i = 0; controllers != null && i < controllers.length; i++) {
      AnalysisEngineController cntlr = (AnalysisEngineController) ctx.getBean(controllers[i]);
      // Pass a reference to the context to each of the Controllers
      cntlr.setUimaEEAdminContext(springAdminContext);
      if (cntlr.isTopLevelComponent()) {
        initializeTopLevelController( cntlr, ctx);
      }
    }

    String[] cppcontrollers = ctx.getBeanNamesForType(org.apache.uima.aae.controller.UimacppServiceController.class);
    for (int i = 0; cppcontrollers != null && i < cppcontrollers.length; i++) {
      UimacppServiceController cntlr = (UimacppServiceController) ctx.getBean(cppcontrollers[i]);
      // register listener
      cntlr.addControllerCallbackListener(this);
    }
   
    // blocks until the top level controller sends a notification.
    // Notification is send
    // when either the controller successfully initialized or it failed
View Full Code Here

Examples of org.apache.uima.aae.controller.AnalysisEngineController

    // respones should be thrown away. Well perhaps logged first.
    ErrorContext errorContext = new ErrorContext();
    errorContext.add(AsynchAEMessage.CasReference, aCasReferenceId);
    errorContext.add(AsynchAEMessage.Command, AsynchAEMessage.Process);
    errorContext.add(AsynchAEMessage.Endpoint, anEndpoint);
    AnalysisEngineController controller = getController();
    controller.getErrorHandlerChain().handle(new ExpiredMessageException(), errorContext, controller);

  }
View Full Code Here

Examples of org.apache.uima.aae.controller.AnalysisEngineController

    // respones should be thrown away. Well perhaps logged first.
    ErrorContext errorContext = new ErrorContext();
    errorContext.add(AsynchAEMessage.CasReference, aCasReferenceId);
    errorContext.add(AsynchAEMessage.Command, AsynchAEMessage.Process);
    errorContext.add(AsynchAEMessage.Endpoint, anEndpoint);
    AnalysisEngineController controller = getController();
    controller.getErrorHandlerChain().handle(new ExpiredMessageException(), errorContext,
            controller);

  }
View Full Code Here

Examples of org.apache.uima.aae.controller.AnalysisEngineController

        // Found monitor checkpoint frequency parameter, configure and start the monitor.
        // If the monitor fails to initialize the service is not effected.
        service.startMonitor(Long.parseLong(monitorCheckpointFrequency));
      }
     
      AnalysisEngineController topLevelControllor = serviceDeployer.getTopLevelController();
      String prompt = "Press 'q'+'Enter' to quiesce and stop the service or 's'+'Enter' to stop it now.\nNote: selected option is not echoed on the console.";
      if (topLevelControllor != null) {
        System.out.println(prompt);
        // Loop forever or until the service is stopped
        while (!topLevelControllor.isStopped()) {
          if (System.in.available() > 0) {
            int c = System.in.read();
            if (c == 's') {
              service.stopMonitor();
              serviceDeployer.undeploy(SpringContainerDeployer.STOP_NOW);
              System.exit(0);
            } else if (c == 'q') {
              service.stopMonitor();
              serviceDeployer.undeploy(SpringContainerDeployer.QUIESCE_AND_STOP);
              System.exit(0);

            } else if (Character.isLetter(c) || Character.isDigit(c)) {
              System.out.println(prompt);
            }
          }
          // This is a polling loop. Sleep for 1 sec
          try {
          if (!topLevelControllor.isStopped())
              Thread.sleep(1000);
          } catch (InterruptedException ex) {
          }
        } // while
      }
View Full Code Here

Examples of org.apache.uima.aae.controller.AnalysisEngineController

      this.serviceDeployer = serviceDeployer;
    }

    public void run() {
      try {
        AnalysisEngineController topLevelController = serviceDeployer.getTopLevelController();
        if (topLevelController != null && !topLevelController.isStopped() ) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                "run", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                "UIMAJMS_caught_signal__INFO", new Object[] { topLevelController.getComponentName() });
          serviceDeployer.undeploy(SpringContainerDeployer.QUIESCE_AND_STOP);
          Runtime.getRuntime().halt(0);
        }
      } catch( Exception e) {
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
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.