}
// Invoke the simple method from a service context
private Map<String, Object> serviceInvoker(String localName, ModelService modelService, Map<String, ? extends Object> context) throws GenericServiceException {
// static java service methods should be: public Map methodName(DispatchContext dctx, Map context)
DispatchContext dctx = dispatcher.getLocalContext(localName);
// check the package and method names
if (modelService.location == null || modelService.invoke == null)
throw new GenericServiceException("Cannot locate service to invoke (location or invoke name missing)");
// get the classloader to use
ClassLoader classLoader = null;
if (dctx != null)
classLoader = dctx.getClassLoader();
// if the classLoader is null, no big deal, SimpleMethod will use the
// current thread's ClassLoader by default if null passed in
try {