日期:2014-05-18 浏览次数:20675 次
package com.wanghy.j2ee;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Properties;
import javax.ejb.EJBObject;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;
public class EjbTools {
private static final String PROPERTY_FILE_NAME = "EjbTools.properties";
private static Properties props;
private synchronized void loadProperties() throws IOException {
if(props == null){
java.io.InputStream inputstream = ClassLoader.getSystemClassLoader().getResourceAsStream(PROPERTY_FILE_NAME);
if (inputstream == null){
inputstream = this.getClass().getClassLoader().getResourceAsStream(PROPERTY_FILE_NAME);
if (inputstream == null){
throw new IOException("Read properties file error:" + PROPERTY_FILE_NAME);
}
}
&nb