* @param soaCall String representation of an URL which defined the SOA call
* @return a {@link ServiceChain} object decoded from given URL
*/
public static final ServiceChain decode(String soaCall, String baseUrl) {
List<MBBService> tmpchain = new ArrayList<MBBService>();
MBBMetaService tmpmetaservice = null;
String previousCall = "";
List<String> params;
MBBServices tmpmatchedService = null;
while(true) {
params = new ArrayList<String>();
tmpmatchedService = MBBServices.match((baseUrl != null)?baseUrl:ConfigKeeper.getServiceUrl(), previousCall, soaCall, params, true);
if(tmpmatchedService == null) {
params = new ArrayList<String>();
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) {