tmpmatchedService = MBBServices.matchMeta((baseUrl != null)?baseUrl:ConfigKeeper.getServiceUrl(), previousCall, soaCall, params, true);
}
if(tmpmatchedService != null && tmpmatchedService.getImplementation() != null) {
MBBService mbbService;
try {
if(tmpmatchedService.isMeta()) {
if(tmpmatchedService.getImplementation().equals(StatsMetaService.class) && params.size() > 7) {
tmpmetaservice = StatsMetaService.get(params.get(7));
tmpmetaservice.setParams(params);
}else {
try {
Method get = tmpmatchedService.getImplementation().getMethod("get", String.class);
if(params.size() > 1)
tmpmetaservice = (MBBMetaService)get.invoke(null, params.get(1));
else
tmpmetaservice = (MBBMetaService)get.invoke(null, (String)null);
tmpmetaservice.setParams(params);
} catch (SecurityException e) {
logger.severe("Something is wrong with the setup of MBB: "+e);
} catch (NoSuchMethodException e) {
logger.severe("Something is wrong with the setup of MBB: "+e);
} catch (IllegalArgumentException e) {
logger.severe("Something is wrong with the setup of MBB: "+e);
} catch (InvocationTargetException e) {
logger.severe("Something is wrong with the setup of MBB: "+e);
}
}
break;
}
mbbService = tmpmatchedService.getImplementation().newInstance();
mbbService.setParams(params);
tmpchain.add(mbbService);
try {
if(mbbService instanceof AccessResourceService) {
previousCall += params.get(1);
mbbService.setUri(params.get(0));
mbbService.setId(MBBService.getServiceId(params.get(0)));
}else {
previousCall += params.get(0);
mbbService.setUri(baseUrl+previousCall);
if(mbbService instanceof ServiceById)
mbbService.setId(previousCall);
else
mbbService.setId(MBBService.getServiceId(previousCall));
}
}catch(IndexOutOfBoundsException ex) {
logger.log(Level.SEVERE, "no previous call information set", ex);
}