Examples of Algorithm


Examples of org.cishell.framework.algorithm.Algorithm

      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

Examples of org.cishell.framework.algorithm.Algorithm

    }

    boolean enabled = false;
   
    if (validSaveFactory) {
      Algorithm algorithm = algorithmFactory.createAlgorithm(
        new Data[] { model },
        new Hashtable<String, Object>(),
        Activator.getCIShellContext());

      if (algorithm != null) {
View Full Code Here

Examples of org.cishell.framework.algorithm.Algorithm

  private class SaveListener implements Listener {
    public void handleEvent(Event event) {
      if (AbstractDataManagerView.this.saveFactory != null) {
        Data data[] = AbstractDataManagerView.this.manager.getSelectedData();
        Algorithm algorithm = AbstractDataManagerView.this.saveFactory.createAlgorithm(
          data, new Hashtable<String, Object>(), Activator.getCIShellContext());

        try {
          algorithm.execute();
        } catch (AlgorithmExecutionException e)  {
          if (AbstractDataManagerView.this.logger != null) {
            AbstractDataManagerView.this.logger.log(
              LogService.LOG_ERROR, e.getMessage(), e);
            e.printStackTrace();
View Full Code Here

Examples of org.cishell.framework.algorithm.Algorithm

  private class ViewListener implements Listener {
    public void handleEvent(Event event) {
      if (AbstractDataManagerView.this.viewFactory != null) {
        Data data[] = AbstractDataManagerView.this.manager.getSelectedData();
        Algorithm algorithm = AbstractDataManagerView.this.viewFactory.createAlgorithm(
          data, new Hashtable<String, Object>(), Activator.getCIShellContext());

        try {
          algorithm.execute();
        } catch (AlgorithmExecutionException e)  {
          if (AbstractDataManagerView.this.logger != null) {
            AbstractDataManagerView.this.logger.log(
              LogService.LOG_ERROR, e.getMessage(), e);
          } else {
View Full Code Here

Examples of org.cishell.framework.algorithm.Algorithm

     * @see org.cishell.framework.algorithm.AlgorithmFactory#createAlgorithm(org.cishell.framework.data.Data[], java.util.Dictionary, org.cishell.framework.CIShellContext)
     */
    public Algorithm createAlgorithm(Data[] dm, Dictionary parameters,
            final CIShellContext context) {
       
        Algorithm algorithm = new Algorithm() {
            public Data[] execute() {
                if (server == null) {
                    startServer(context);
                } else {
                    stopServer(context);
View Full Code Here

Examples of org.cishell.framework.algorithm.Algorithm

  /**
     * @see org.cishell.service.conversion.Converter#convert(org.cishell.framework.data.Data)
     */
    public Data convert(Data inData) throws ConversionException {
        AlgorithmFactory factory = getAlgorithmFactory();
        Algorithm algorithm = factory.createAlgorithm(new Data[]{inData}, new Hashtable<String, Object>(), ciContext);

        Data[] resultDataArray;
        try {
          resultDataArray = algorithm.execute();
    } catch (AlgorithmExecutionException e) {
      e.printStackTrace();
      throw new ConversionException(e.getMessage(), e);
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

Examples of org.cishell.framework.algorithm.Algorithm

     * @see org.cishell.framework.algorithm.AlgorithmFactory#createAlgorithm(org.cishell.framework.data.Data[], java.util.Dictionary, org.cishell.framework.CIShellContext)
     */
    public Algorithm createAlgorithm(Data[] dm, final Dictionary parameters,
            final CIShellContext context) {
       
        Algorithm alg = new Algorithm() {
            public Data[] execute() {
                String host = (String) parameters.get("org.cishell.reference.remoting.frontend.client.host");
                int port = ((Integer) parameters.get("org.cishell.reference.remoting.frontend.client.port")).intValue();
               
                new ClientInstanceAlg(bContext, context).connect(host, port);
View Full Code Here

Examples of org.cishell.framework.algorithm.Algorithm

            for (int ii = 0; ii < serviceReferences.size(); ii++) {
                AlgorithmFactory factory =
                  bContext.getService(serviceReferences.get(ii));
               
                if (factory != null) {
                    Algorithm algorithm = factory.createAlgorithm(
                      convertedData, this.parameters, this.ciShellContext);
                   
                    try {
                      convertedData = algorithm.execute();
                    } catch(AlgorithmExecutionException e) {
                      boolean isLastStep = (ii == serviceReferences.size() - 1);
                      if (isLastStep && isHandler(serviceReferences.get(ii))) {
                        /* If the last step of the converter chain is a
                         * handler and it is the first (and so only) step
View Full Code Here

Examples of org.cishell.framework.algorithm.Algorithm

    Set keys = algorithmToGuiItemMap.keySet();

    tableItemToAlgorithmMap = Collections.synchronizedMap(new Hashtable());

    for (Iterator i = keys.iterator(); i.hasNext();) {
      Algorithm algorithm = (Algorithm) i.next();
      SchedulerTableItem schedulerTableItem = (SchedulerTableItem) algorithmToGuiItemMap
          .get(algorithm);
      schedulerTableItem.initTableEntry(table, 0);

      TableItem tableItem = schedulerTableItem.getTableItem();
View Full Code Here

Examples of org.cishell.framework.algorithm.Algorithm

    private void removeSelection() {
    TableItem[] tableItems = table.getSelection();
    for (int i = 0; i < tableItems.length; ++i) {
      for (Iterator j = algorithmToGuiItemMap.keySet().iterator(); j
          .hasNext();) {
        Algorithm algorithm = (Algorithm) j.next();
        SchedulerTableItem schedulerTableItem = (SchedulerTableItem) algorithmToGuiItemMap
            .get(algorithm);
        if (tableItems[i].equals(schedulerTableItem.getTableItem())) {
          if (algorithmIsProgressTrackable(algorithm)) {
            ProgressMonitor monitor = ((ProgressTrackable) algorithm)
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.