felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <christophe.demot...@orange-ftgroup.com>
Subject problem with obr command when the repository is down
Date Wed, 30 Apr 2008 13:48:22 GMT
when the configured repository in config.properties file is down, the
obr command, or usage of RepositoryAdmin command in java block until
network timeout. The simple command: obr list
wait for a long time until this timeout. It's very disappointed !
I have a bundle which have to automatically load bundle by using
RepositoryAdmin api. So, to not have this problem, I use the apache
HttpClient project, which can try to open a http connection with a
specific timeout. Why this mechanism isn't used in the bundle repository
For example: 
HttpClient client = new HttpClient();
// set proxy
client.getHostConfiguration().setProxy(proxyHost, port);
// set specific timeout
GetMethod get = new GetMethod(location);
boolean active = false;
try {
 // execute the GET
 int status = client.executeMethod( get );
 if (status == HttpStatus.SC_OK) {
  active = true;
} catch (Exception e) {
 // nothing to do, active is false
finally {
 // release any connection resources used by the method

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message