Java Code Examples for org.osgi.service.component.annotations.ReferencePolicy#STATIC

The following examples show how to use org.osgi.service.component.annotations.ReferencePolicy#STATIC . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RuleRegistryImpl.java    From openhab-core with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Bind the {@link RuleTemplateRegistry} service - called from DS.
 *
 * @param templateRegistry a {@link RuleTemplateRegistry} service.
 */
@Reference(cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.STATIC)
protected void setTemplateRegistry(TemplateRegistry<RuleTemplate> templateRegistry) {
    if (templateRegistry instanceof RuleTemplateRegistry) {
        this.templateRegistry = (RuleTemplateRegistry) templateRegistry;
        templateRegistry.addRegistryChangeListener(this);
    }
}
 
Example 2
Source File: RuleRegistryImpl.java    From smarthome with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Bind the {@link RuleTemplateRegistry} service - called from DS.
 *
 * @param templateRegistry a {@link RuleTemplateRegistry} service.
 */
@Reference(cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.STATIC)
protected void setTemplateRegistry(TemplateRegistry<RuleTemplate> templateRegistry) {
    if (templateRegistry instanceof RuleTemplateRegistry) {
        this.templateRegistry = (RuleTemplateRegistry) templateRegistry;
        templateRegistry.addRegistryChangeListener(this);
    }
}
 
Example 3
Source File: CodingService.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.STATIC, policyOption = ReferencePolicyOption.GREEDY)
public synchronized void bindFhirTransformer(ICodingContribution contribution){
	if (contributions == null) {
		contributions = new ArrayList<ICodingContribution>();
	}
	if(contribution.getCodeSystem() != null && !contribution.getCodeSystem().isEmpty()) {
		contributions.add(contribution);
		if (contribution instanceof ILocalCodingContribution) {
			localCoding = (ILocalCodingContribution) contribution;
		}
	} else {
		getLogger().warn(
			"Contribution " + contribution + " returns no code system. It will be ignored.");
	}
}
 
Example 4
Source File: ValueSetService.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.STATIC, policyOption = ReferencePolicyOption.GREEDY)
public synchronized void bindContribution(IValueSetContribution contribution){
	if (contribution.getValueSetIds() != null && !contribution.getValueSetIds().isEmpty()) {
		addContribution(contribution);
	} else {
		getLogger().warn(
			"Contribution " + contribution + " returns no value set ids. It will be ignored.");
	}
}
 
Example 5
Source File: LibraryClasspathContainerResolverService.java    From google-cloud-eclipse with Apache License 2.0 4 votes vote down vote up
@Reference(cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.STATIC)
public void setRepositoryService(ILibraryRepositoryService repositoryService) {
  this.repositoryService = repositoryService;
}
 
Example 6
Source File: ManagedRuleProvider.java    From smarthome with Eclipse Public License 2.0 4 votes vote down vote up
@Reference(cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.STATIC)
@Override
protected void setStorageService(final StorageService storageService) {
    super.setStorageService(storageService);
}
 
Example 7
Source File: PaperUIApp.java    From smarthome with Eclipse Public License 2.0 4 votes vote down vote up
@Reference(policy = ReferencePolicy.STATIC)
protected void setHttpService(HttpService httpService) {
    this.httpService = httpService;
}
 
Example 8
Source File: PaperUIApp.java    From smarthome with Eclipse Public License 2.0 4 votes vote down vote up
@Reference(policy = ReferencePolicy.STATIC)
public void setHttpContextFactoryService(HttpContextFactoryService httpContextFactoryService) {
    this.httpContextFactoryService = httpContextFactoryService;
}
 
Example 9
Source File: ElexisEntityManger.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
@Reference(service = EntityManagerFactoryBuilder.class, cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.STATIC, target = "(osgi.unit.name=elexis)")
protected synchronized void bind(EntityManagerFactoryBuilder factoryBuilder){
	logger.debug("Binding " + factoryBuilder.getClass().getName());
	this.factoryBuilder = factoryBuilder;
}
 
Example 10
Source File: RuleRegistryImpl.java    From openhab-core with Eclipse Public License 2.0 2 votes vote down vote up
/**
 * Bind the {@link ModuleTypeRegistry} service - called from DS.
 *
 * @param moduleTypeRegistry a {@link ModuleTypeRegistry} service.
 */
@Reference(cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.STATIC)
protected void setModuleTypeRegistry(ModuleTypeRegistry moduleTypeRegistry) {
    this.moduleTypeRegistry = moduleTypeRegistry;
}
 
Example 11
Source File: RuleRegistryImpl.java    From smarthome with Eclipse Public License 2.0 2 votes vote down vote up
/**
 * Bind the {@link ModuleTypeRegistry} service - called from DS.
 *
 * @param moduleTypeRegistry a {@link ModuleTypeRegistry} service.
 */
@Reference(cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.STATIC)
protected void setModuleTypeRegistry(ModuleTypeRegistry moduleTypeRegistry) {
    this.moduleTypeRegistry = moduleTypeRegistry;
}