/** @param serviceReference */ private void addBatchProcessor(ServiceReference serviceReference) { SolrSearchBatchResultProcessor processor = (SolrSearchBatchResultProcessor) osgiComponentContext.locateService(SEARCH_BATCH_RESULT_PROCESSOR, serviceReference); Long serviceId = (Long) serviceReference.getProperty(Constants.SERVICE_ID); batchProcessorsById.put(serviceId, processor); String[] processorNames = getSetting(serviceReference.getProperty(REG_BATCH_PROCESSOR_NAMES), new String[0]); if (processorNames != null) { for (String processorName : processorNames) { batchProcessors.put(processorName, processor); } } // bit of a kludge until I can figure out why felix doesn't wire up the default // processor even though it finds a matching service. boolean defaultBatchProcessor = getSetting( serviceReference.getProperty( SolrSearchBatchResultProcessor.DEFAULT_BATCH_PROCESSOR_PROP), false); if (defaultBatchProcessor) { defaultSearchBatchProcessor = processor; } }
protected void activate(ComponentContext ctxt) { // You may delete all references to metatype service if // your algorithm does not require parameters and return // null in the createParameters() method MetaTypeService mts = (MetaTypeService) ctxt.locateService("MTS"); provider = mts.getMetaTypeInformation(ctxt.getBundleContext().getBundle()); }
/** @param serviceReference */ private void addProvider(ServiceReference serviceReference) { SolrSearchPropertyProvider provider = (SolrSearchPropertyProvider) osgiComponentContext.locateService(SEARCH_PROPERTY_PROVIDER, serviceReference); Long serviceId = (Long) serviceReference.getProperty(Constants.SERVICE_ID); propertyProviderById.put(serviceId, provider); String[] processorNames = getSetting(serviceReference.getProperty(REG_PROVIDER_NAMES), new String[0]); for (String processorName : processorNames) { propertyProvider.put(processorName, provider); } }
protected void activate(ComponentContext ctxt) { MetaTypeService mts = (MetaTypeService) ctxt.locateService("MTS"); provider = mts.getMetaTypeInformation(ctxt.getBundleContext().getBundle()); }
private PermitService getPermitService() { if (context != null) { return (PermitService) context.locateService("PermitService"); // $NON-NLS-1$ } return null; }