Examples of CasProcessorRunInSeperateProcess


Examples of org.apache.uima.collection.metadata.CasProcessorRunInSeperateProcess

    }
    return new ArrayList(); // empty list
  }

  public void removeExecEnv(int aIndex) throws CpeDescriptorException {
    CasProcessorRunInSeperateProcess rip = getRunInSeparateProcess();
    if (rip != null) {
      CasProcessorExecutable exe = rip.getExecutable();
      if (exe != null) {
        if (aIndex > exe.getEnvs().size()) {
          return;
        }
        exe.getEnvs().remove(aIndex);
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorRunInSeperateProcess

      }
    }
  }

  public void setExecutable(String aCasProcessorExecutable) throws CpeDescriptorException {
    CasProcessorRunInSeperateProcess rip = getRunInSeparateProcess();
    if (rip != null) {
      CasProcessorExecutable exe = rip.getExecutable();
      if (exe != null) {
        exe.setExecutable(aCasProcessorExecutable);
      }
    }
  }
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorRunInSeperateProcess

      }
    }
  }

  public String getExecutable() throws CpeDescriptorException {
    CasProcessorRunInSeperateProcess rip = getRunInSeparateProcess();
    if (rip != null) {
      CasProcessorExecutable exe = rip.getExecutable();
      if (exe != null) {
        return exe.getExecutable();
      }
    }
    return null;
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorRunInSeperateProcess

   * (non-Javadoc)
   *
   * @see org.apache.uima.collection.metadata.CpeLocalCasProcessor#setIsJava(boolean)
   */
  public void setIsJava(boolean aJava) throws CpeDescriptorException {
    CasProcessorRunInSeperateProcess rip = getRunInSeparateProcess();
    if (rip != null) {

      CasProcessorExecutable exe = rip.getExecutable();
      if (exe != null && aJava) {
        exe.setExecutable("java");
      }
    }
  }
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorRunInSeperateProcess

   * @param aJaxbCasProcessorConfig -
   *          configuration object containing Cas Processor configuration
   */
  private void addIsJavaProcess(CpeCasProcessor aCasProcessorConfig) {
    isJavaProcess = false;
    CasProcessorRunInSeperateProcess runInProcessType = aCasProcessorConfig
            .getRunInSeparateProcess();
    if (runInProcessType != null && runInProcessType.getExecutable() != null
            && "java".equals(runInProcessType.getExecutable().getExecutable().trim())) {
      isJavaProcess = true;
    }
  }
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorRunInSeperateProcess

        } catch (Exception e) {
          throw new ResourceConfigurationException(e);
        }
      }
    }
    CasProcessorRunInSeperateProcess rsp = null;
    if ((rsp = aCasProcessorConfig.getRunInSeparateProcess()) != null
            && rsp.getExecutable() != null) {
      // List args = rsp.getExecutable().getArg();
      if (deploymentParameters == null) {
        deploymentParameters = new ArrayList();
      }
    }
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorRunInSeperateProcess

   */
  protected void addApplicationInfo(CasProcessorConfiguration aCasProcessorConfiguration,
          CpeCasProcessor aCasProcessor) throws ResourceConfigurationException {
    try {
      if (aCasProcessor instanceof CpeLocalCasProcessor) {
        CasProcessorRunInSeperateProcess rip = ((CpeLocalCasProcessor) aCasProcessor)
                .getRunInSeperateProcess();
        if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
          UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
                  "+++++++++++++++++++++++++++++++++++++++++++++++++");
          UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
                  "+++++++++++++++++++++++++++++++++++++++++++++++++");
          UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
                  "Operating System is::::" + System.getProperty("os.name"));
          UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
                  "+++++++++++++++++++++++++++++++++++++++++++++++++");
          UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
                  "+++++++++++++++++++++++++++++++++++++++++++++++++");
        }
        executable = rip.getExecutable().getExecutable();
        List<CasProcessorRuntimeEnvParam> descrptrEnvVars = rip.getExecutable().getEnvs();

        exec = new Execute();

        try {
          sysEnvVars = SystemEnvReader.getEnvVars();
          if (System.getProperty("DEBUG") != null) {
            printSysEnvironment();
          }
        } catch (Throwable e) {
          e.printStackTrace();
        }

        environment.clear();
        boolean pathDone = false;
        boolean classpathDone = false;
       
        if (descrptrEnvVars != null) {

          // First copy all env vars from the CPE Descriptor treating PATH and CLASSPATH as special
          // cases
         
          for (CasProcessorRuntimeEnvParam descrptrEv : descrptrEnvVars) {
            String key = descrptrEv.getEnvParamName();
            String value = descrptrEv.getEnvParamValue();

            // Special Cases for PATH and CLASSPATH
            if (key.equalsIgnoreCase("PATH")) {
              String path = getSysEnvVarValue(key);
              if (path != null) {
                environment.add(key + "=" + value + System.getProperty("path.separator") + path);
              } else {
                environment.add(key + "=" + value + System.getProperty("path.separator"));
              }
              pathDone = true;
              continue;
            }

            if (key.equalsIgnoreCase("CLASSPATH")) {
              String classpath = getSysEnvVarValue(key);
              if (classpath != null) {
                environment.add(key + "=" + value + System.getProperty("path.separator")
                        + classpath);
              } else {
                environment.add(key + "=" + value + System.getProperty("path.separator"));
              }
              classpathDone = true;
              continue;
            }
            environment.add(key + "=" + value);
          }

        }
        // Now, copy all env vars from the current environment
        if (sysEnvVars != null) {
          Enumeration envKeys = sysEnvVars.keys();

          while (envKeys.hasMoreElements()) {
            String key = (String) envKeys.nextElement();
            // Skip those vars that we've already setup above
            if ((key.equalsIgnoreCase("PATH") && pathDone) ||
                (key.equalsIgnoreCase("CLASSPATH") && classpathDone)) {
              continue;
            }
            environment.add(key + "=" + sysEnvVars.getProperty(key));
          }
        }
        String[] envArray = new String[environment.size()];
        environment.toArray(envArray);
        exec.setEnvironment(envArray);
       
        CasProcessorExecArg[] args = rip.getExecutable().getAllCasProcessorExecArgs();
        for (int i = 0; args != null && i < args.length; i++) {
          argList.add(args[i]);
        }

      }
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorRunInSeperateProcess

   * @param aJaxbCasProcessorConfig -
   *          configuration object containing Cas Processor configuration
   */
  private void addIsJavaProcess(CpeCasProcessor aCasProcessorConfig) {
    isJavaProcess = false;
    CasProcessorRunInSeperateProcess runInProcessType = aCasProcessorConfig
            .getRunInSeparateProcess();
    if (runInProcessType != null && runInProcessType.getExecutable() != null
            && "java".equals(runInProcessType.getExecutable().getExecutable().trim())) {
      isJavaProcess = true;
    }
  }
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorRunInSeperateProcess

        } catch (Exception e) {
          throw new ResourceConfigurationException(e);
        }
      }
    }
    CasProcessorRunInSeperateProcess rsp = null;
    if ((rsp = aCasProcessorConfig.getRunInSeparateProcess()) != null
            && rsp.getExecutable() != null) {
      // List args = rsp.getExecutable().getArg();
      if (deploymentParameters == null) {
        deploymentParameters = new ArrayList();
      }
    }
View Full Code Here

Examples of org.apache.uima.collection.metadata.CasProcessorRunInSeperateProcess

   * @param aJaxbCasProcessorConfig -
   *          configuration object containing Cas Processor configuration
   */
  private void addIsJavaProcess(CpeCasProcessor aCasProcessorConfig) {
    isJavaProcess = false;
    CasProcessorRunInSeperateProcess runInProcessType = aCasProcessorConfig
            .getRunInSeparateProcess();
    if (runInProcessType != null && runInProcessType.getExecutable() != null
            && "java".equals(runInProcessType.getExecutable().getExecutable().trim())) {
      isJavaProcess = true;
    }
  }
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.