On May 18, 2009, at 7:39 PM, Vincent Massol wrote:
hmm so there's still something not quite right since we have several instances of the same component instantiated in the system: the ones from:
List<XWikiRestComponent> components = componentManager.lookupList(XWikiRestComponent.class);
and the ones from
public <T> T getInstance(Class<T> clazz) throws InstantiateException
In the first case all you need is actually the class name and not the object, right?
Yes. The first lookup is only needed in order to retrieve class names and not the objects. In fact I release all the objects right after the lookup. Actual objects are allocated on demand later by using the factory. It's the restlet plumbing that does that (afaik, it's one object per request) -Fabio