Menu

[r966]: / branches / Release-6-0-0 / php-java-bridge / tests.php5 / Cache.java  Maximize  Restore  History

Download this file

16 lines (15 with data), 474 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
public class Cache {// Compile this class, create cache.jar and copy it to /usr/share/java
static Cache instance=null;
public static Cache getInstance() {
if(instance==null) instance=makeInstance();
return instance;
}
static Cache makeInstance() {
try {
System.out.println("create new instance");
java.lang.Thread.sleep(3000);
System.out.println("done creating new instance");
} catch (Exception e) {}
return new Cache();
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.