public class SolrServerPublishingComponent extends Object
CoreContainer (registered as
OSGI service) where
SolrConstants.PROPERTY_SERVER_PUBLISH_REST is enabled via a
SolrDispatchFilter under /{global-prefix}/{server-name}
where global-prefix is the configured GLOBAL_PREFIX value
server-name is the SolrConstants.PROPERTY_SERVER_NAME
property of the ServiceReference for the CoreContainer.
Note that CoreContainer without a value for the
server name properties are not
published.
To publish specific CoreContainer at specific paths one can use the
SolrDispatchFilterComponent.
SolrDispatchFilterComponent| Modifier and Type | Field and Description |
|---|---|
protected org.osgi.service.component.ComponentContext |
context |
protected org.apache.felix.http.api.ExtHttpService |
extHttpService
Will only work within Apache Felix.
|
protected Map<String,List<org.osgi.framework.ServiceReference>> |
solrServerRefMap
The key is the name and the value represents a sorted list of
ServiceReference to CoreContainer based on the
SolrConstants.PROPERTY_SERVER_RANKING value. |
| Constructor and Description |
|---|
SolrServerPublishingComponent() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate(org.osgi.service.component.ComponentContext context) |
protected void |
deactivate(org.osgi.service.component.ComponentContext context) |
protected void |
updateFilter(String name,
org.osgi.framework.ServiceReference ref,
org.apache.solr.core.CoreContainer server)
A change was made to the tracked CoreContainer (adding ,removal, ranking change).
|
protected final Map<String,List<org.osgi.framework.ServiceReference>> solrServerRefMap
ServiceReference to CoreContainer based on the
SolrConstants.PROPERTY_SERVER_RANKING value.
Used to synchronise calls from the tracker (so that not to
update two Filters at the same time.
@Reference protected org.apache.felix.http.api.ExtHttpService extHttpService
Filters
is not part of the standard OSGI HttpService and therefore each
OSGI implementation currently defines its own Interface to allow this.To make this available in every OSGI Environment we would need to implement an own service with different implementation for supported OSGI Environments - or to wait until the standard is updated to also support filters.
protected org.osgi.service.component.ComponentContext context
@Activate
protected void activate(org.osgi.service.component.ComponentContext context)
throws org.osgi.service.cm.ConfigurationException,
javax.servlet.ServletException
org.osgi.service.cm.ConfigurationExceptionjavax.servlet.ServletExceptionprotected void updateFilter(String name, org.osgi.framework.ServiceReference ref, org.apache.solr.core.CoreContainer server)
name - The name of the filter to be updatedref - The serviceReference for the new CoreContainer to be added for
the parsed name. null if the filter for that name needs only
to be removedserver - The CoreContainer may be parsed in cases a reference
is already available. If not the tracker is used to look it up
based on the parsed reference. This is basically a workaround for the
fact that if the call originates form
ServiceTrackerCustomizer.addingService(ServiceReference) the
CoreContainer is not yet available via the tracker.@Deactivate protected void deactivate(org.osgi.service.component.ComponentContext context)
Copyright © 2010–2016 The Apache Software Foundation. All rights reserved.