Class VinciCasProcessorDeployer

java.lang.Object
org.apache.uima.collection.impl.cpm.container.deployer.vinci.VinciCasProcessorDeployer
All Implemented Interfaces:
CasProcessorDeployer

public class VinciCasProcessorDeployer extends Object implements CasProcessorDeployer
Reference implementation of CasProcessorDeployer This component enables the CPE to deploy Cas Processors running as a Vinci service. Two deployment models are supported in the current implementation:
  • managed deployment (aka local)
  • unmanaged deployment (aka remote)
Managed deployment gives the CPE control over the life cycle of the Cas Processor. The CPE starts, restarts and shuts down the Cas Processor running as a Vinci service. This service is launched on the same machine as the CPE but in a seperate process. Unmanaged deployment does not provide the CPE control over the Cas Processor that may be running on a remote machine. The CPE assumes that such Cas Processor is managed by a separate application and is always available. For the managed deployment the CPE uses its internal VNS (Vinci Naming Service) to which Cas Processor must connect to. The VNS issues a port for the Cas Processor to run on and creates a proxy to it. For unmanaged Cas Processor the CPE creates a proxy to remote service. The remote Cas Processor service is discovered with help of VNS running on a host and port defined in the Cpe descriptor for this Cas Processor.
  • Field Details

    • LOCAL_VNS

      public static final String LOCAL_VNS
      The Constant LOCAL_VNS.
      See Also:
    • WAIT_TIME

      public static final int WAIT_TIME
      The Constant WAIT_TIME.
      See Also:
    • MAX_WAIT_TRIES

      public static final int MAX_WAIT_TRIES
      The Constant MAX_WAIT_TRIES.
      See Also:
    • CONN_RETRY_COUNT

      public static final String CONN_RETRY_COUNT
      The Constant CONN_RETRY_COUNT.
      See Also:
    • DEFAULT_VNS_PORT

      public static final String DEFAULT_VNS_PORT
      The Constant DEFAULT_VNS_PORT.
      See Also:
    • DEFAULT_SERVICE_PORT

      public static final int DEFAULT_SERVICE_PORT
      The Constant DEFAULT_SERVICE_PORT.
      See Also:
    • DEFAULT_SERVICE_PORT_RANGE

      public static final int DEFAULT_SERVICE_PORT_RANGE
      The Constant DEFAULT_SERVICE_PORT_RANGE.
      See Also:
    • SLEEP_TIME

      public static final int SLEEP_TIME
      The Constant SLEEP_TIME.
      See Also:
  • Constructor Details

    • VinciCasProcessorDeployer

      public VinciCasProcessorDeployer(CPEFactory aCpeFactory)
      Instantiaes the class and gives it access to CPE configuration.
      Parameters:
      aCpeFactory - the a cpe factory
  • Method Details

    • deployCasProcessor

      public ProcessingContainer deployCasProcessor(List aCasProcessorList, CPMEngine aEngine, boolean redeploy) throws ResourceConfigurationException
      Deploys integrated Cas Processor. Number of instances this routine actually deploys depends on number of processing threads defined in the CPE descriptor. There is one instance per processing thread created here. The aCasProcessorList contains instantiated Cas Processors. These are instantiated by the CPEFactory.
      Parameters:
      aCasProcessorList - - list containing instantiated Cas Processors
      aEngine - the a engine
      redeploy - - true when redeploying failed Cas Processor
      Returns:
      - ProcessingContainer containing pool of CasProcessors
      Throws:
      ResourceConfigurationException - the resource configuration exception
    • deployCasProcessor

      public void deployCasProcessor(ProcessingContainer aProcessingContainer) throws ResourceConfigurationException
      Deploys CasProcessor using configuration from provided container. This method is used for re-launching failed Cas Processor.
      Specified by:
      deployCasProcessor in interface CasProcessorDeployer
      Parameters:
      aProcessingContainer - - container for deployed CasProcessor.
      Throws:
      ResourceConfigurationException - the resource configuration exception
    • deployCasProcessor

      public ProcessingContainer deployCasProcessor(List aCasProcessorList, boolean redeploy) throws ResourceConfigurationException
      Deploys CasProcessors in a provided List. The List contains instances of Cas Processors that are not yet bound to a vinci service. To do anything usefull, the Cas Processor must be deployed first. The process of deploying a proxy depends on the deployment mode defined in the cpe descriptor. In case of managed Cas Processor, the deployment consists of launching the vinci service and creating a connection to it. For un-managed Cas Processor the CPE establishes the connection.
      Specified by:
      deployCasProcessor in interface CasProcessorDeployer
      Parameters:
      aCasProcessorList - - list of CasProcessors to deploy
      redeploy - - true if intent is to redeploy failed service
      Returns:
      ProcessinContainer - instance of Container
      Throws:
      ResourceConfigurationException - the resource configuration exception
    • undeploy

      public void undeploy() throws CasProcessorDeploymentException
      Shutdown local VNS.
      Specified by:
      undeploy in interface CasProcessorDeployer
      Throws:
      CasProcessorDeploymentException - the cas processor deployment exception
    • undeploy

      public void undeploy(URL aURL) throws CasProcessorDeploymentException
      Specified by:
      undeploy in interface CasProcessorDeployer
      Throws:
      CasProcessorDeploymentException