Examples of IProcessor


Examples of org.jamesii.core.processor.IProcessor

   * @return the simulation run
   */
  public SimulationRun createProcessor(SimulationRun simulation,
      ParameterBlock parameter) {

    IProcessor proc;

    proc = processorFactory.create(getModel(), simulation, this, parameter, SimSystem.getRegistry().createContext());
    proc.setComputationTask(simulation);
    simulation.setProcessorInfo(new ProcessorInformation(proc));

    try {
      // System.out.println ("after creating the processor
      // "+this.getRemoteModel().getName());
View Full Code Here

Examples of org.jamesii.core.processor.IProcessor

          SimSystem.report(Level.INFO,
              "Running the simulation stepwise is not possible.");
          break;
        }

        IProcessor processor = getProcessor();
        if (processor instanceof IRunnable) {
          ((IRunnable) processor).next(1);
        }
        break;
      }
View Full Code Here

Examples of org.jamesii.core.processor.IProcessor

  @Override
  public void actionPerformed(ActionEvent e) {
    synchronized (this) {
      try {
        IProcessor processor =
            getSimRuntimeInfo().getComputationTask().getProcessorInfo()
                .getLocal();
        IRunnable run = null;
        if (processor instanceof IRunnable) {
          run = (IRunnable) processor;
View Full Code Here

Examples of org.jamesii.core.processor.IProcessor

          n = Integer.valueOf(steps);
        } catch (Exception ex) {
          SimSystem.report(Level.INFO, "No valid step count given!");
        }

        final IProcessor processor = getProcessor();
        final int c = n;
        if (processor instanceof IRunnable) {
          // calling next from separate thread because this is the EDT and next
          // blocks and therefore blocks the EDT
          // TODO next should block "run" and other "next btns"
View Full Code Here

Examples of org.thymeleaf.processor.IProcessor

        if (!orderedSpecificProcessorsByElementName.isEmpty()) {
            logBuilder.line("[THYMELEAF]     * Processors matching nodes by element name [precedence]:");
            for (final Map.Entry<String,Set<ProcessorAndContext>> elementApplicabilityEntry : orderedSpecificProcessorsByElementName.entrySet()) {
                final String elementName = elementApplicabilityEntry.getKey();
                for (final ProcessorAndContext elementProcessorEntry : elementApplicabilityEntry.getValue()) {
                    final IProcessor elementProcessor = elementProcessorEntry.getProcessor();
                    final String precedence =
                            (elementProcessor instanceof AbstractProcessor? Integer.valueOf(((AbstractProcessor)elementProcessor).getPrecedence()).toString() : "-");
                    logBuilder.line("[THYMELEAF]         * \"{}\" [{}]: {}", new Object[] {elementName, precedence, elementProcessor.getClass().getName()});
                }
            }
        }
        if (!orderedSpecificProcessorsByAttributeName.isEmpty()) {
            logBuilder.line("[THYMELEAF]     * Processors matching nodes by element attribute [precedence]:");
            for (final Map.Entry<String,Set<ProcessorAndContext>> attrApplicabilityEntry : orderedSpecificProcessorsByAttributeName.entrySet()) {
                final String attrName = attrApplicabilityEntry.getKey();
                for (final ProcessorAndContext attrProcessorEntry : attrApplicabilityEntry.getValue()) {
                    final IProcessor attrProcessor = attrProcessorEntry.getProcessor();
                    final String precedence =
                            (attrProcessor instanceof AbstractProcessor? Integer.valueOf(((AbstractProcessor)attrProcessor).getPrecedence()).toString() : "-");
                    logBuilder.line("[THYMELEAF]         * \"{}\" [{}]: {}", new Object[] {attrName, precedence, attrProcessor.getClass().getName()});
                }
            }
        }
        if (!nonSpecificProcessorsByNodeClass.isEmpty()) {
            logBuilder.line("[THYMELEAF]     * Processors with non-element-specific matching methods [precedence]:");
            for (final Map.Entry<Class<? extends Node>,Set<ProcessorAndContext>> nonSpecificProcessorEntry : nonSpecificProcessorsByNodeClass.entrySet()) {
                final Class<? extends Node> nodeClass = nonSpecificProcessorEntry.getKey();
                for (final ProcessorAndContext processorEntry : nonSpecificProcessorEntry.getValue()) {
                    final IProcessor processor = processorEntry.getProcessor();
                    final String precedence =
                            (processor instanceof AbstractProcessor? Integer.valueOf(((AbstractProcessor)processor).getPrecedence()).toString() : "-");
                    logBuilder.line(
                            "[THYMELEAF]         * [{}] [{}]: {}",
                            new Object[] {nodeClass.getSimpleName(), precedence, processor.getClass().getName()});
                }
            }
        }
        if (!executionAttributes.isEmpty()) {
            logBuilder.line("[THYMELEAF]     * Execution Attributes:");
View Full Code Here

Examples of tv.ustream.yolo.module.processor.IProcessor

        Map<String, Object> pr3Config = new HashMap<String, Object>();
        pr3Config.put("class", CompositeProcessor.class.getCanonicalName());
        pr3Config.put("processors", Arrays.asList("pr1", "pr2"));

        IProcessor processor3 = new ModuleFactory().createProcessor("pr3", pr3Config);

        when(moduleFactory.createParser(eq("pa1"), anyMap())).thenReturn(parser1);
        when(moduleFactory.createParser(eq("pa2"), anyMap())).thenReturn(parser2);
        when(moduleFactory.createParser(eq("pa3"), anyMap())).thenReturn(null);
        when(moduleFactory.createProcessor(eq("pr1"), anyMap())).thenReturn(processor1);
View Full Code Here

Examples of tv.ustream.yolo.module.processor.IProcessor

    public void createProcessorShouldCreateNewInstance() throws ConfigException
    {
        Map<String, Object> config = new HashMap<String, Object>();
        config.put("class", ConsoleProcessor.class.getCanonicalName());

        IProcessor processor = new ModuleFactory().createProcessor("x", config);

        Assert.assertEquals(ConsoleProcessor.class, processor.getClass());
    }
View Full Code Here

Examples of tv.ustream.yolo.module.processor.IProcessor

    {
        thrown.expect(ConfigException.class);

        Map<String, Object> config = new HashMap<String, Object>();

        IProcessor processor = new ModuleFactory().createProcessor("x", config);

        Assert.assertEquals(ConsoleProcessor.class, processor.getClass());
    }
View Full Code Here

Examples of tv.ustream.yolo.module.processor.IProcessor

    public IProcessor createProcessor(String name, Map<String, Object> rawConfig) throws ConfigException
    {
        PROCESSOR_MODULE_CONFIG.parse(name, rawConfig);

        IProcessor processor = create((String) rawConfig.get("class"));

        setupModule(name, processor, rawConfig);

        return processor;
    }
View Full Code Here

Examples of tv.ustream.yolo.module.processor.IProcessor

        System.out.println("Available processors");
        System.out.println("--------------------");
        System.out.println();
        for (String className : AVAILABLE_PROCESSORS)
        {
            IProcessor module = factory.create(className);
            ConfigMap config = getDefaultProcessorModuleConfig().merge(module.getModuleConfig());
            String usage = "  - params: " + config.getDescription("    ");

            ConfigMap processParamsConfig = module.getProcessParamsConfig();
            String usage2 = "";
            if (processParamsConfig != null && !processParamsConfig.isEmpty())
            {
                usage2 = "  - parser params: " + processParamsConfig.getDescription("    ");
            }

            System.out.format("* %s - %s%n%s%s%n", className, module.getModuleDescription(), usage, usage2);
        }

        System.out.println("Available parsers");
        System.out.println("-----------------");
        System.out.println();
        for (String className : AVAILABLE_PARSERS)
        {
            IParser module = factory.create(className);
            ConfigMap config = getDefaultParserModuleConfig().merge(module.getModuleConfig());
            String usage = "  - params: " + config.getDescription("    ");

            System.out.format("* %s - %s%n%s%n", className, module.getModuleDescription(), usage);
        }
    }
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.