public void doPush( String addr, String text, HttpAsyncClient asyClient, HttpPost httpPost, Object callPushClient) { this.addr = addr; if (pushCounter > 100000) pushCounter = 0; this.asyClient = JmsSubscription.asyClientList.get(pushCounter % JmsSubscription.asyClientList.size()); pushCounter++; System.out.println( "pushCounter%JmsSubscription.asyClientList.size():" + pushCounter % JmsSubscription.asyClientList.size()); this.text = text; if ((PushClient.sendCounter % 100000) == 0) { System.gc(); } Date date = new Date(); dopushCounter++; // System.out.println("ThreadPool 1-PushClient Counter:" + dopushCounter + " " + date.getHours() // + ":" + date.getMinutes() + ":" + date.getSeconds()); // try{ // JAXBContext jaxbContext = JAXBContext.newInstance(Notify.class); // // for (NotificationMessageHolderType messageHolder : notify.getNotificationMessage()){ // Notify notifyHolder = new Notify(); // notifyHolder.getNotificationMessage().add(messageHolder); // StringWriter writer = new StringWriter(); // jaxbContext.createMarshaller().marshal(notifyHolder, writer); // String notifyContent = writer.toString(); // String content = getContent(notifyContent); int start = text.indexOf("<wsnt:Message>") + 14; int end = text.indexOf("</wsnt:Message>"); String content = text.substring(start, end).trim(); content = content.replaceAll("<", "<"); content = content.replaceAll(">", ">"); // 转锟斤拷锟斤拷息锟斤拷锟斤拷锟斤拷要转锟斤拷锟斤拷址锟� // content = escapeCharacterMethod(content); String request = requestGenerate(content); // added by shmily(6) // try { // request = new String(request.getBytes("UTF-8"), "ISO-8859-1"); // } catch (UnsupportedEncodingException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } // if((sendResult.equals("CANCELLED")) || (sendResult.equals("CREATED")) || // (sendResult.equals("ACCEPTED")) || (sendResult.equals("NO_RESPONSE")) || // (sendResult.equals("OK")) || (sendResult.equals("normal"))){ // log.info("**********PushClient:" + sendResult); // sendResult = send(request); // }else if(sendResult.equals("initial")){ // sendResult = send(request); // log.info("**********enter the initial branch"); // }else if((sendResult.equals("FAILED")) || (sendResult.equals("BAD_REQUEST")) || // (sendResult.equals("UNAUTHORIZED")) || (sendResult.equals("FORBIDDEN")) || // (sendResult.equals("NOT_FOUND")) || (sendResult.equals("INTERNAL_ERROR"))){ // log.info("**********PushClient:" + sendResult); // } // sendThread sends = new sendThread(); // sends.setagrs(content, httpPost, callPushClient); // JmsSubscription.pushpool.execute(sends); send(request, httpPost, callPushClient); }