{
System.out.println("XMLRPCServer:");
try
{
_server = new WebServer(PowerPakConfig.XMLRPC_PORT, InetAddress.getByName(PowerPakConfig.XMLRPC_HOST));
XmlRpcServer xmlServer = _server.getXmlRpcServer();
PropertyHandlerMapping phm = new PropertyHandlerMapping();
xmlServer.setHandlerMapping(phm);
int numServices = 0;
try
{
L2Properties p = new L2Properties("config/powerpak/xmlrpc.service");
for(Object s : p.keySet())
{
String service = p.getProperty(s.toString());
Class<?> clazz = Class.forName(service);
if(clazz != null)
{
numServices++;
phm.addHandler(s.toString(), clazz);
}
}
}
catch(Exception e)
{
if(Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();
}
if(numServices > 0)
{
XmlRpcServerConfigImpl serverConfig = (XmlRpcServerConfigImpl) xmlServer.getConfig();
serverConfig.setEnabledForExtensions(true);
serverConfig.setContentLengthOptional(false);
_server.start();
System.out.println("...Listen on " + PowerPakConfig.XMLRPC_HOST + ":" + PowerPakConfig.XMLRPC_PORT + ", " + numServices + " service(s) avaliable");
}