JamServiceFactory jsf = JamServiceFactory.getInstance();
JamServiceParams params = jsf.createServiceParams();
CachedClassBuilder cache = new CachedClassBuilder();
// finish initalizing the params and create the service
params.addClassBuilder(cache);
JamService out = jsf.createService(params);
// now go view the xml. we have to do this afterwards so that the
// classloader has been created and is available for linking.
JamXmlReader reader = new JamXmlReader(cache,in,(ElementContext)params);
reader.read();
{
// slightly gross hack to get the class names into the service
List classNames = Arrays.asList(cache.getClassNames());
classNames.addAll(Arrays.asList(out.getClassNames()));
String[] nameArray = new String[classNames.size()];
classNames.toArray(nameArray);
((JamServiceImpl)out).setClassNames(nameArray);
}
return out;