private static Log log = LogFactory.getLog(SessionProviderFactory.class);
private static SessionProviderFactory instance;
HashMap providers = new HashMap();
SessionProviderFactory() {
ExtensionClassLoader classloader = ConfigurationLoader.getExtensionClassLoader();
try {
Enumeration en = classloader.getResources("session.provider");
URL url = null;
Properties properties;
InputStream in;
SessionProvider provider;
String name;
String id;
while (en.hasMoreElements()) {
try {
url = (URL) en.nextElement();
in = url.openStream();
properties = new Properties();
properties.load(in);
IOUtil.closeStream(in);
if (properties.containsKey("provider.class") &&
properties.containsKey("provider.name")) {
Class cls = classloader.loadClass(properties.getProperty(
"provider.class"));
String optionsClassName = properties.getProperty(
"provider.options");
Class optionsClass = ((optionsClassName == null) ||
optionsClassName.equals("")) ? null
: classloader.loadClass(optionsClassName);
String pageclass;
int num = 1;
Vector pages = new Vector();
do {
pageclass = properties.getProperty("property.page." +
String.valueOf(num), null);
if (pageclass != null) {
pages.add(classloader.loadClass(pageclass));
num++;
}
} while (pageclass != null);
Class[] propertypages = new Class[pages.size()];