每日一得
georgeguwenzhong
这个作者很懒,什么都没留下…
展开
-
OXM: JAXB2.0 in JDK1.6
1.1.1 JAXB 2.0: ObjectàXMLUsingJAXB 2.0 embedded in JDK 1.6.Marshal Object to XML bytes: public byte[] marshalToBytes(Object o) throws Exception { JAXBContext...原创 2011-04-20 22:53:28 · 80 阅读 · 0 评论 -
Scheduled ThreadPool Executor suppressed or stopped after error happen
ScheduledThreadPoolExecutorExecution periodic Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given period; tha...2012-03-20 16:54:19 · 97 阅读 · 0 评论 -
javax.naming.CommunicationException: remote side declared peer gone on this JVM.
javax.naming.ServiceUnavailableException [Root exception is java.net.UnknownHostException: XXXXX001] javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://X.X.X.X:...2012-07-11 09:44:15 · 732 阅读 · 0 评论 -
Generate special format numbers
DecimalFormat df = new DecimalFormat("999000");df.format(10); will output "999010"原创 2012-04-27 00:06:07 · 99 阅读 · 0 评论 -
Bad version number in .class file
Bad version number in .class file Mainly happened because of running Java class in a lower JDK version but it was compiled in higher JDK version. How to Check Java Class Version Execute comman...2012-01-27 00:35:14 · 85 阅读 · 0 评论 -
User Data Header in SMPP SUBMIT_SM
SMPP optional Parameters for concatenation and port addressing SMPP concatenation related optional parameters: (sar_msg_ref_num, sar_total_segments, sar_segment_seqnum) SMPP po...2012-01-25 22:30:39 · 327 阅读 · 0 评论 -
Java is Pass-by-Value or Pass-by-Reference?
What's saved in Object Reference?We can treat the Java Object will be managed in two parts: Obejct definition and its reference to Memory Heap which contains object's attribute and data content...2011-12-19 19:18:33 · 74 阅读 · 0 评论 -
Oracle Index Usage
Like a hash mapping for record's address. By default sql query Will lead to entire schema scanning. Index can be Used to get target record fastly and easily.2011-12-15 05:26:43 · 100 阅读 · 0 评论 -
java.util.Properties: a subclass of java.util.Hashtable
I met a problem this afternoon when test following souce snap: Properties p = new Properties(); #1p.put("smsc.adapter.driver.number", 2); #2int driverNumbers = Integer.intValue(p.getProperty...2011-12-13 06:57:25 · 65 阅读 · 0 评论 -
AOP(2):AOP与动态代理JDK Proxy and Cglib Proxy
使用动态代理(JDK Proxy 或者Cglib Proxy)的时候,如果打印出代理对象的话,发现一些配置的消息也会被打印。原来是因为Proxy调用对象类的toString()方法时也通过invoke(JDK Proxy)或者intercept(Cglib Proxy)。 总结一下Proxy, CGlig 的使用、原理、 分析Spring中如何通过Proxy, CGlig实现AOP...2011-05-12 16:20:40 · 73 阅读 · 0 评论 -
AOP(1):应用中的几个小故事
I had heared about AOP almost 7 years but only used it in two projects. 7 Years, I still only know few about AOP, if i were not involved in that two projects, i would still know that few.The fact is...2011-05-09 21:49:33 · 113 阅读 · 0 评论 -
异步系统设计:push vs pull
今天讨论问题时,有个同事说系统A是主动去系统B里“拿”消息,我们把它称为“pull”模式。他认为pull方式效率比较低,为什么不用“push”模式呢。就是说让系统B收到消息主动通知并把消息发给系统A。我认为他说的是对的。可是老板给我们讲了一个故事,让我觉得单纯从模式的角度来探讨系统性能有点“坐井观天”。如果系统B通知系统A之后,系统A会消费这条消息,如果这个处理过程包含一系列的复杂操作...2011-05-02 23:59:23 · 247 阅读 · 0 评论 -
Velocity Usage
You can find velocity mannual from http://velocity.apache.org/engine/devel/user-guide.html.Here is summarize on how to use velocity.Velocity Usage:Velocity is a Java-based template engine. ...原创 2011-04-28 22:52:01 · 87 阅读 · 0 评论 -
Java Regular Expression (Java正则表达式)
In current Project, we need to parse log file (written by log4j) and extract dedicated information for future actions: Display info in GUIAnalyze error and send mail to responderBackup key lo...2011-04-23 06:58:44 · 115 阅读 · 0 评论 -
XML Parser:DOM + XPath
There are many kinds of XML Parsers in Java:DOM (JDK embedded DOM implementation)SAXJDOM (It is an alternative to DOM and SAX)Digester (Jakarta commons Digester)JAXB(OXM, JDK1.6 embedded JA...2011-04-23 06:30:23 · 138 阅读 · 0 评论 -
File upload and download in Java Web Application.
最近在项目中遇到一个下载文件的老问题。之所以说是老问题,因为在以前的很多项目中都遇到过,但是当时赶进度,所以在找到解决方案后就草草了事,没有深入的研究、总结一下各种方法,实乃憾事。既然再次遇到,就不能放过。争取在依然很紧张的项目进度中,找出一点时间总结一下Java Web Application开发中涉及到的文件上传、下载解决方案。鉴于博客是写给自己看的,加上时间紧张,所以我会持续更新,不求一...2011-04-21 21:08:37 · 130 阅读 · 0 评论 -
Manage zip content using Java APIs
JDK provide a set of utils to compress and decompress data by zip format. You can find technical guide from http://java.sun.com/developer/technicalArticles/Programming/compression/. Here is my sum...原创 2011-04-21 18:14:31 · 77 阅读 · 0 评论 -
Beanshell: how and where to use beanshell
How to use beanshellbeanshell Manual:http://www.beanshell.org/manual/bshmanual.html "loosely typed" variablesYou can simply omit the types of variables that you use (both primitives and o...原创 2011-04-21 00:33:27 · 97 阅读 · 0 评论 -
Singleton Service in Weblogic Cluster
http://blog.csdn.net/mobicents/article/details/6285932原创 2012-03-21 00:12:01 · 118 阅读 · 0 评论