Closed col-panic closed 8 years ago
I found that during initialization, all resources get added to the resources, in JAXRSConnector (see lower), while during createJerseyContext the applicationConfigurations is passed?!
JAXRSConnector( BundleContext bundleContext ) {
this.bundleContext = bundleContext;
this.configuration = new Configuration( this );
this.httpServices = new ServiceContainer( bundleContext );
this.resources = new ServiceContainer( bundleContext );
this.contextMap = new HashMap<HttpService, JerseyContext>();
this.resourceCache = new ArrayList<ServiceHolder>();
this.applicationConfigurations = new ServiceContainer( bundleContext );
}
So by implementing ApplicationConfiguration in my @Path or @Provider classes those are added to this.resources, while instantiation is done via this.applicationConfigurations?!
I see that the ApplicationConfigurationTracker is not considering the file, even though its implementing ApplicationConfiguration and the resource itself works - not sure why this is the case on the following file
@Path("/webdav")
public class ElexisWebDAVService implements ApplicationConfiguration {
Allright, stupid me ... in the OSGI-INF DS description, the resp. service has to declare that it provides the ApplicationConfiguration service in order for the tracker to take care of it! Sorry for bothering, might be a good addition to the ds example however - interested in a pull request for that?
I have tried to provide additional configuration to the application startup, yet my method is not even called. While I tracked down, that my service is being registered in a ServiceContainer, it seems that during startup a different ServiceContainer is handed over to the specific code in JerseyContext
applyApplicationConfigurations where no Services are available
The call to initializing the properties in the beginning points to
// for testing purposes JAXRSConnector#createJerseyContext
any hint on this?? thank you!