use of org.apache.sling.testing.clients.util.config.InstanceConfigException in project sling by apache.
the class OsgiInstanceConfig method restore.
/**
* Restore the current OSGi configuration for the PID defined in the constructor
*
* @throws InstanceConfigException if the config cannot be restored
*/
public InstanceConfig restore() throws InstanceConfigException, InterruptedException {
try {
osgiClient.waitEditConfiguration(WAIT_TIMEOUT, this.configPID, null, config);
LOG.info("restored OSGi config for {}. It is now this: {}", this.configPID, this.config);
} catch (ClientException e) {
throw new InstanceConfigException("Could not edit OSGi configuration", e);
} catch (TimeoutException e) {
throw new InstanceConfigException("Timeout of " + WAIT_TIMEOUT + " ms was reached while waiting for the configuration", e);
}
return this;
}
use of org.apache.sling.testing.clients.util.config.InstanceConfigException in project sling by apache.
the class OsgiInstanceConfig method save.
/**
* Save the current OSGi configuration for the PID defined in the constructor
*
* @throws InstanceConfigException if the config cannot be saved
*/
public InstanceConfig save() throws InstanceConfigException, InterruptedException {
try {
this.config = osgiClient.waitGetConfiguration(WAIT_TIMEOUT, this.configPID);
LOG.info("Saved OSGi config for {}. It is currently this: {}", this.configPID, this.config);
} catch (ClientException e) {
throw new InstanceConfigException("Error getting config", e);
} catch (TimeoutException e) {
throw new InstanceConfigException("Timeout of " + WAIT_TIMEOUT + " ms was reached while waiting for the configuration", e);
}
return this;
}
Aggregations