I have a component UrlManager. Whenever this binds in other components I need to get unique instance of UrlManager. How can I do it ? My DS version is 1.2. Note: Im using Osgi component annotations.
import org.osgi.service.component.annotations.Component;
@Component(immediate=true, name="UrlManager", service={UrlManager.class})
public class UrlManager implements Urls
{
public String getId()
{
}
}
You will want to use ServiceScope.PROTOTYPE service components (and remove
immediate=true
. This feature was introduced in DS 1.3.