ITeye博客

Java

共 4 篇文章

mule改头换面历程

这两天将mule重构了一下,主要是类、包、配置文件的重命名;去除了mule的印记。其中配置文件主要是将xml文件的命名空间、顶级标签、以及xsd做了整理。大致记录如下。 类和包的命名重构很简单,在Eclipse中选择javaEE的视图,然后选中org.mule这个包名,右键选择Refactor》Rename。在对话框中将选项“Update Reference”下边的三个选项也都选中,剩下的就很简单了。 这个说起来简单,实际我也走了一段弯路。最开始没注意下边三个选项,结果一个子包一个子包的选中,然后Refactor,累个够呛。 :-) 后经人提醒才注意下边三个选项,于是一切都变得简单自然。 最…

2010-05-20 17:31 · Java

Summary of regular-expression constructs

Regular expression from JDK 1.4, in case of forgetting. Construct Matches Characters x The character x \\ The backslash character \0n The character with octal value 0n (0 <= n <= 7) \0nn The character with octal value 0nn (0 <= n <= 7) \0mnn The character with octal value 0mnn (0 <= m <= 3, 0 <= n …

2008-03-09 22:05 · Java

Thread概念二

1,我们经常会说某些Class线程安全的,另外一些不是线程安全的。那么什么算是“线程安全”呢? A class is thread-safe if it behaves correctly when accessed from multiple threads, regardless of the scheduling or interleaving of the execution of those threads by the runtime environment, and with no additional synchronization or other coordination…

2008-01-25 13:13 · Java

Thread概念整理

两种方式实现 继承 java.lang.Thread和实现Runnable 接口。(好像推荐前者的比较多); 线程状态: new->runnable->running->dead 创建之后为new,调用start后为runnable(注意此时还没有run),系统执行时为running。 在Thread执行完毕或者出现异常(抛出RuntimeException)时,Thread终止。此时状态为dead,此时如果通过start来调用它会抛出RuntimeException异常 :wink: 如果thread在等待资源,或者在试图获得互斥体的时候被阻塞,Thread决定睡眠,进入block状态。在…

2008-01-23 21:24 · Java