public class org.apache.camel.processor.idempotent.FileIdempotentRepository extends org.apache.camel.support.ServiceSupport implements org.apache.camel.spi.IdempotentRepository
{
private static final org.slf4j.Logger LOG;
private static final java.lang.String STORE_DELIMITER;
private final java.util.concurrent.atomic.AtomicBoolean init;
private java.util.Map cache;
private java.io.File fileStore;
private long maxFileStoreSize;
private long dropOldestFileStore;
public void <init>()
{
java.util.concurrent.atomic.AtomicBoolean v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
specialinvoke v.<org.apache.camel.support.ServiceSupport: void <init>()>();
v = new java.util.concurrent.atomic.AtomicBoolean;
specialinvoke v.<java.util.concurrent.atomic.AtomicBoolean: void <init>()>();
v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.concurrent.atomic.AtomicBoolean init> = v;
v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: long maxFileStoreSize> = 32768000L;
v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: long dropOldestFileStore> = 1000L;
return;
}
public void <init>(java.io.File, java.util.Map)
{
java.util.Map v;
java.util.concurrent.atomic.AtomicBoolean v;
java.io.File v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v := @parameter: java.io.File;
v := @parameter: java.util.Map;
specialinvoke v.<org.apache.camel.support.ServiceSupport: void <init>()>();
v = new java.util.concurrent.atomic.AtomicBoolean;
specialinvoke v.<java.util.concurrent.atomic.AtomicBoolean: void <init>()>();
v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.concurrent.atomic.AtomicBoolean init> = v;
v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: long maxFileStoreSize> = 32768000L;
v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: long dropOldestFileStore> = 1000L;
v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore> = v;
v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache> = v;
return;
}
public static org.apache.camel.spi.IdempotentRepository fileIdempotentRepository(java.io.File)
{
org.apache.camel.spi.IdempotentRepository v;
java.io.File v;
v := @parameter: java.io.File;
v = staticinvoke <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.apache.camel.spi.IdempotentRepository fileIdempotentRepository(java.io.File,int)>(v, 1000);
return v;
}
public static org.apache.camel.spi.IdempotentRepository fileIdempotentRepository(java.io.File, int)
{
java.util.Map v;
int v;
org.apache.camel.spi.IdempotentRepository v;
java.io.File v;
v := @parameter: java.io.File;
v := @parameter: int;
v = staticinvoke <org.apache.camel.util.LRUCacheFactory: java.util.Map newLRUCache(int)>(v);
v = staticinvoke <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.apache.camel.spi.IdempotentRepository fileIdempotentRepository(java.io.File,java.util.Map)>(v, v);
return v;
}
public static org.apache.camel.spi.IdempotentRepository fileIdempotentRepository(java.io.File, int, long)
{
java.util.Map v;
int v;
long v;
java.io.File v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @parameter: java.io.File;
v := @parameter: int;
v := @parameter: long;
v = new org.apache.camel.processor.idempotent.FileIdempotentRepository;
v = staticinvoke <org.apache.camel.util.LRUCacheFactory: java.util.Map newLRUCache(int)>(v);
specialinvoke v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: void <init>(java.io.File,java.util.Map)>(v, v);
virtualinvoke v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: void setMaxFileStoreSize(long)>(v);
return v;
}
public static org.apache.camel.spi.IdempotentRepository fileIdempotentRepository(java.io.File, java.util.Map)
{
java.io.File v;
java.util.Map v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @parameter: java.io.File;
v := @parameter: java.util.Map;
v = new org.apache.camel.processor.idempotent.FileIdempotentRepository;
specialinvoke v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: void <init>(java.io.File,java.util.Map)>(v, v);
return v;
}
public boolean add(java.lang.String)
{
java.lang.Throwable v;
java.lang.Object[] v;
long v, v, v, v, v;
byte v, v;
java.lang.Long v, v;
java.util.Map v, v, v;
java.lang.String v;
boolean v, v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
org.slf4j.Logger v;
java.io.File v, v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v := @parameter: java.lang.String;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
entermonitor v;
label:
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
v = interfaceinvoke v.<java.util.Map: boolean containsKey(java.lang.Object)>(v);
if v == 0 goto label;
exitmonitor v;
label:
return 0;
label:
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
interfaceinvoke v.<java.util.Map: java.lang.Object put(java.lang.Object,java.lang.Object)>(v, v);
v = virtualinvoke v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: boolean containsStore(java.lang.String)>(v);
if v == 0 goto label;
exitmonitor v;
label:
return 0;
label:
virtualinvoke v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: void appendToStore(java.lang.String)>(v);
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: long maxFileStoreSize>;
v = v cmp 0L;
if v <= 0 goto label;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
v = virtualinvoke v.<java.io.File: long length()>();
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: long maxFileStoreSize>;
v = v cmp v;
if v <= 0 goto label;
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
v = newarray (java.lang.Object)[3];
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
v[0] = v;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: long maxFileStoreSize>;
v = staticinvoke <java.lang.Long: java.lang.Long valueOf(long)>(v);
v[1] = v;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: long dropOldestFileStore>;
v = staticinvoke <java.lang.Long: java.lang.Long valueOf(long)>(v);
v[2] = v;
interfaceinvoke v.<org.slf4j.Logger: void warn(java.lang.String,java.lang.Object[])>("Maximum capacity of file store: {} hit at {} bytes. Dropping {} oldest entries from the file store", v);
virtualinvoke v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: void trunkStore()>();
label:
exitmonitor v;
label:
return 1;
label:
v := @caughtexception;
exitmonitor v;
throw v;
catch java.lang.Throwable from label to label with label;
catch java.lang.Throwable from label to label with label;
catch java.lang.Throwable from label to label with label;
}
public boolean contains(java.lang.String)
{
java.lang.Throwable v;
java.util.Map v, v;
java.lang.String v;
boolean v, v, v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v := @parameter: java.lang.String;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
entermonitor v;
label:
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
v = interfaceinvoke v.<java.util.Map: boolean containsKey(java.lang.Object)>(v);
if v != 0 goto label;
v = virtualinvoke v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: boolean containsStore(java.lang.String)>(v);
if v == 0 goto label;
label:
v = 1;
goto label;
label:
v = 0;
label:
exitmonitor v;
label:
return v;
label:
v := @caughtexception;
exitmonitor v;
throw v;
catch java.lang.Throwable from label to label with label;
}
public boolean remove(java.lang.String)
{
java.lang.Throwable v;
java.util.Map v, v;
java.lang.Object v;
java.lang.String v;
boolean v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v := @parameter: java.lang.String;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
entermonitor v;
label:
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
v = interfaceinvoke v.<java.util.Map: java.lang.Object remove(java.lang.Object)>(v);
if v == null goto label;
v = 1;
goto label;
label:
v = 0;
label:
virtualinvoke v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: void removeFromStore(java.lang.String)>(v);
exitmonitor v;
label:
goto label;
label:
v := @caughtexception;
exitmonitor v;
throw v;
label:
return v;
catch java.lang.Throwable from label to label with label;
}
public boolean confirm(java.lang.String)
{
java.lang.String v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v := @parameter: java.lang.String;
return 1;
}
public void clear()
{
java.lang.Throwable v;
java.util.Map v, v, v, v;
boolean v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
entermonitor v;
label:
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
interfaceinvoke v.<java.util.Map: void clear()>();
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
v = v instanceof org.apache.camel.util.LRUCache;
if v == 0 goto label;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
virtualinvoke v.<org.apache.camel.util.LRUCache: void cleanUp()>();
label:
virtualinvoke v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: void clearStore()>();
exitmonitor v;
label:
goto label;
label:
v := @caughtexception;
exitmonitor v;
throw v;
label:
return;
catch java.lang.Throwable from label to label with label;
}
public java.io.File getFileStore()
{
java.io.File v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
return v;
}
public void setFileStore(java.io.File)
{
java.io.File v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v := @parameter: java.io.File;
v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore> = v;
return;
}
public java.lang.String getFilePath()
{
java.lang.String v;
java.io.File v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
v = virtualinvoke v.<java.io.File: java.lang.String getPath()>();
return v;
}
public java.util.Map getCache()
{
java.util.Map v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
return v;
}
public void setCache(java.util.Map)
{
java.util.Map v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v := @parameter: java.util.Map;
v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache> = v;
return;
}
public long getMaxFileStoreSize()
{
long v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: long maxFileStoreSize>;
return v;
}
public void setMaxFileStoreSize(long)
{
long v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v := @parameter: long;
v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: long maxFileStoreSize> = v;
return;
}
public long getDropOldestFileStore()
{
long v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: long dropOldestFileStore>;
return v;
}
public void setDropOldestFileStore(long)
{
long v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v := @parameter: long;
v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: long dropOldestFileStore> = v;
return;
}
public void setCacheSize(int)
{
java.lang.IllegalArgumentException v;
java.util.Map v, v, v, v, v;
int v;
boolean v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v := @parameter: int;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
if v == null goto label;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
v = v instanceof org.apache.camel.util.LRUCache;
if v != 0 goto label;
v = new java.lang.IllegalArgumentException;
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>("Setting cache size is only possible when using the default LRUCache cache implementation");
throw v;
label:
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
if v == null goto label;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
interfaceinvoke v.<java.util.Map: void clear()>();
label:
v = staticinvoke <org.apache.camel.util.LRUCacheFactory: java.util.Map newLRUCache(int)>(v);
v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache> = v;
return;
}
public int getCacheSize()
{
java.util.Map v, v;
int v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
if v == null goto label;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
v = interfaceinvoke v.<java.util.Map: int size()>();
return v;
label:
return 0;
}
public synchronized void reset() throws java.io.IOException
{
java.lang.Throwable v;
java.util.Map v, v, v, v;
boolean v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
entermonitor v;
label:
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
v = v instanceof org.apache.camel.util.LRUCache;
if v == 0 goto label;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
virtualinvoke v.<org.apache.camel.util.LRUCache: void cleanUp()>();
label:
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
interfaceinvoke v.<java.util.Map: void clear()>();
virtualinvoke v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: void loadStore()>();
exitmonitor v;
label:
goto label;
label:
v := @caughtexception;
exitmonitor v;
throw v;
label:
return;
catch java.lang.Throwable from label to label with label;
}
protected boolean containsStore(java.lang.String)
{
java.lang.Throwable v;
org.apache.camel.RuntimeCamelException v;
java.io.IOException v;
java.io.File v, v, v;
org.apache.camel.util.Scanner v;
java.lang.String v, v;
boolean v, v, v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v := @parameter: java.lang.String;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
if v == null goto label;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
v = virtualinvoke v.<java.io.File: boolean exists()>();
if v != 0 goto label;
label:
return 0;
label:
v = new org.apache.camel.util.Scanner;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
specialinvoke v.<org.apache.camel.util.Scanner: void <init>(java.io.File,java.lang.String,java.lang.String)>(v, null, "\n");
label:
v = virtualinvoke v.<org.apache.camel.util.Scanner: boolean hasNext()>();
if v == 0 goto label;
v = virtualinvoke v.<org.apache.camel.util.Scanner: java.lang.String next()>();
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>(v);
if v == 0 goto label;
label:
virtualinvoke v.<org.apache.camel.util.Scanner: void close()>();
label:
return 1;
label:
virtualinvoke v.<org.apache.camel.util.Scanner: void close()>();
goto label;
label:
v := @caughtexception;
throw v;
label:
v := @caughtexception;
v = staticinvoke <org.apache.camel.util.ObjectHelper: org.apache.camel.RuntimeCamelException wrapRuntimeCamelException(java.lang.Throwable)>(v);
throw v;
label:
return 0;
catch java.lang.Throwable from label to label with label;
catch java.lang.Throwable from label to label with label;
catch java.io.IOException from label to label with label;
catch java.io.IOException from label to label with label;
}
protected void appendToStore(java.lang.String)
{
java.lang.Throwable v;
byte[] v, v;
java.lang.String v, v;
boolean v, v, v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
org.apache.camel.RuntimeCamelException v;
org.slf4j.Logger v, v, v, v, v, v;
java.io.FileOutputStream v, v;
java.io.IOException v;
java.io.File v, v, v, v, v, v, v, v, v, v, v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v := @parameter: java.lang.String;
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
interfaceinvoke v.<org.slf4j.Logger: void debug(java.lang.String,java.lang.Object,java.lang.Object)>("Appending: {} to idempotent filestore: {}", v, v);
v = null;
label:
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
v = virtualinvoke v.<java.io.File: java.io.File getParentFile()>();
if v == null goto label;
v = virtualinvoke v.<java.io.File: boolean exists()>();
if v != 0 goto label;
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object)>("Parent directory of file store {} doesn\'t exist. Creating.", v);
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
v = virtualinvoke v.<java.io.File: java.io.File getParentFile()>();
v = virtualinvoke v.<java.io.File: boolean mkdirs()>();
if v == 0 goto label;
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object)>("Parent directory of filestore: {} successfully created.", v);
goto label;
label:
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
interfaceinvoke v.<org.slf4j.Logger: void warn(java.lang.String,java.lang.Object)>("Parent directory of filestore: {} cannot be created.", v);
label:
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
v = virtualinvoke v.<java.io.File: boolean exists()>();
if v != 0 goto label;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
staticinvoke <org.apache.camel.util.FileUtil: boolean createNewFile(java.io.File)>(v);
label:
v = new java.io.FileOutputStream;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
specialinvoke v.<java.io.FileOutputStream: void <init>(java.io.File,boolean)>(v, 1);
v = v;
v = virtualinvoke v.<java.lang.String: byte[] getBytes()>();
virtualinvoke v.<java.io.FileOutputStream: void write(byte[])>(v);
v = "\n";
v = virtualinvoke v.<java.lang.String: byte[] getBytes()>();
virtualinvoke v.<java.io.FileOutputStream: void write(byte[])>(v);
label:
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
staticinvoke <org.apache.camel.util.IOHelper: void close(java.io.Closeable,java.lang.String,org.slf4j.Logger)>(v, "Appending to file idempotent repository", v);
goto label;
label:
v := @caughtexception;
v = staticinvoke <org.apache.camel.util.ObjectHelper: org.apache.camel.RuntimeCamelException wrapRuntimeCamelException(java.lang.Throwable)>(v);
throw v;
label:
v := @caughtexception;
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
staticinvoke <org.apache.camel.util.IOHelper: void close(java.io.Closeable,java.lang.String,org.slf4j.Logger)>(v, "Appending to file idempotent repository", v);
throw v;
label:
return;
catch java.io.IOException from label to label with label;
catch java.lang.Throwable from label to label with label;
}
protected synchronized void removeFromStore(java.lang.String)
{
java.lang.Throwable v, v;
byte[] v, v;
java.util.ArrayList v;
java.lang.String v, v, v;
boolean v, v, v, v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
org.apache.camel.RuntimeCamelException v, v;
org.slf4j.Logger v, v, v, v;
java.util.Iterator v;
java.io.FileOutputStream v, v;
java.io.IOException v, v;
java.io.File v, v, v, v;
org.apache.camel.util.Scanner v, v;
java.lang.Object v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v := @parameter: java.lang.String;
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
interfaceinvoke v.<org.slf4j.Logger: void debug(java.lang.String,java.lang.Object,java.lang.Object)>("Removing: {} from idempotent filestore: {}", v, v);
v = new java.util.ArrayList;
specialinvoke v.<java.util.ArrayList: void <init>()>();
v = 0;
v = null;
label:
v = new org.apache.camel.util.Scanner;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
specialinvoke v.<org.apache.camel.util.Scanner: void <init>(java.io.File,java.lang.String,java.lang.String)>(v, null, "\n");
v = v;
label:
v = virtualinvoke v.<org.apache.camel.util.Scanner: boolean hasNext()>();
if v == 0 goto label;
v = virtualinvoke v.<org.apache.camel.util.Scanner: java.lang.String next()>();
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>(v);
if v == 0 goto label;
v = 1;
goto label;
label:
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
goto label;
label:
virtualinvoke v.<org.apache.camel.util.Scanner: void close()>();
goto label;
label:
v := @caughtexception;
v = staticinvoke <org.apache.camel.util.ObjectHelper: org.apache.camel.RuntimeCamelException wrapRuntimeCamelException(java.lang.Throwable)>(v);
throw v;
label:
v := @caughtexception;
if v == null goto label;
virtualinvoke v.<org.apache.camel.util.Scanner: void close()>();
label:
throw v;
label:
if v == 0 goto label;
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
interfaceinvoke v.<org.slf4j.Logger: void debug(java.lang.String,java.lang.Object,java.lang.Object)>("Rewriting idempotent filestore: {} due to key: {} removed", v, v);
v = null;
label:
v = new java.io.FileOutputStream;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
specialinvoke v.<java.io.FileOutputStream: void <init>(java.io.File)>(v);
v = v;
v = interfaceinvoke v.<java.util.List: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = virtualinvoke v.<java.lang.String: byte[] getBytes()>();
virtualinvoke v.<java.io.FileOutputStream: void write(byte[])>(v);
v = "\n";
v = virtualinvoke v.<java.lang.String: byte[] getBytes()>();
virtualinvoke v.<java.io.FileOutputStream: void write(byte[])>(v);
goto label;
label:
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
staticinvoke <org.apache.camel.util.IOHelper: void close(java.io.Closeable,java.lang.String,org.slf4j.Logger)>(v, "Rewriting file idempotent repository", v);
goto label;
label:
v := @caughtexception;
v = staticinvoke <org.apache.camel.util.ObjectHelper: org.apache.camel.RuntimeCamelException wrapRuntimeCamelException(java.lang.Throwable)>(v);
throw v;
label:
v := @caughtexception;
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
staticinvoke <org.apache.camel.util.IOHelper: void close(java.io.Closeable,java.lang.String,org.slf4j.Logger)>(v, "Rewriting file idempotent repository", v);
throw v;
label:
return;
catch java.io.IOException from label to label with label;
catch java.lang.Throwable from label to label with label;
catch java.io.IOException from label to label with label;
catch java.lang.Throwable from label to label with label;
}
protected void clearStore()
{
org.apache.camel.RuntimeCamelException v;
java.io.IOException v;
java.io.File v, v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
label:
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
staticinvoke <org.apache.camel.util.FileUtil: boolean deleteFile(java.io.File)>(v);
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
staticinvoke <org.apache.camel.util.FileUtil: boolean createNewFile(java.io.File)>(v);
label:
goto label;
label:
v := @caughtexception;
v = staticinvoke <org.apache.camel.util.ObjectHelper: org.apache.camel.RuntimeCamelException wrapRuntimeCamelException(java.lang.Throwable)>(v);
throw v;
label:
return;
catch java.io.IOException from label to label with label;
}
protected synchronized void trunkStore()
{
byte[] v, v;
java.lang.Integer v;
byte v;
java.lang.Long v;
boolean v, v, v, v;
org.apache.camel.RuntimeCamelException v, v;
org.apache.camel.util.Scanner v, v;
java.lang.Throwable v, v;
long v, v;
java.util.ArrayList v;
int v, v;
java.lang.String v, v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
org.slf4j.Logger v, v, v, v, v;
java.util.Iterator v;
java.io.FileOutputStream v, v;
java.io.IOException v, v;
java.io.File v, v, v, v, v, v, v;
java.lang.Object v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
if v == null goto label;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
v = virtualinvoke v.<java.io.File: boolean exists()>();
if v != 0 goto label;
label:
return;
label:
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: long dropOldestFileStore>;
v = staticinvoke <java.lang.Long: java.lang.Long valueOf(long)>(v);
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
interfaceinvoke v.<org.slf4j.Logger: void debug(java.lang.String,java.lang.Object,java.lang.Object)>("Trunking: {} oldest entries from idempotent filestore: {}", v, v);
v = new java.util.ArrayList;
specialinvoke v.<java.util.ArrayList: void <init>()>();
v = null;
v = 0;
label:
v = new org.apache.camel.util.Scanner;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
specialinvoke v.<org.apache.camel.util.Scanner: void <init>(java.io.File,java.lang.String,java.lang.String)>(v, null, "\n");
v = v;
label:
v = virtualinvoke v.<org.apache.camel.util.Scanner: boolean hasNext()>();
if v == 0 goto label;
v = virtualinvoke v.<org.apache.camel.util.Scanner: java.lang.String next()>();
v = v + 1;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: long dropOldestFileStore>;
v = v cmp v;
if v <= 0 goto label;
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
goto label;
label:
virtualinvoke v.<org.apache.camel.util.Scanner: void close()>();
goto label;
label:
v := @caughtexception;
v = staticinvoke <org.apache.camel.util.ObjectHelper: org.apache.camel.RuntimeCamelException wrapRuntimeCamelException(java.lang.Throwable)>(v);
throw v;
label:
v := @caughtexception;
if v == null goto label;
virtualinvoke v.<org.apache.camel.util.Scanner: void close()>();
label:
throw v;
label:
v = interfaceinvoke v.<java.util.List: boolean isEmpty()>();
if v != 0 goto label;
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
v = interfaceinvoke v.<java.util.List: int size()>();
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
interfaceinvoke v.<org.slf4j.Logger: void debug(java.lang.String,java.lang.Object,java.lang.Object)>("Rewriting idempotent filestore: {} with {} entries:", v, v);
v = null;
label:
v = new java.io.FileOutputStream;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
specialinvoke v.<java.io.FileOutputStream: void <init>(java.io.File)>(v);
v = v;
v = interfaceinvoke v.<java.util.List: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = virtualinvoke v.<java.lang.String: byte[] getBytes()>();
virtualinvoke v.<java.io.FileOutputStream: void write(byte[])>(v);
v = "\n";
v = virtualinvoke v.<java.lang.String: byte[] getBytes()>();
virtualinvoke v.<java.io.FileOutputStream: void write(byte[])>(v);
goto label;
label:
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
staticinvoke <org.apache.camel.util.IOHelper: void close(java.io.Closeable,java.lang.String,org.slf4j.Logger)>(v, "Rewriting file idempotent repository", v);
goto label;
label:
v := @caughtexception;
v = staticinvoke <org.apache.camel.util.ObjectHelper: org.apache.camel.RuntimeCamelException wrapRuntimeCamelException(java.lang.Throwable)>(v);
throw v;
label:
v := @caughtexception;
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
staticinvoke <org.apache.camel.util.IOHelper: void close(java.io.Closeable,java.lang.String,org.slf4j.Logger)>(v, "Rewriting file idempotent repository", v);
throw v;
label:
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
interfaceinvoke v.<org.slf4j.Logger: void debug(java.lang.String,java.lang.Object)>("Clearing idempotent filestore: {}", v);
virtualinvoke v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: void clearStore()>();
label:
return;
catch java.io.IOException from label to label with label;
catch java.lang.Throwable from label to label with label;
catch java.io.IOException from label to label with label;
catch java.lang.Throwable from label to label with label;
}
protected void cleanup()
{
java.util.Map v, v;
boolean v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
v = v instanceof org.apache.camel.util.LRUCache;
if v == 0 goto label;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
virtualinvoke v.<org.apache.camel.util.LRUCache: void cleanUp()>();
label:
return;
}
protected void loadStore() throws java.io.IOException
{
java.lang.Throwable v;
java.lang.Integer v;
java.util.Map v, v, v;
int v;
java.lang.String v, v;
boolean v, v, v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
org.apache.camel.RuntimeCamelException v;
org.slf4j.Logger v, v, v;
java.io.IOException v, v;
java.io.File v, v, v, v, v, v, v, v, v;
org.apache.camel.util.Scanner v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
v = virtualinvoke v.<java.io.File: boolean exists()>();
if v != 0 goto label;
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
interfaceinvoke v.<org.slf4j.Logger: void debug(java.lang.String,java.lang.Object)>("Creating filestore: {}", v);
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
v = virtualinvoke v.<java.io.File: java.io.File getParentFile()>();
if v == null goto label;
virtualinvoke v.<java.io.File: boolean mkdirs()>();
label:
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
v = staticinvoke <org.apache.camel.util.FileUtil: boolean createNewFile(java.io.File)>(v);
if v != 0 goto label;
v = new java.io.IOException;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.io.File)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Cannot create filestore: \u0001");
specialinvoke v.<java.io.IOException: void <init>(java.lang.String)>(v);
throw v;
label:
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
interfaceinvoke v.<org.slf4j.Logger: void trace(java.lang.String,java.lang.Object)>("Loading to 1st level cache from idempotent filestore: {}", v);
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
interfaceinvoke v.<java.util.Map: void clear()>();
label:
v = new org.apache.camel.util.Scanner;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
specialinvoke v.<org.apache.camel.util.Scanner: void <init>(java.io.File,java.lang.String,java.lang.String)>(v, null, "\n");
label:
v = virtualinvoke v.<org.apache.camel.util.Scanner: boolean hasNext()>();
if v == 0 goto label;
v = virtualinvoke v.<org.apache.camel.util.Scanner: java.lang.String next()>();
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
interfaceinvoke v.<java.util.Map: java.lang.Object put(java.lang.Object,java.lang.Object)>(v, v);
goto label;
label:
virtualinvoke v.<org.apache.camel.util.Scanner: void close()>();
goto label;
label:
v := @caughtexception;
throw v;
label:
v := @caughtexception;
v = staticinvoke <org.apache.camel.util.ObjectHelper: org.apache.camel.RuntimeCamelException wrapRuntimeCamelException(java.lang.Throwable)>(v);
throw v;
label:
v = <org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG>;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
v = interfaceinvoke v.<java.util.Map: int size()>();
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
interfaceinvoke v.<org.slf4j.Logger: void debug(java.lang.String,java.lang.Object,java.lang.Object)>("Loaded {} to the 1st level cache from idempotent filestore: {}", v, v);
return;
catch java.lang.Throwable from label to label with label;
catch java.io.IOException from label to label with label;
}
protected void doStart() throws java.lang.Exception
{
java.util.Map v, v;
java.util.concurrent.atomic.AtomicBoolean v;
java.io.File v;
boolean v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.io.File fileStore>;
staticinvoke <org.apache.camel.util.ObjectHelper: java.lang.Object notNull(java.lang.Object,java.lang.String,java.lang.Object)>(v, "fileStore", v);
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
if v != null goto label;
v = staticinvoke <org.apache.camel.util.LRUCacheFactory: java.util.Map newLRUCache(int)>(1000);
v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache> = v;
label:
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.concurrent.atomic.AtomicBoolean init>;
v = virtualinvoke v.<java.util.concurrent.atomic.AtomicBoolean: boolean compareAndSet(boolean,boolean)>(0, 1);
if v == 0 goto label;
virtualinvoke v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: void loadStore()>();
label:
return;
}
protected void doStop() throws java.lang.Exception
{
java.util.Map v, v, v;
java.util.concurrent.atomic.AtomicBoolean v;
boolean v;
org.apache.camel.processor.idempotent.FileIdempotentRepository v;
v := @this: org.apache.camel.processor.idempotent.FileIdempotentRepository;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
v = v instanceof org.apache.camel.util.LRUCache;
if v == 0 goto label;
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
virtualinvoke v.<org.apache.camel.util.LRUCache: void cleanUp()>();
label:
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.Map cache>;
interfaceinvoke v.<java.util.Map: void clear()>();
v = v.<org.apache.camel.processor.idempotent.FileIdempotentRepository: java.util.concurrent.atomic.AtomicBoolean init>;
virtualinvoke v.<java.util.concurrent.atomic.AtomicBoolean: void set(boolean)>(0);
return;
}
static void <clinit>()
{
org.slf4j.Logger v;
v = staticinvoke <org.slf4j.LoggerFactory: org.slf4j.Logger getLogger(java.lang.Class)>(class "Lorg/apache/camel/processor/idempotent/FileIdempotentRepository;");
<org.apache.camel.processor.idempotent.FileIdempotentRepository: org.slf4j.Logger LOG> = v;
return;
}
}