use of org.wso2.carbon.bpel.core.ode.integration.store.repository.BPELPackageInfo in project carbon-business-process by wso2.
the class BPELPackageRepository method getBPELPackages.
public List<BPELPackageInfo> getBPELPackages() throws Exception {
List<BPELPackageInfo> bpelPackages = new ArrayList<BPELPackageInfo>();
try {
if (configRegistry.resourceExists(BPELConstants.REG_PATH_OF_BPEL_PACKAGES)) {
Resource parentCollection = configRegistry.get(BPELConstants.REG_PATH_OF_BPEL_PACKAGES);
// The above registry resource we retrieve only contains set of child collections.
// So we can directly cast the returned object to a string array.
String[] children = (String[]) parentCollection.getContent();
for (int i = children.length - 1; i >= 0; i--) {
bpelPackages.add(getBPELPackageInfo(children[i]));
}
return sortByPackageName(bpelPackages);
}
} catch (RegistryException re) {
handleExceptionWithRollback("Unable to get BPEL Packages from Repository.", re);
}
return null;
}
use of org.wso2.carbon.bpel.core.ode.integration.store.repository.BPELPackageInfo in project carbon-business-process by wso2.
the class TenantProcessStoreImpl method reloadExistingVersionsOfBPELPackage.
/**
* Reload old versions of BPEL package. This is used to handle restart of BPS server.
* At restart based on the last modified time of the BPEL archives we'll reload all the versions
* of that BPEL archive.
*
* @param deploymentContext information about current deployment
* @throws RegistryException on error loading
* resources from registry.
* @throws org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.ProcessManagementException
*/
private void reloadExistingVersionsOfBPELPackage(BPELDeploymentContext deploymentContext) throws RegistryException, ProcessManagementException {
BPELPackageInfo bpelPackage = repository.getBPELPackageInfo(deploymentContext);
String lastActivePackageName = null;
for (String packageName : bpelPackage.getAvailableVersions()) {
if (deploymentUnits.containsKey(packageName)) {
lastActivePackageName = packageName;
} else {
// version of the package
if (null != lastActivePackageName && isConfigRegistryReadOnly()) {
loadExistingBPELPackage(lastActivePackageName);
}
loadExistingBPELPackage(packageName);
}
}
}
Aggregations