Package org.cishell.framework.algorithm

Examples of org.cishell.framework.algorithm.AlgorithmFactory


        String pid = (String) props.get(Constants.SERVICE_PID);
        props.put(Constants.SERVICE_PID, pid + ".remote."+host);
       
        props.put(AlgorithmProperty.REMOTE, host);
       
        AlgorithmFactory factory = algFactoryReg.getAlgorithmFactory(servicePID);
       
        if (props != null && factory != null) {
            ServiceRegistration reg = bContext.registerService(
                    AlgorithmFactory.class.getName(), factory, props);
           
View Full Code Here


    String algorithmLabel = "";
    if (serviceReference != null) {
      algorithmLabel = (String) serviceReference
          .getProperty(AlgorithmProperty.LABEL);
    }
    AlgorithmFactory factory = (AlgorithmFactory) Activator.getContext()
        .getService(serviceReference);

    String pid = (String) serviceReference
        .getProperty(Constants.SERVICE_PID);
View Full Code Here

    for (Enumeration e = parameters.keys(); e.hasMoreElements();) {
      String key = (String) e.nextElement();
      Object value = parameters.get(key);
    }

    AlgorithmFactory factory = (AlgorithmFactory) Activator.getContext()
        .getService(serviceReference);

    Algorithm algo = factory.createAlgorithm(inputData, parameters,
        Activator.getCiShellContext());
    if (algo instanceof ProgressTrackable) {
      ProgressTrackable pt = (ProgressTrackable) algo;
      pt.setProgressMonitor(new AlgorithmProgressMonitor());
    }
View Full Code Here

    /**
     * @see org.cishell.remoting.service.framework.AlgorithmFactoryRegistry#createAlgorithm(String, long, Vector, Hashtable)
     */
    public String createAlgorithm(String sessionID, String servicePID,
            Vector dataModelIDs, Hashtable dictionary) {
        AlgorithmFactory factory = getAlgorithmFactory(servicePID);
       
        AlgorithmRegistry algReg = (AlgorithmRegistry) algRegistry.getService();
        MetaTypeProviderRegistry mtpReg = (MetaTypeProviderRegistry) mtpRegistry.getService();
        DataModelRegistry dmReg = (DataModelRegistry) dmRegistry.getService();
       
        String algID = "-1";
        if (factory != null && algReg != null && mtpReg != null && dmReg != null) {
            Data[] dm = dmReg.getDataModels(dataModelIDs);
           
            CIShellContext ciContext = null;
            synchronized (sidToContextMap) {
                ciContext = (CIShellContext) sidToContextMap.get(sessionID);
               
                if (ciContext == null) {
                    ciContext = new RemoteCIShellContext(bContext, sessionID);
                    sidToContextMap.put(sessionID, ciContext);
                }
            }
           
            //TODO: should parse the given hashtable since values may need to
            //be changed to different types (Vector->String[], etc...)
            Algorithm alg = factory.createAlgorithm(dm, dictionary, ciContext);
            if (alg != null) {
                algID = algReg.registerAlgorithm(alg);
            }
        }
       
View Full Code Here

   
    /**
     * @see org.cishell.remoting.service.framework.AlgorithmFactoryRegistry#createParameters(long, Vector)
     */
    public String createParameters(String servicePID, Vector dataModelIDs) {
        AlgorithmFactory factory = getAlgorithmFactory(servicePID);
       
        AlgorithmRegistry algReg = (AlgorithmRegistry) algRegistry.getService();
        MetaTypeProviderRegistry mtpReg = (MetaTypeProviderRegistry) mtpRegistry.getService();
        DataModelRegistry dmReg = (DataModelRegistry) dmRegistry.getService();
       
View Full Code Here

            return null;
        }
    }
   
    public AlgorithmFactory getAlgorithmFactory(String serviceID) {
        AlgorithmFactory factory = null;
       
        try {
            String filter = "(" + Constants.SERVICE_PID + "=" + serviceID + ")";
           
            ServiceReference[] refs =
View Full Code Here

      throw new AlgorithmNotFoundException(invalidSyntaxException);
    }

      if (algorithmFactoryReferences != null && algorithmFactoryReferences.length != 0) {
        ServiceReference algorithmFactoryReference = algorithmFactoryReferences[0];
        AlgorithmFactory algorithmFactory = (AlgorithmFactory)bundleContext.getService(
          algorithmFactoryReference);

        return algorithmFactory;
      }
      else {
View Full Code Here

     
      if (supportingValidators == null) {
        throw new FileLoadException(String.format(
          "The file %s cannot be loaded as type %s.", file.getName(), mimeType));
      } else {
        AlgorithmFactory validator =
          (AlgorithmFactory) bundleContext.getService(supportingValidators[0]);

        return loadFileOfType(
          bundleContext, ciShellContext, logger, progressMonitor, file, validator);
      }
View Full Code Here

    if ((files != null) && (files.length != 0)) {
      Collection<Data> finalLabeledFileData = new ArrayList<Data>();

      for (File file : files) {
        try {
          AlgorithmFactory validator =
            getValidatorFromUser(bundleContext, window, display, file);

//          Data[] validatedFileData = validateFile(
//            bundleContext,
//            ciShellContext,
View Full Code Here

 
  public Data[] execute(
      Data[] input, Hashtable<String, Object> parameters, CIShellContext ciShellContext)
      throws AlgorithmExecutionException {

    AlgorithmFactory converterFactory =
      (AlgorithmFactory) this.bundleContext.getService(this.serviceReference);
    Algorithm converter = converterFactory.createAlgorithm(input, parameters, ciShellContext);
    Data[] output = converter.execute();
   
    return output;
  }
View Full Code Here

TOP

Related Classes of org.cishell.framework.algorithm.AlgorithmFactory

Copyright © 2018 www.massapicom. 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.