org.xwiki.rest
Class ComponentsObjectFactory

java.lang.Object
  extended by org.xwiki.rest.ComponentsObjectFactory
All Implemented Interfaces:
org.restlet.ext.jaxrs.ObjectFactory

public class ComponentsObjectFactory
extends java.lang.Object
implements org.restlet.ext.jaxrs.ObjectFactory

This class is used to provide Restlet/JAX-RS a way to instantiate components. Instances requested through this factory are created using the XWiki component manager. A special list stored in the current Restlet context is used in order to keep track of all the allocated components that have a "per-lookup" policy. This is needed in order to ensure proper release of those instances and to avoid memory leaks.

Version:
$Id: ComponentsObjectFactory.java 21281 2009-06-13 19:22:09Z sdumitriu $

Constructor Summary
ComponentsObjectFactory(org.xwiki.component.manager.ComponentManager componentManager)
          Constructor
 
Method Summary
<T> T
getInstance(java.lang.Class<T> clazz)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentsObjectFactory

public ComponentsObjectFactory(org.xwiki.component.manager.ComponentManager componentManager)
Constructor

Parameters:
componentManager - The component manager to be used.
Method Detail

getInstance

public <T> T getInstance(java.lang.Class<T> clazz)
              throws org.restlet.ext.jaxrs.InstantiateException
Specified by:
getInstance in interface org.restlet.ext.jaxrs.ObjectFactory
Throws:
org.restlet.ext.jaxrs.InstantiateException


Copyright © 2004-2009 XWiki. All Rights Reserved.