}
private void restoreStorageState(final DeploymentPhaseContext phaseContext, final Deployment deployment) {
ServiceRegistry serviceRegistry = phaseContext.getServiceRegistry();
BundleStorage storageProvider = (BundleStorage) serviceRegistry.getRequiredService(IntegrationServices.BUNDLE_STORAGE).getValue();
StorageState storageState = storageProvider.getStorageState(deployment.getLocation());
if (storageState != null) {
deployment.setAutoStart(storageState.isPersistentlyStarted());
deployment.addAttachment(StorageState.class, storageState);
}
}