@Named public final class HazelcastWorkerServiceClient extends java.lang.Object implements WorkerServiceClient
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
logger |
private static ImmutableSet<ComputationState> |
NOT_FINISHED_STATES |
private java.util.Map<HazelcastObjectNames.ConfigurationKey,java.lang.Object> |
workerConfigurationMap |
private ITopic<WorkerMessage<?>> |
workerTopic |
Constructor and Description |
---|
HazelcastWorkerServiceClient(HazelcastInstance hazelcastInstance) |
Modifier and Type | Method and Description |
---|---|
void |
cleanConfiguration() |
ComputationState |
computationState() |
private <T> java.util.Optional<T> |
configurationValue(HazelcastObjectNames.ConfigurationKey key) |
java.util.Optional<WorkerConfiguration> |
currentConfiguration() |
java.util.Optional<java.lang.Throwable> |
currentError() |
boolean |
isComputationFailed() |
boolean |
isComputationFinished() |
boolean |
isComputationRunning() |
void |
prepareConfiguration(WorkerConfiguration configuration) |
void |
startComputation() |
void |
stopComputation() |
void |
waitForComputationEnd() |
private static final org.slf4j.Logger logger
private static final ImmutableSet<ComputationState> NOT_FINISHED_STATES
private final ITopic<WorkerMessage<?>> workerTopic
private final java.util.Map<HazelcastObjectNames.ConfigurationKey,java.lang.Object> workerConfigurationMap
@Inject public HazelcastWorkerServiceClient(HazelcastInstance hazelcastInstance)
public void startComputation()
startComputation
in interface WorkerServiceClient
public void stopComputation()
stopComputation
in interface WorkerServiceClient
public void cleanConfiguration()
cleanConfiguration
in interface WorkerServiceClient
public void prepareConfiguration(WorkerConfiguration configuration) throws java.lang.InterruptedException
prepareConfiguration
in interface WorkerServiceClient
java.lang.InterruptedException
public boolean isComputationRunning()
isComputationRunning
in interface WorkerServiceClient
public boolean isComputationFinished()
isComputationFinished
in interface WorkerServiceClient
public boolean isComputationFailed()
isComputationFailed
in interface WorkerServiceClient
public ComputationState computationState()
computationState
in interface WorkerServiceClient
public java.util.Optional<WorkerConfiguration> currentConfiguration()
currentConfiguration
in interface WorkerServiceClient
public java.util.Optional<java.lang.Throwable> currentError()
currentError
in interface WorkerServiceClient
public void waitForComputationEnd() throws java.lang.InterruptedException
waitForComputationEnd
in interface WorkerServiceClient
java.lang.InterruptedException
private <T> java.util.Optional<T> configurationValue(HazelcastObjectNames.ConfigurationKey key)