To all:

This is a bit frustrating, as I just don’t see a way to get a list of 
registered CXF busses (for either a single bundle, or all bundles)

The following code seems to let me access busses on a per-bundle basis:
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.cxf.karaf/cxf-karaf-commands/3.1.1/org/apache/cxf/karaf/commands/internal/CXFControllerImpl.java?av=f

But this does not work for me (in a non-karaf environment, specifically OSGi 
enRoute).  I’ve tried both of the following:
 - ServiceReference[] references = 
bundleContext.getServiceReferences(Bus.class.getName(), null);
 - ServiceReference[] references = 
bundleContext.getServiceReferences(ExtensionManagerBus.class.getName(), null);

But further, once I get access to an existing bus, there does not seem to be a 
means to get the associated alias:


——


An alternative approach is to proceed as follows:
 - The HTTPService instance contains an aliasMap, associating each alias to a 
servlet
 - Each servlet (potentially) references a bus

So asking the HTTPService for its aliasMap would be the best way of:
 - Checking to see if a given alias is already instantiated
 - Fetching either the servlet or bus for a given alias
 - Determine if the httpService.register(alias, ….) or 
httpService.unregister(alias) will succeed before calling

Makes perfect sense, but the HTTPService instance does not expose its aliasMap. 
 Go figure.


——


Anyhow, thought I’d ask again if there are any tips for fetching a list of 
existing CXF busses or HTTP Servlets.  Your thoughts?


Thanks,
Randy Leonard
[email protected]
[email protected]


On Aug 26, 2016, at 3:20 PM, Randy Leonard <[email protected]> wrote:

> A quick question… 
> - is it possible to obtain from an OSGi bundle the list of servlets 
> registered by that bundle?
> - or conversely, is it possible to obtain the servlet associated with each 
> bus?
> 
> Thanks,
> Randy Leonard
> [email protected]
> [email protected]
> 

Reply via email to