Tabnine Logo
PipelineExecutorRegistry.register
Code IndexAdd Tabnine to your IDE (free)

How to use
register
method
in
org.guvnor.ala.registry.PipelineExecutorRegistry

Best Java code snippets using org.guvnor.ala.registry.PipelineExecutorRegistry.register (Showing top 12 results out of 315)

origin: org.kie.workbench/kie-wb-common-ala-spi

private void updateExecutorRegistry(final PipelineExecutorTaskImpl task) {
  try {
    PipelineExecutorTaskImpl clone = (PipelineExecutorTaskImpl) task.clone();
    pipelineExecutorRegistry.register(new PipelineExecutorTraceImpl(clone));
  } catch (Exception e) {
    //clone is supported by construction, since PipelineExecutorTaskImpl is clonable.
    logger.error("Unexpected error: " + e.getMessage(),
           e);
  }
}
origin: org.guvnor/guvnor-ala-spi

private void updateExecutorRegistry(final PipelineExecutorTaskImpl task) {
  try {
    PipelineExecutorTaskImpl clone = (PipelineExecutorTaskImpl) task.clone();
    pipelineExecutorRegistry.register(new PipelineExecutorTraceImpl(clone));
  } catch (Exception e) {
    //clone is supported by construction, since PipelineExecutorTaskImpl is clonable.
    logger.error("Unexpected error: " + e.getMessage(),
           e);
  }
}
origin: org.guvnor/guvnor-ala-spi

private void verifyExecutorRegistryUpdated(boolean async) {
  if (async) {
    //verify the pipeline executor registry was properly updated.
    verify(pipelineExecutorRegistry,
        times(1)).register(pipelineExecutorTraceCaptor.capture());
    assertHasSameInfo(task,
             pipelineExecutorTraceCaptor.getValue().getTask());
  } else {
    verify(pipelineExecutorRegistry,
        never()).register(anyObject());
  }
}
origin: org.kie.workbench/kie-wb-common-ala-spi

private void verifyExecutorRegistryUpdated(boolean async) {
  if (async) {
    //verify the pipeline executor registry was properly updated.
    verify(pipelineExecutorRegistry,
        times(1)).register(pipelineExecutorTraceCaptor.capture());
    assertHasSameInfo(task,
             pipelineExecutorTraceCaptor.getValue().getTask());
  } else {
    verify(pipelineExecutorRegistry,
        never()).register(anyObject());
  }
}
origin: org.guvnor/guvnor-ala-spi

               times(1)).setTaskInStoppedStatus(task));
verify(pipelineExecutorRegistry,
    times(5)).register(pipelineExecutorTraceCaptor.capture());
Map<String, PipelineExecutorTask> registeredTasks = new HashMap<>();
pipelineExecutorTraceCaptor.getAllValues().forEach(capture -> registeredTasks.put(capture.getTaskId(),
origin: org.kie.workbench/kie-wb-common-ala-spi

               times(1)).setTaskInStoppedStatus(task));
verify(pipelineExecutorRegistry,
    times(5)).register(pipelineExecutorTraceCaptor.capture());
Map<String, PipelineExecutorTask> registeredTasks = new HashMap<>();
pipelineExecutorTraceCaptor.getAllValues().forEach(capture -> registeredTasks.put(capture.getTaskId(),
origin: org.guvnor/guvnor-ala-spi

@Test
public void testStopAsyncTask() throws PipelineExecutorException {
  when(taskManagerHelper.generateTaskId()).thenReturn(TASK_ID);
  taskManager.init();
  //prepare the input parameters.
  prepareExecution();
  Future future = mock(Future.class);
  when(executorService.submit(any(Runnable.class))).thenReturn(future);
  String result = taskManager.execute(taskDef,
                    PipelineExecutorTaskManager.ExecutionMode.ASYNCHRONOUS);
  assertEquals(TASK_ID,
         result);
  PipelineExecutorTaskManagerImpl.TaskEntry taskEntry = taskManager.currentTasks.get(TASK_ID);
  taskManager.stop(TASK_ID);
  verify(future,
      times(1)).cancel(true);
  assertFalse(taskManager.currentTasks.containsKey(TASK_ID));
  verify(taskManagerHelper,
      times(1)).setTaskInStoppedStatus(taskEntry.getTask());
  //verify the pipeline executor registry was properly updated.
  verify(pipelineExecutorRegistry,
      times(2)).register(pipelineExecutorTraceCaptor.capture());
  assertHasSameInfo(pipelineExecutorTraceCaptor.getAllValues().get(1).getTask(),
           pipelineExecutorTraceCaptor.getValue().getTask());
}
origin: org.kie.workbench/kie-wb-common-ala-spi

@Test
public void testStopAsyncTask() throws PipelineExecutorException {
  when(taskManagerHelper.generateTaskId()).thenReturn(TASK_ID);
  taskManager.init();
  //prepare the input parameters.
  prepareExecution();
  Future future = mock(Future.class);
  when(executorService.submit(any(Runnable.class))).thenReturn(future);
  String result = taskManager.execute(taskDef,
                    PipelineExecutorTaskManager.ExecutionMode.ASYNCHRONOUS);
  assertEquals(TASK_ID,
         result);
  PipelineExecutorTaskManagerImpl.TaskEntry taskEntry = taskManager.currentTasks.get(TASK_ID);
  taskManager.stop(TASK_ID);
  verify(future,
      times(1)).cancel(true);
  assertFalse(taskManager.currentTasks.containsKey(TASK_ID));
  verify(taskManagerHelper,
      times(1)).setTaskInStoppedStatus(taskEntry.getTask());
  //verify the pipeline executor registry was properly updated.
  verify(pipelineExecutorRegistry,
      times(2)).register(pipelineExecutorTraceCaptor.capture());
  assertHasSameInfo(pipelineExecutorTraceCaptor.getAllValues().get(1).getTask(),
           pipelineExecutorTraceCaptor.getValue().getTask());
}
origin: org.guvnor/guvnor-ala-spi

@Test
public void testExecuteSync() {
  when(taskManagerHelper.generateTaskId()).thenReturn(TASK_ID);
  taskManager.init();
  //prepare the input parameters.
  prepareExecution();
  String result = taskManager.execute(taskDef,
                    PipelineExecutorTaskManager.ExecutionMode.SYNCHRONOUS);
  assertEquals(TASK_ID,
         result);
  //verify the task to execute was properly initialized.
  verify(taskManagerHelper,
      times(1)).createTask(taskDef);
  //verify the pipeline was properly executed.
  verify(pipelineExecutor,
      times(1)).execute(eq(taskDef.getInput()),
               eq(pipeline),
               any(Consumer.class),
               eq(taskManager.localListener));
  //verify the pipeline executor registry was properly updated.
  verify(pipelineExecutorRegistry,
      times(1)).register(pipelineExecutorTraceCaptor.capture());
  assertEquals(PIPELINE_ID,
         pipelineExecutorTraceCaptor.getValue().getPipelineId());
  assertEquals(TASK_ID,
         pipelineExecutorTraceCaptor.getValue().getTaskId());
}
origin: org.kie.workbench/kie-wb-common-ala-spi

@Test
public void testExecuteSync() {
  when(taskManagerHelper.generateTaskId()).thenReturn(TASK_ID);
  taskManager.init();
  //prepare the input parameters.
  prepareExecution();
  String result = taskManager.execute(taskDef,
                    PipelineExecutorTaskManager.ExecutionMode.SYNCHRONOUS);
  assertEquals(TASK_ID,
         result);
  //verify the task to execute was properly initialized.
  verify(taskManagerHelper,
      times(1)).createTask(taskDef);
  //verify the pipeline was properly executed.
  verify(pipelineExecutor,
      times(1)).execute(eq(taskDef.getInput()),
               eq(pipeline),
               any(Consumer.class),
               eq(taskManager.localListener));
  //verify the pipeline executor registry was properly updated.
  verify(pipelineExecutorRegistry,
      times(1)).register(pipelineExecutorTraceCaptor.capture());
  assertEquals(PIPELINE_ID,
         pipelineExecutorTraceCaptor.getValue().getPipelineId());
  assertEquals(TASK_ID,
         pipelineExecutorTraceCaptor.getValue().getTaskId());
}
origin: org.guvnor/guvnor-ala-spi

times(1)).register(pipelineExecutorTraceCaptor.capture());
origin: org.kie.workbench/kie-wb-common-ala-spi

times(1)).register(pipelineExecutorTraceCaptor.capture());
org.guvnor.ala.registryPipelineExecutorRegistryregister

Javadoc

Registers a pipeline executor trace.

Popular methods of PipelineExecutorRegistry

  • deregister
    Deregisters a pipeline executor trace.
  • getExecutorTrace
    Gets the pipeline executor trace that produced a runtime.
  • getExecutorTraces
    Get the currently registered pipeline executor traces.

Popular in Java

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • requestLocationUpdates (LocationManager)
  • onCreateOptionsMenu (Activity)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Collectors (java.util.stream)
  • BoxLayout (javax.swing)
  • JComboBox (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now