}
catch (Exception ex) {
throw new ServletException(ex);
}
}
HproseMethods methods = service.getGlobalMethods();
param = config.getInitParameter("class");
if (param != null) {
try {
String[] classNames = HproseHelper.split(param, ',', 0);
for (int i = 0, n = classNames.length; i < n; i++) {
String[] name = HproseHelper.split(classNames[i], '|', 3);
Class type = Class.forName(name[0]);
Object obj = type.newInstance();
Class ancestorType;
if (name.length == 1) {
methods.addInstanceMethods(obj, type);
}
else if (name.length == 2) {
for (ancestorType = Class.forName(name[1]);
ancestorType.isAssignableFrom(type);
type = type.getSuperclass()) {
methods.addInstanceMethods(obj, type);
}
}
else if (name.length == 3) {
if (name[1].equals("")) {
methods.addInstanceMethods(obj, type, name[2]);
}
else {
for (ancestorType = Class.forName(name[1]);
ancestorType.isAssignableFrom(type);
type = type.getSuperclass()) {
methods.addInstanceMethods(obj, type, name[2]);
}
}
}
}
}
catch (Exception ex) {
throw new ServletException(ex);
}
}
param = config.getInitParameter("staticClass");
if (param != null) {
try {
String[] classNames = HproseHelper.split(param, ',', 0);
for (int i = 0, n = classNames.length; i < n; i++) {
String[] name = HproseHelper.split(classNames[i], '|', 2);
Class type = Class.forName(name[0]);
if (name.length == 1) {
methods.addStaticMethods(type);
}
else {
methods.addStaticMethods(type, name[1]);
}
}
}
catch (Exception ex) {
throw new ServletException(ex);