Search in sources :

Example 1 with DefaultServiceExecutor

use of io.atomix.primitive.service.impl.DefaultServiceExecutor in project atomix by atomix.

the class AbstractPrimitiveService method init.

@Override
public void init(ServiceContext context) {
    this.context = context;
    this.executor = new DefaultServiceExecutor(context);
    this.log = ContextualLoggerFactory.getLogger(getClass(), LoggerContext.builder(PrimitiveService.class).addValue(context.serviceId()).add("type", context.serviceType()).add("name", context.serviceName()).build());
    configure(executor);
}
Also used : DefaultServiceExecutor(io.atomix.primitive.service.impl.DefaultServiceExecutor)

Example 2 with DefaultServiceExecutor

use of io.atomix.primitive.service.impl.DefaultServiceExecutor in project atomix by atomix.

the class DefaultServiceExecutorTest method executor.

private ServiceExecutor executor() {
    ServiceContext context = mock(ServiceContext.class);
    when(context.serviceId()).thenReturn(PrimitiveId.from(1));
    when(context.serviceType()).thenReturn(new TestPrimitiveType());
    when(context.serviceName()).thenReturn("test");
    when(context.currentOperation()).thenReturn(OperationType.COMMAND);
    return new DefaultServiceExecutor(context);
}
Also used : TestPrimitiveType(io.atomix.primitive.TestPrimitiveType) DefaultServiceExecutor(io.atomix.primitive.service.impl.DefaultServiceExecutor)

Aggregations

DefaultServiceExecutor (io.atomix.primitive.service.impl.DefaultServiceExecutor)2 TestPrimitiveType (io.atomix.primitive.TestPrimitiveType)1