Oh, I answered my own question on this one. setServiceBean.
On Wed, Jan 26, 2011 at 3:43 PM, Benson Margulies <[email protected]> wrote: > I'm expecting there to be one and only one instance of > RdfVisualizationService, but I'm seeing CXF create new ones upon > receipt of requests. I'm a bit confused by this, since I have other > rest-ful endpoints created via the API that have state and so > shouldn't work if this happens to them, but which seem to be working > just fine. The only 'interesting' thing about this one is that I > specify providers, which I've not done before. > > public void start() throws IOException { > endpointAddress = "http://localhost:" + port; > JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean(); > sf.setResourceClasses(RdfVisualizationService.class); > RdfVisualizationService service = new > RdfVisualizationService(risEndpointAddress); > sf.setResourceProvider(QueryService.class, new > SingletonResourceProvider(service)); > List<VisualizationParamsProvider> providers = new > ArrayList<VisualizationParamsProvider>(); > providers.add(new VisualizationParamsProvider()); > sf.setProviders(providers); > sf.setAddress(endpointAddress); > queryEndpoint = sf.create(); > } >
