public class org.apache.camel.impl.saga.InMemorySagaService extends org.apache.camel.support.ServiceSupport implements org.apache.camel.saga.CamelSagaService
{
public static final int DEFAULT_MAX_RETRY_ATTEMPTS;
public static final long DEFAULT_RETRY_DELAY_IN_MILLISECONDS;
private org.apache.camel.CamelContext camelContext;
private java.util.Map coordinators;
private java.util.concurrent.ScheduledExecutorService executorService;
private int maxRetryAttempts;
private long retryDelayInMilliseconds;
public void <init>()
{
java.util.concurrent.ConcurrentHashMap v;
org.apache.camel.impl.saga.InMemorySagaService v;
v := @this: org.apache.camel.impl.saga.InMemorySagaService;
specialinvoke v.<org.apache.camel.support.ServiceSupport: void <init>()>();
v = new java.util.concurrent.ConcurrentHashMap;
specialinvoke v.<java.util.concurrent.ConcurrentHashMap: void <init>()>();
v.<org.apache.camel.impl.saga.InMemorySagaService: java.util.Map coordinators> = v;
v.<org.apache.camel.impl.saga.InMemorySagaService: int maxRetryAttempts> = 5;
v.<org.apache.camel.impl.saga.InMemorySagaService: long retryDelayInMilliseconds> = 5000L;
return;
}
public java.util.concurrent.CompletableFuture newSaga()
{
org.apache.camel.impl.saga.InMemorySagaCoordinator v;
org.apache.camel.CamelContext v, v, v;
java.util.concurrent.CompletableFuture v;
org.apache.camel.spi.UuidGenerator v;
java.util.Map v;
java.lang.String v;
org.apache.camel.impl.saga.InMemorySagaService v;
v := @this: org.apache.camel.impl.saga.InMemorySagaService;
v = v.<org.apache.camel.impl.saga.InMemorySagaService: org.apache.camel.CamelContext camelContext>;
staticinvoke <org.apache.camel.util.ObjectHelper: java.lang.Object notNull(java.lang.Object,java.lang.String)>(v, "camelContext");
v = v.<org.apache.camel.impl.saga.InMemorySagaService: org.apache.camel.CamelContext camelContext>;
v = interfaceinvoke v.<org.apache.camel.CamelContext: org.apache.camel.spi.UuidGenerator getUuidGenerator()>();
v = interfaceinvoke v.<org.apache.camel.spi.UuidGenerator: java.lang.String generateUuid()>();
v = new org.apache.camel.impl.saga.InMemorySagaCoordinator;
v = v.<org.apache.camel.impl.saga.InMemorySagaService: org.apache.camel.CamelContext camelContext>;
specialinvoke v.<org.apache.camel.impl.saga.InMemorySagaCoordinator: void <init>(org.apache.camel.CamelContext,org.apache.camel.impl.saga.InMemorySagaService,java.lang.String)>(v, v, v);
v = v.<org.apache.camel.impl.saga.InMemorySagaService: java.util.Map coordinators>;
interfaceinvoke v.<java.util.Map: java.lang.Object put(java.lang.Object,java.lang.Object)>(v, v);
v = staticinvoke <java.util.concurrent.CompletableFuture: java.util.concurrent.CompletableFuture completedFuture(java.lang.Object)>(v);
return v;
}
public java.util.concurrent.CompletableFuture getSaga(java.lang.String)
{
java.util.Map v;
java.lang.Object v;
java.util.concurrent.CompletableFuture v;
java.lang.String v;
org.apache.camel.impl.saga.InMemorySagaService v;
v := @this: org.apache.camel.impl.saga.InMemorySagaService;
v := @parameter: java.lang.String;
v = v.<org.apache.camel.impl.saga.InMemorySagaService: java.util.Map coordinators>;
v = interfaceinvoke v.<java.util.Map: java.lang.Object get(java.lang.Object)>(v);
v = staticinvoke <java.util.concurrent.CompletableFuture: java.util.concurrent.CompletableFuture completedFuture(java.lang.Object)>(v);
return v;
}
public void registerStep(org.apache.camel.saga.CamelSagaStep)
{
org.apache.camel.impl.saga.InMemorySagaService v;
org.apache.camel.saga.CamelSagaStep v;
v := @this: org.apache.camel.impl.saga.InMemorySagaService;
v := @parameter: org.apache.camel.saga.CamelSagaStep;
return;
}
protected void doStart() throws java.lang.Exception
{
org.apache.camel.CamelContext v;
java.util.concurrent.ScheduledExecutorService v, v;
org.apache.camel.spi.ExecutorServiceManager v;
org.apache.camel.impl.saga.InMemorySagaService v;
v := @this: org.apache.camel.impl.saga.InMemorySagaService;
v = v.<org.apache.camel.impl.saga.InMemorySagaService: java.util.concurrent.ScheduledExecutorService executorService>;
if v != null goto label;
v = v.<org.apache.camel.impl.saga.InMemorySagaService: org.apache.camel.CamelContext camelContext>;
v = interfaceinvoke v.<org.apache.camel.CamelContext: org.apache.camel.spi.ExecutorServiceManager getExecutorServiceManager()>();
v = interfaceinvoke v.<org.apache.camel.spi.ExecutorServiceManager: java.util.concurrent.ScheduledExecutorService newDefaultScheduledThreadPool(java.lang.Object,java.lang.String)>(v, "saga");
v.<org.apache.camel.impl.saga.InMemorySagaService: java.util.concurrent.ScheduledExecutorService executorService> = v;
label:
return;
}
protected void doStop() throws java.lang.Exception
{
org.apache.camel.CamelContext v;
java.util.concurrent.ScheduledExecutorService v, v;
org.apache.camel.spi.ExecutorServiceManager v;
org.apache.camel.impl.saga.InMemorySagaService v;
v := @this: org.apache.camel.impl.saga.InMemorySagaService;
v = v.<org.apache.camel.impl.saga.InMemorySagaService: java.util.concurrent.ScheduledExecutorService executorService>;
if v == null goto label;
v = v.<org.apache.camel.impl.saga.InMemorySagaService: org.apache.camel.CamelContext camelContext>;
v = interfaceinvoke v.<org.apache.camel.CamelContext: org.apache.camel.spi.ExecutorServiceManager getExecutorServiceManager()>();
v = v.<org.apache.camel.impl.saga.InMemorySagaService: java.util.concurrent.ScheduledExecutorService executorService>;
interfaceinvoke v.<org.apache.camel.spi.ExecutorServiceManager: void shutdownGraceful(java.util.concurrent.ExecutorService)>(v);
v.<org.apache.camel.impl.saga.InMemorySagaService: java.util.concurrent.ScheduledExecutorService executorService> = null;
label:
return;
}
public java.util.concurrent.ScheduledExecutorService getExecutorService()
{
java.util.concurrent.ScheduledExecutorService v;
org.apache.camel.impl.saga.InMemorySagaService v;
v := @this: org.apache.camel.impl.saga.InMemorySagaService;
v = v.<org.apache.camel.impl.saga.InMemorySagaService: java.util.concurrent.ScheduledExecutorService executorService>;
return v;
}
public void setCamelContext(org.apache.camel.CamelContext)
{
org.apache.camel.CamelContext v;
org.apache.camel.impl.saga.InMemorySagaService v;
v := @this: org.apache.camel.impl.saga.InMemorySagaService;
v := @parameter: org.apache.camel.CamelContext;
v.<org.apache.camel.impl.saga.InMemorySagaService: org.apache.camel.CamelContext camelContext> = v;
return;
}
public org.apache.camel.CamelContext getCamelContext()
{
org.apache.camel.CamelContext v;
org.apache.camel.impl.saga.InMemorySagaService v;
v := @this: org.apache.camel.impl.saga.InMemorySagaService;
v = v.<org.apache.camel.impl.saga.InMemorySagaService: org.apache.camel.CamelContext camelContext>;
return v;
}
public int getMaxRetryAttempts()
{
int v;
org.apache.camel.impl.saga.InMemorySagaService v;
v := @this: org.apache.camel.impl.saga.InMemorySagaService;
v = v.<org.apache.camel.impl.saga.InMemorySagaService: int maxRetryAttempts>;
return v;
}
public void setMaxRetryAttempts(int)
{
int v;
org.apache.camel.impl.saga.InMemorySagaService v;
v := @this: org.apache.camel.impl.saga.InMemorySagaService;
v := @parameter: int;
v.<org.apache.camel.impl.saga.InMemorySagaService: int maxRetryAttempts> = v;
return;
}
public long getRetryDelayInMilliseconds()
{
long v;
org.apache.camel.impl.saga.InMemorySagaService v;
v := @this: org.apache.camel.impl.saga.InMemorySagaService;
v = v.<org.apache.camel.impl.saga.InMemorySagaService: long retryDelayInMilliseconds>;
return v;
}
public void setRetryDelayInMilliseconds(long)
{
long v;
org.apache.camel.impl.saga.InMemorySagaService v;
v := @this: org.apache.camel.impl.saga.InMemorySagaService;
v := @parameter: long;
v.<org.apache.camel.impl.saga.InMemorySagaService: long retryDelayInMilliseconds> = v;
return;
}
}