Hello,
 
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
client.getHttpConnectionManager().getParams().setSoTimeout(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
 get.releaseConnection();
}
 
 
 
Regards

Reply via email to