*/
public List<ActivityDO> getAllActivities() throws BAMException {
List<ActivityDO> activities = BAMConfigurationCache.getAllActivities();
BAMConfigurationDSClient client = null;
try {
if (activities == null || activities.size() <= 0) {
client = BAMUtil.getBAMConfigurationDSClient();
ActivityDO[] activitiesArray = client.getAllActivities();
if (activitiesArray != null) {
activities = new ArrayList<ActivityDO>(activitiesArray.length);
activities.addAll(Arrays.asList(activitiesArray));
}
}
for (ActivityDO activity : activities) {
BAMConfigurationCache.addActivity(activity.getActivityKeyId(), activity);
}
return activities;
} finally {
if (client != null) {
client.cleanup();
}
}
}