org.osgi.service.component.annotations.Reference Java Examples

The following examples show how to use org.osgi.service.component.annotations.Reference. 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: DataServiceCappDeployerServiceComponent.java    From micro-integrator with Apache License 2.0 6 votes vote down vote up
@Reference(
        name = "org.wso2.micro.application.deployer.handler",
        service = org.wso2.micro.application.deployer.handler.AppDeploymentHandler.class,
        cardinality = ReferenceCardinality.AT_LEAST_ONE,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetDataServiceCappDeployer")
protected void setDataServiceCappDeployer(AppDeploymentHandler appDeploymentHandler) {
    if (appDeploymentHandler instanceof DataSourceCappDeployer) {
        if (Objects.isNull(ctx)) {
            // save appDeploymentHandler
            appDepHandler = appDeploymentHandler;
        } else {
            registerDataServiceCappDeployer();
        }
    }
}
 
Example #2
Source File: TasksDSComponent.java    From micro-integrator with Apache License 2.0 6 votes vote down vote up
@Reference(name = "org.wso2.carbon.ndatasource",
           service = DataSourceService.class,
           cardinality = ReferenceCardinality.MANDATORY,
           policy = ReferencePolicy.DYNAMIC,
           unbind = "unsetDatasourceHandlerService")
protected void setDatasourceHandlerService(DataSourceService dataSourceService) {
    this.dataSourceService = dataSourceService;
}
 
Example #3
Source File: MediationStatisticsComponent.java    From micro-integrator with Apache License 2.0 6 votes vote down vote up
@Reference(name = "synapse.registrations.service",
        service = SynapseRegistrationsService.class,
        cardinality = ReferenceCardinality.AT_LEAST_ONE,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetSynapseRegistrationsService")
protected void setSynapseRegistrationsService(SynapseRegistrationsService registrationsService) {

    ServiceRegistration synEnvSvcRegistration = registrationsService.getSynapseEnvironmentServiceRegistration();
    try {
        if (activated && compCtx != null) {
            SynapseEnvironmentService synEnvSvc = (SynapseEnvironmentService) compCtx.getBundleContext()
                    .getService(synEnvSvcRegistration.getReference());
            createStores(synEnvSvc);
        }
    } catch (Throwable t) {
        log.fatal("Error occurred at the osgi service method", t);
    }
}
 
Example #4
Source File: CryptoImplComponent.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
@Reference(name = "externalCryptoProvider",
        service = ExternalCryptoProvider.class,
        cardinality = ReferenceCardinality.MULTIPLE,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetExternalCryptoProvider")
public void setExternalCryptoProvider(ExternalCryptoProvider externalCryptoProvider) {

    this.defaultCryptoService.registerExternalCryptoProvider(externalCryptoProvider);
    if (log.isDebugEnabled()) {
        log.debug(String.format("'%s' has been injected as an external crypto provider.",
                                externalCryptoProvider.getClass().getCanonicalName()));
    }
}
 
Example #5
Source File: DataServicesDSComponent.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
@Reference(
        name = "secret.callback.handler.service",
        service = org.wso2.carbon.securevault.SecretCallbackHandlerService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetSecretCallbackHandlerService")
protected void setSecretCallbackHandlerService(
        SecretCallbackHandlerService secretCallbackHandlerService) {
    if (log.isDebugEnabled()) {
        log.debug("SecretCallbackHandlerService acquired");
    }
    DataServicesDSComponent.secretCallbackHandlerService = secretCallbackHandlerService;

}
 
Example #6
Source File: WrapperMetricsServlet.java    From sling-whiteboard with Apache License 2.0 5 votes vote down vote up
@Reference(service = MetricRegistry.class, cardinality = ReferenceCardinality.MULTIPLE,
        policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY)
void bindMetricRegistry(MetricRegistry metricRegistry, Map<String, Object> properties) {
    
    log.info("Binding Metrics Registry...");
    
    String name = registryName(metricRegistry, properties);
    
    CopyMetricRegistryListener listener = new CopyMetricRegistryListener(this.metrics, metricRegistry, name);
    listener.start();
    childRegistries.put(metricRegistry, listener);
    log.info("Bound Metrics Registry {} ", name);
}
 
Example #7
Source File: ServiceComponent.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
@Reference(name = "config.context.service",
        service = Axis2ConfigurationContextService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetConfigurationContext")
protected void setConfigurationContext(Axis2ConfigurationContextService configCtx) {
    DataHolder.getInstance().setConfigCtx(configCtx.getServerConfigContext());
}
 
Example #8
Source File: NtaskService.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
@Reference(
        name = "config.context.service",
        service = Axis2ConfigurationContextService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetConfigurationContextService")
protected void setConfigurationContextService(Axis2ConfigurationContextService contextService) {

    if (logger.isDebugEnabled()) {
        logger.debug("Setting Configuration Context Service [" + contextService + "]");
    }
    NtaskService.ccServiceInstance = contextService;
    updateAndCleanupObservers();
}
 
Example #9
Source File: DataSourceServiceComponent.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
@Reference(
name = "secret.callback.handler.servicee",
service = org.wso2.carbon.securevault.SecretCallbackHandlerService.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetSecretCallbackHandlerService")
 protected void setSecretCallbackHandlerService(
         SecretCallbackHandlerService secretCallbackHandlerService) {
 	if (log.isDebugEnabled()) {
 		log.debug("SecretCallbackHandlerService acquired");
 	}
 	DataSourceServiceComponent.secretCallbackHandlerService = secretCallbackHandlerService;
 	this.initSystemDataSources();
 	this.checkInitTenantUserDataSources();
 }
 
Example #10
Source File: ModelAdapterFactory.java    From sling-org-apache-sling-models-impl with Apache License 2.0 5 votes vote down vote up
@Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC)
protected void bindStaticInjectAnnotationProcessorFactory(final StaticInjectAnnotationProcessorFactory factory, final Map<String, Object> props) {
    synchronized (staticInjectAnnotationProcessorFactories) {
        staticInjectAnnotationProcessorFactories.bind(factory, props);
        this.adapterImplementations.setStaticInjectAnnotationProcessorFactories(staticInjectAnnotationProcessorFactories.get());
    }
}
 
Example #11
Source File: AppDeployerServiceComponent.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
/**
 * Receive an event about the creation of a SynapseEnvironment. If this is
 * SuperTenant we have to wait until all the other constraints are met and actual
 * initialization is done in the activate method. Otherwise we have to do the activation here.
 *
 * @param synapseEnvironmentService SynapseEnvironmentService which contains information
 *                                  about the new Synapse Instance
 */
@Reference(
        name = "synapse.env.service",
        service = org.wso2.micro.integrator.initializer.services.SynapseEnvironmentService.class,
        cardinality = ReferenceCardinality.AT_LEAST_ONE,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetSynapseEnvironmentService")
protected void setSynapseEnvironmentService(SynapseEnvironmentService synapseEnvironmentService) {
    this.synapseEnvironmentService = synapseEnvironmentService;
    DataHolder.getInstance().setSynapseEnvironmentService(this.synapseEnvironmentService);
}
 
Example #12
Source File: ServiceBusInitializer.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
@Reference(
        name = "config.context.service",
        service = Axis2ConfigurationContextService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetConfigurationContextService")
protected void setConfigurationContextService(Axis2ConfigurationContextService configurationContextService) {

    if (log.isDebugEnabled()) {
        log.debug("ConfigurationContextService bound to the ESB initialization process");
        log.debug("configurationContextService : " + configurationContextService);
    }
    this.configCtxSvc = configurationContextService;
    ConfigurationHolder.getInstance().setAxis2ConfigurationContextService(configurationContextService);
}
 
Example #13
Source File: NamedAttributesItemResolver.java    From org.openhab.ui.habot with Eclipse Public License 1.0 5 votes vote down vote up
@Reference
protected void setMetadataRegistry(MetadataRegistry metadataRegistry) {
    if (this.metadataRegistry == null) {
        this.metadataRegistry = metadataRegistry;
        this.metadataRegistry.addRegistryChangeListener(metadataRegistryChangeListener);
    }
}
 
Example #14
Source File: CatalogIdentifierServiceImpl.java    From commerce-cif-connector with Apache License 2.0 5 votes vote down vote up
@Reference(
    service = CatalogIdentifier.class,
    bind = "bindCatalogIdentifier",
    unbind = "unbindCatalogIdentifier",
    cardinality = ReferenceCardinality.AT_LEAST_ONE,
    policy = ReferencePolicy.DYNAMIC)
protected void bindCatalogIdentifier(CatalogIdentifier identifier, Map<?, ?> properties) {
    map.put(identifier.getCommerceProviderName(), identifier.getAllCatalogIdentifiers());
}
 
Example #15
Source File: GraphqlResourceProviderFactory.java    From commerce-cif-connector with Apache License 2.0 5 votes vote down vote up
@Reference(
    service = GraphqlDataService.class,
    bind = "bindGraphqlDataService",
    unbind = "unbindGraphqlDataService",
    cardinality = ReferenceCardinality.AT_LEAST_ONE,
    policy = ReferencePolicy.DYNAMIC)
protected void bindGraphqlDataService(GraphqlDataService client, Map<?, ?> properties) {
    String identifier = client.getIdentifier();
    LOGGER.info("Registering GraphqlDataService '{}'", identifier);
    clients.put(identifier, client);
}
 
Example #16
Source File: GraphqlClientDataSourceServlet.java    From aem-core-cif-components with Apache License 2.0 5 votes vote down vote up
@Reference(
    service = GraphqlClient.class,
    bind = "bindGraphqlClient",
    unbind = "unbindGraphqlClient",
    cardinality = ReferenceCardinality.MULTIPLE,
    policy = ReferencePolicy.DYNAMIC)
void bindGraphqlClient(GraphqlClient graphqlClient, Map<?, ?> properties) {
    identifiers.add(graphqlClient.getIdentifier());
}
 
Example #17
Source File: SemanticsItemResolver.java    From org.openhab.ui.habot with Eclipse Public License 1.0 4 votes vote down vote up
@Reference
protected void setItemRegistry(ItemRegistry itemRegistry) {
    if (this.itemRegistry == null) {
        this.itemRegistry = itemRegistry;
    }
}
 
Example #18
Source File: UserRegisterTaskScheduler.java    From opencps-v2 with GNU Affero General Public License v3.0 4 votes vote down vote up
@Reference(unbind = "-")
protected void setSchedulerEngineHelper(SchedulerEngineHelper schedulerEngineHelper) {

	_schedulerEngineHelper = schedulerEngineHelper;
}
 
Example #19
Source File: GarbageGroupDossierScheduler.java    From opencps-v2 with GNU Affero General Public License v3.0 4 votes vote down vote up
@Reference(unbind = "-")
protected void setTriggerFactory(TriggerFactory triggerFactory) {
	_triggerFactory = triggerFactory;
}
 
Example #20
Source File: DataPullScheduler.java    From opencps-v2 with GNU Affero General Public License v3.0 4 votes vote down vote up
@Reference(unbind = "-")
protected void setTriggerFactory(TriggerFactory triggerFactory) {
}
 
Example #21
Source File: DictGroupSyncScheduler.java    From opencps-v2 with GNU Affero General Public License v3.0 4 votes vote down vote up
@Reference(target = ModuleServiceLifecycle.PORTAL_INITIALIZED, unbind = "-")
protected void setModuleServiceLifecycle(ModuleServiceLifecycle moduleServiceLifecycle) {
}
 
Example #22
Source File: HABotResource.java    From org.openhab.ui.habot with Eclipse Public License 1.0 4 votes vote down vote up
@Reference(cardinality = ReferenceCardinality.OPTIONAL, policy = ReferencePolicy.DYNAMIC)
public void setCardRegistry(CardRegistry cardRegistry) {
    this.cardRegistry = cardRegistry;
}
 
Example #23
Source File: OpenNLPInterpreter.java    From org.openhab.ui.habot with Eclipse Public License 1.0 4 votes vote down vote up
@Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC)
protected void addSkill(Skill skill) {
    this.skills.put(skill.getIntentId(), skill);
    // reset the trainer
    this.intentTrainer = null;
}
 
Example #24
Source File: OneMinute.java    From opencps-v2 with GNU Affero General Public License v3.0 4 votes vote down vote up
@Reference(unbind = "-")
protected void setTriggerFactory(TriggerFactory triggerFactory) {
}
 
Example #25
Source File: WebPushNotificationModuleHandlerFactory.java    From org.openhab.ui.habot with Eclipse Public License 1.0 4 votes vote down vote up
@Reference
protected void setNotificationService(NotificationService notificationService) {
    this.notificationService = notificationService;
}
 
Example #26
Source File: DossierSubmitScheduler.java    From opencps-v2 with GNU Affero General Public License v3.0 4 votes vote down vote up
@Reference(unbind = "-")
protected void setTriggerFactory(TriggerFactory triggerFactory) {
}
 
Example #27
Source File: SubscriptionProvider.java    From org.openhab.ui.habot with Eclipse Public License 1.0 4 votes vote down vote up
@Reference(policy = ReferencePolicy.DYNAMIC)
@Override
protected void setStorageService(StorageService storageService) {
    super.setStorageService(storageService);
}
 
Example #28
Source File: SyncQueueProcessScheduler.java    From opencps-v2 with GNU Affero General Public License v3.0 4 votes vote down vote up
@Reference(target = ModuleServiceLifecycle.PORTAL_INITIALIZED, unbind = "-")
protected void setModuleServiceLifecycle(ModuleServiceLifecycle moduleServiceLifecycle) {
}
 
Example #29
Source File: HistoryMonthlyGraphSkill.java    From org.openhab.ui.habot with Eclipse Public License 1.0 4 votes vote down vote up
@Reference
protected void setCardBuilder(CardBuilder cardBuilder) {
    this.cardBuilder = cardBuilder;
}
 
Example #30
Source File: OneMinute.java    From opencps-v2 with GNU Affero General Public License v3.0 4 votes vote down vote up
@Reference(target = ModuleServiceLifecycle.PORTAL_INITIALIZED, unbind = "-")
protected void setModuleServiceLifecycle(ModuleServiceLifecycle moduleServiceLifecycle) {
}