📄 jndiproperties.java
字号:
/**
* $Log: JndiProperties.java,v $
* Revision 1.1 2003/02/12 16:52:56 mwulff
* initial version
*
* Revision 1.1 2003/01/16 13:11:41 mwulff
* initial version
*
* Revision 1.2 2002/12/14 22:43:08 mwulff
* no message
*
* Revision 1.1 2002/11/22 16:41:50 mwulff
* moved
*
* Revision 1.1 2002/11/15 18:20:56 mwulff
* initial version
*
*/
package de.fhm.jkf.comm.sv;
import java.util.Properties;
import javax.naming.Context;
/**
* @author marten wulff
*/
public class JndiProperties {
private String factory = null;
private String providerUrl = null;
private String packagePrefixes = null;
private Properties props = null;
private static Object semaphore = new Object();
public JndiProperties() {
}
public JndiProperties(
String factory,
String factoryUrl,
String packagePrefixes) {
this.factory = factory;
this.providerUrl = factoryUrl;
this.packagePrefixes = packagePrefixes;
}
/**
* Returns the factory.
* @return String
*/
public String getFactory() {
return factory;
}
/**
* Returns the providerUrl.
* @return String
*/
public String getProviderUrl() {
return providerUrl;
}
/**
* Returns the packagePrefixes.
* @return String
*/
public String getPackagePrefixes() {
return packagePrefixes;
}
/**
* Sets the factory.
* @param factory The factory to set
*/
public void setFactory(String factory) {
this.factory = factory;
}
/**
* Sets the providerUrl.
* @param providerUrl The providerUrl to set
*/
public void setProviderUrl(String factoryUrl) {
this.providerUrl = factoryUrl;
}
/**
* Sets the packagePrefixes.
* @param packagePrefixes The packagePrefixes to set
*/
public void setPackagePrefixes(String packagePrefixes) {
this.packagePrefixes = packagePrefixes;
}
public Properties getProperties() {
if (props == null) {
if (props == null) {
synchronized (semaphore) {
props = new Properties();
if (factory != null
&& providerUrl != null
&& packagePrefixes != null) {
props.put(Context.INITIAL_CONTEXT_FACTORY, factory);
props.put(Context.PROVIDER_URL, providerUrl);
props.put(Context.URL_PKG_PREFIXES, packagePrefixes);
}
}
}
}
return props;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -