public DeploymentContext determineStructure(Deployment deployment) throws DeploymentException { StructureBuilder builder = getStructureBuilder(); if (builder == null) throw new IllegalStateException("No structure builder has been configured"); Attachments attachments = deployment.getPredeterminedManagedObjects(); StructureMetaData structureMetaData = attachments.getAttachment(StructureMetaData.class); if (structureMetaData == null) { structureMetaData = StructureMetaDataFactory.createStructureMetaData(); try { determineStructure(deployment, structureMetaData); } catch (DeploymentException e) { throw e; } catch (Throwable t) { throw DeploymentException.rethrowAsDeploymentException("Exception determining structure: " + deployment, t); } } return structureBuilder.populateContext(deployment, structureMetaData); }
public DeploymentContext determineStructure(Deployment deployment) throws DeploymentException { StructureBuilder builder = getStructureBuilder(); if (builder == null) throw new IllegalStateException("No structure builder has been configured"); Attachments attachments = deployment.getPredeterminedManagedObjects(); StructureMetaData structureMetaData = attachments.getAttachment(StructureMetaData.class); if (structureMetaData == null) { structureMetaData = StructureMetaDataFactory.createStructureMetaData(); try { determineStructure(deployment, structureMetaData); } catch (DeploymentException e) { throw e; } catch (Throwable t) { throw DeploymentException.rethrowAsDeploymentException("Exception determining structure: " + deployment, t); } } return structureBuilder.populateContext(deployment, structureMetaData); }