Java?????л?????
???????????? ???????[ 2016/1/6 10:02:43 ] ??????????????????? ???????
????Java ?????л??????????FoxGlove ????????????????????????????????????????????????????????????????
???????????????????????? Apache commons-collections?? Apache xalan ?? Groovy ???У????ζ?????????Щ?????????(????????WebSphere?? WebLogic??JBoss)???????????(Spring??Groovy)???????????(Jenkins)?????????????Щ?????????????????/?????????Щ???????????????в?????????????????????????
???????????????????????????? Java ???л??????????????????????л????????? Java ????????????????????洢?????????????Java ?????????????????????л??????????????? Java ????????????????л???????????????????? writeObject ?? readObject ?????????????? readObject ?????????????? Java ???????????ù????????? ???ζ??????κ???????飬????????д readObject() ????????κ??????е???????
??????????????????????
????1. ???л???????????????????????δ??????????????????δ???????? ????:
class Client {
private int value;
public Client(int v) {
if (v <= 0) {
throw new RuntimeException("not positive number");
}
value = v;
}
public void writeObject(ObjectOutputStream oos) throws IOException {
int value = 0; //???????????0????????п?????????????????serialize????????class instrument??????????????
oos.defaultWriteObject();
}
}
class Controller {
private ArrayBlockingQueue<Client> queue;
public void receiveState(ObjectInputStream o) throws IOException?? ClassNotFoundException {
Client s = (Client)o.readObject(); //?????л??????ù???????value??????鯔????
queue.add(s);
}
public Client getClient() throws InterruptedException {
return (Client)queue.take();
}
}
class Server extends Thread {
private Controller controller = new Controller();
private int result = 100;
public void run() {
while (true) {
try {
result = result / controller.getClient().getValue(); // ????value??0????????????????????
Thread.sleep(100);
} catch (InterruptedException e) {}
}
}
}
??????
???·???
??????????????????
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