There are couple approaches I have taken and both worked.
1. Using annotation
Code:
@PostConstruct
public void test() {
HarvestController harvestController = null;
harvestController = new HarvestController("atowus", "XXX", "6969");
TreeSet<Version> versionSet = null;
try {
versionSet = harvestController.getVersionsInFolder(Integer.parseInt(packageId), fullPathStr);
} catch (JCaHarvestException ex) {
Logger.getLogger(TreeBean.class.getName()).log(Level.SEVERE, null, ex);
} catch (Exception ex) {
Logger.getLogger(TreeBean.class.getName()).log(Level.SEVERE, null, ex);
}
setTreeSetFileView(versionSet);
}
The @PostConstruct annotated method will be called by the container after the bean has been constructed and before any business methods of the bean are executed.
2. W/o annotation also worked but you have to manually call the method.
Annotation ROCKS!
Thanks
Hobi