// FileSystemXmlApplicationContext appCtx =
// new FileSystemXmlApplicationContext("file:" + springFile.getAbsolutePath());
//return (Collection<FacetHandler<?>>) appCtx.getBean("handlers");
Set<Entry<Class<?>,Object>> entries = workArea.map.entrySet();
FileSystemXmlApplicationContext appCtx = new FileSystemXmlApplicationContext();
for (Entry<Class<?>,Object> entry : entries){
Object obj = entry.getValue();
if (obj instanceof ClassLoader){
appCtx.setClassLoader((ClassLoader)obj);
break;
}
}
String absolutePath = file.getAbsolutePath();
String partOne = absolutePath.substring(0, absolutePath.lastIndexOf("/"));
String partTwo = URLEncoder.encode(absolutePath.substring(absolutePath.lastIndexOf("/") + 1), "UTF-8");
absolutePath = partOne + "/" + partTwo;
File springFile = new File(new File(absolutePath), SPRING_CONFIG);
appCtx.setConfigLocation("file:" + springFile.getAbsolutePath());
appCtx.refresh();
return (Collection<FacetHandler<?>>) appCtx.getBean("handlers");
}