use of com.hazelcast.executor.impl.RunnableAdapter in project hazelcast by hazelcast.
the class SpringManagedContext method initialize.
@Override
public Object initialize(Object obj) {
Object resultObject = obj;
if (obj != null) {
if (obj instanceof RunnableAdapter) {
RunnableAdapter adapter = (RunnableAdapter) obj;
Object runnable = adapter.getRunnable();
runnable = initializeIfSpringAwareIsPresent(runnable);
adapter.setRunnable((Runnable) runnable);
} else {
resultObject = initializeIfSpringAwareIsPresent(obj);
}
}
return resultObject;
}
use of com.hazelcast.executor.impl.RunnableAdapter in project hazelcast by hazelcast.
the class DurableExecutorServiceProxy method execute.
@Override
public void execute(Runnable task) {
RunnableAdapter runnableAdapter = createRunnableAdapter(task);
int partitionId = getTaskPartitionId(runnableAdapter);
submitToPartition(runnableAdapter, partitionId, null);
}
use of com.hazelcast.executor.impl.RunnableAdapter in project hazelcast by hazelcast.
the class DurableExecutorServiceProxy method executeOnKeyOwner.
@Override
public void executeOnKeyOwner(Runnable task, Object key) {
RunnableAdapter runnableAdapter = createRunnableAdapter(task);
int partitionId = getPartitionId(key);
submitToPartition(runnableAdapter, partitionId, null);
}
use of com.hazelcast.executor.impl.RunnableAdapter in project hazelcast by hazelcast.
the class AbstractCallableTaskOperation method beforeRun.
@Override
public final void beforeRun() throws Exception {
returnsResponse = false;
callable = getCallable();
ManagedContext managedContext = getManagedContext();
if (callable instanceof RunnableAdapter) {
RunnableAdapter adapter = (RunnableAdapter) callable;
Runnable runnable = (Runnable) managedContext.initialize(adapter.getRunnable());
adapter.setRunnable(runnable);
} else {
callable = (Callable) managedContext.initialize(callable);
}
}
Aggregations