`
文章列表
package com.epay.web; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.Charset; import java.util.HashMap; import java.util.Map; import java.util.Set; /** * 根据银行卡Code获得银行卡信息测试类[该类仅仅是测试类、欢迎指 ...

maven报错解决

Maven项目报错:Missing artifact com.sun:tools:jar:1.5.0   解决方案:  
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; public class DeleteOnCloseFileInputStream     extends FileInputStream {     private final File file;     private boolean delete = true;     public DeleteOnCloseFileInputStream(Fi ...

ThreadFactory

package com.google.code.yanf4j.util; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; /** * Thread factory for worker thread * * @author dennis * */ public class WorkerThreadFactory implements ThreadFactory { private static final Ato ...

Java NIO

package com.google.code.yanf4j.util; import java.io.IOException; import java.lang.reflect.Method; import java.net.InetAddress; import java.net.InetSocketAddress; import java.nio.channels.Selector; import java.nio.channels.spi.SelectorProvider; import java.util.Queue; /** * System util ...

Quartz时间调度

Quartz整理总结
详细讲解数字证书和安全的地址: http://www.cnblogs.com/JeffreySun/archive/2010/06/24/1627247.html
/** * Show HTTP header information. */ protected void showRequestInfo(HttpServletRequest req) { System.out.println(); System.out.println("SlideDAV Request Info"); System.out.println(); // Show generic info System.out.pri ...
在阅读tomcat4源码中发现删除数组中的元素的方法,记录一下。 private Service services[] = new Service[0]; public void removeService(Service service) { synchronized (services) { int j = -1;//删除元素在数据中的 索引 for (int i = 0; i < services.length; i++) { if (service == servi ...
ContentHandler接口定义: 共11个接口定义。 Digester库中Digester类实现了ContentHandler的11个接口方法。 Digester库中类、接口定义: RulesBase(implements Rules)类定义: 该类是为Digester类服务的。 RuleSetBase类定义: Rule抽象类定义: ObjectCreateRule类定义如下:

java访问JVM和OS信息

    博客分类:
  • jdk
JVM Version System.getProperty("java.runtime.version"); JVM Vendor System.getProperty("java.vm.vendor"); OS Name System.getProperty("os.name"); OS Version System.getProperty("os.version"); OS Arch System.getProperty("os.arch");
1.控制线程 1.1 join线程Thread类的三个重载方法   public final void join() throws InterruptedException   public final synchronized void join(long millis)                         throws InterruptedException   public final synchronized void join(long millis, int n ...

Log4E

Quick Start - Go to Log4E preferences page and choose the appropriate logger. You can choose between Log4j, SLF4J, Commons Logger or JDK 1.4 Logging. - Go to a Java Editor (open a .java file) - Place the textcursor within a method - Right click in the editor and choose "Log4E > Insert Log Sta ...

动态修改xml文件

接上篇文章动态修改properties文件,中的FileWacthdog.java作为父类,代码如下:   import org.apache.commons.digester.Digester; /** * <p> * Info: 动态加载collectionsFavourableActivity.xml文件,<br /> * 该文件使用 common-digester 库解析因此解析的文件要符合digester库要求的格式。 * </p> * <p> * Date: 2014-4-28 14:22:54 ...
在实际的项目中有些数据是临时数据不必要保存到数据库中因此保存到properties配置文件中也是不错的选择。 但是保存在文件中的弊端就是如果要修改就需要修改配置文件了,做成可视化的配置界面有点偏移主题了。 以下代码参考的log4j-x-x.jar中的文件并做少许更改。 具体代码程序实现:扫描文件类FileWatchdog.java   import java.io.File; /** Check every now and then that a certain file has not changed. If it has, then call the {@link ...
Global site tag (gtag.js) - Google Analytics