users@jersey.java.net

Custom Context type is not injected?

From: Roytman, Alex <Roytmana_at_peacetech.com>
Date: Tue, 17 Feb 2009 00:03:12 -0500

Hello Paul,

I created a custom service which I want to inject using @Context annotation. It gets loaded and registered fine.

I can get it using
  @Context Providers providers;
  providers.getContextResolver(CleanupService.class, null);

but any field or constructor parameter defined as @Context CleanupService cleanupService in Resource or another Provider is not injected. My resolver's getContext() method is never called.


I will try to debug it but if you could give me some hints or if you think it is a bug, I would appreciate

Thank you,
Alex


@Path("position")
public class PositionRecord extends JdoResource {
  private CleanupService cleanupService;

  public PositionRecord(@Context CleanupService cleanupService) {
    this.cleanupService = cleanupService;
  }
  
....


Context resolver is attached