private final List m_processors = new ArrayList();
protected void doExecute(DeploymentSessionImpl session) throws Exception {
for (ListIterator i = m_processors.listIterator(m_processors.size()); i.hasPrevious();) {
ResourceProcessor processor = (ResourceProcessor) i.previous();
try {
processor.prepare();
}
catch (ResourceProcessorException e) {
session.getLog().log(LogService.LOG_ERROR, "Preparing commit for resource processor failed", e);
// Check what error code we got...
if (e.getCode() == ResourceProcessorException.CODE_PREPARE) {
throw new DeploymentException(DeploymentException.CODE_COMMIT_ERROR, "Preparing commit for resource processor failed!", e);
}
throw new DeploymentException(e.getCode(), "Preparing commit for resource processor failed!", e);
}
catch (Exception e) {
session.getLog().log(LogService.LOG_ERROR, "Preparing commit for resource processor failed", e);
throw new DeploymentException(DeploymentException.CODE_OTHER_ERROR, "Preparing commit for resource processor failed", e);
}
}
for (ListIterator i = m_processors.listIterator(m_processors.size()); i.hasPrevious();) {
ResourceProcessor processor = (ResourceProcessor) i.previous();
try {
processor.commit();
}
catch (Exception e) {
// We cannot throw an exception, see OSGi spec.
session.getLog().log(LogService.LOG_ERROR, "Committing resource processor '" + processor + "' failed", e);
}