Java??????????????????
???????????? ???????[ 2012/11/28 10:01:00 ] ????????
????5????????volatile
????????
??????DCL???У?????????????Volatile??
private static CacheImpl instance; //lose volatile
public static CacheImpl getInstance() {
if (instance == null) {
synchronized (CacheImpl.class) {
if (instance == null) {
instance = new CacheImpl ();
}
}
}
return instance;
}
???????
??????????????????????synchronized ?????????????????????????????飩???????????”??“????????????????????instance == null??????ж???????Χ??????????????????????null??
???????
????????????????Щ????????????????????????????????????????????????????????????????????????????????????????“?????”??д????ɡ???????ù????????????辶??
????6??????????
????????
???????????IO?????????????IOException ??????????????????д??
public static void inputToOutput(InputStream is?? OutputStream os??
boolean isClose) throws IOException {
BufferedInputStream bis = new BufferedInputStream(is?? 1024);
BufferedOutputStream bos = new BufferedOutputStream(os?? 1024);
….
if (isClose) {
bos.close();
bis.close();
}
}
????????bos???????bis????????????????
?????????
????????????????????????????????????????á??????????????????????л?????????????
???????
????????/????????????????????????????????????
????7??????????????У??
????????
????????????????????????????????????д????????????????У???????磺
private void send(List< Event> eventList) {
assert eventList != null;
}
???????
?????????????????????У?鷽?????????????????????????????????????????????????????????????????eventList != null???????????????????????
???????
?????е???????????????????????????????????????????????????????á?log??????????????????????????
????8????????????????????
????????
??????????????????????????Щ??????????
??????????
public void caller(int a?? String b?? float c?? String d) {
methodOne(d?? z?? b);
methodTwo(b?? c?? d);
}
public void methodOne(String d?? float z?? String b)
public void methodTwo(String b?? float c?? String d)
???????????
public boolean remove(String key?? long timeout) {
Future< Boolean> future = memcachedClient.delete(key);
public boolean delete(String key?? long timeout) {
Future< Boolean> future = memcachedClient.delete(key);
???????????
public static String getDigest(String filePath?? DigestAlgorithm algorithm)
public static String getDigest(String filePath?? DigestAlgorithm digestAlgorithm)
???????
????1????????????????
????2??remove?????delete?????????? ?????????
????3????????????д?????????????
???????
?????????????У???????????????????????????????????????????????????????????????????????????????????string??????????????????string?? ???????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11