use of org.optaplanner.core.api.solver.Solver in project camel by apache.
the class OptaPlannerConsumer method doStop.
@Override
protected void doStop() throws Exception {
Solver solver = endpoint.getOrCreateSolver(configuration.getSolverId());
solver.removeEventListener(listener);
super.doStop();
}
use of org.optaplanner.core.api.solver.Solver in project camel by apache.
the class OptaPlannerEndpoint method doStop.
@Override
protected void doStop() throws Exception {
synchronized (SOLVERS) {
for (Solver solver : SOLVERS.values()) {
solver.terminateEarly();
SOLVERS.remove(solver);
}
}
super.doStop();
}
use of org.optaplanner.core.api.solver.Solver in project droolsjbpm-integration by kiegroup.
the class SolverBuilderTest method buildFromContainerSuccessful.
@Test
public void buildFromContainerSuccessful() {
when(registry.getContainer(CONTAINER_ID)).thenReturn(container);
InternalKieContainer kieContainer = (InternalKieContainer) KieServices.Factory.get().getKieClasspathContainer(getClass().getClassLoader());
when(container.getKieContainer()).thenReturn(kieContainer);
when(container.getStatus()).thenReturn(KieContainerStatus.STARTED);
SolverDef solverDef = new SolverDef(CONTAINER_ID, null, null, null, SOLVER_CONTAINER_CONFIG_RESOURCE, null, -1, null);
Solver solver = SolverBuilder.create().solverDef(solverDef).registry(registry).build();
assertNotNull(solver);
}
use of org.optaplanner.core.api.solver.Solver in project droolsjbpm-integration by kiegroup.
the class SolverBuilderTest method buildFromResourceSuccessful.
@Test
public void buildFromResourceSuccessful() {
SolverDef solverDef = new SolverDef(SOLVER_SIMPLE_CONFIG_RESOURCE);
Solver solver = SolverBuilder.create().solverDef(solverDef).registry(registry).build();
assertNotNull(solver);
}
use of org.optaplanner.core.api.solver.Solver in project camel by apache.
the class OptaPlannerConsumer method doStart.
@Override
protected void doStart() throws Exception {
Solver solver = endpoint.getOrCreateSolver(configuration.getSolverId());
solver.addEventListener(listener);
super.doStart();
}
Aggregations