当前位置: 首页>>代码示例>>Java>>正文


Java ReferencePolicy.DYNAMIC属性代码示例

本文整理汇总了Java中org.osgi.service.component.annotations.ReferencePolicy.DYNAMIC属性的典型用法代码示例。如果您正苦于以下问题:Java ReferencePolicy.DYNAMIC属性的具体用法?Java ReferencePolicy.DYNAMIC怎么用?Java ReferencePolicy.DYNAMIC使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.osgi.service.component.annotations.ReferencePolicy的用法示例。


在下文中一共展示了ReferencePolicy.DYNAMIC属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: bindExtensionService

@Reference(
        policy = ReferencePolicy.DYNAMIC,
        service = RuntimeExtension.class,
        cardinality = ReferenceCardinality.MULTIPLE
)
@SuppressWarnings("unused")
protected synchronized void bindExtensionService(RuntimeExtension extension, Map<String, Object> properties) {
    Integer newPriority = PropertiesUtil.toInteger(properties.get(Constants.SERVICE_RANKING), 0);
    String extensionName = PropertiesUtil.toString(properties.get(RuntimeExtension.NAME), "");
    Integer priority = PropertiesUtil.toInteger(mappingPriorities.get(extensionName), 0);
    if (newPriority > priority) {
        mapping = Collections.unmodifiableMap(add(mapping, extension, extensionName));
        mappingPriorities.put(extensionName, newPriority);
    } else {
        if (!mapping.containsKey(extensionName)) {
            mapping = Collections.unmodifiableMap(add(mapping, extension, extensionName));
            mappingPriorities.put(extensionName, newPriority);
        }
    }

}
 
开发者ID:deepthinkit,项目名称:patternlab-for-sling,代码行数:21,代码来源:ExtensionRegistryService.java

示例2: addHttpIdentityRequestFactory

@Reference(
        name = "identity.request.factory",
        service = HttpIdentityRequestFactory.class,
        cardinality = ReferenceCardinality.MULTIPLE,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "removeHttpIdentityRequestFactory"
)
protected void addHttpIdentityRequestFactory(HttpIdentityRequestFactory factory) {

    FrameworkServiceDataHolder.getInstance().getHttpIdentityRequestFactories().add(factory);
    Collections.sort(FrameworkServiceDataHolder.getInstance().getHttpIdentityRequestFactories(),
                     new HandlerComparator());
    Collections.reverse(FrameworkServiceDataHolder.getInstance().getHttpIdentityRequestFactories());
    if (log.isDebugEnabled()) {
        log.debug("Added HttpIdentityRequestFactory : " + factory.getName());
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:17,代码来源:FrameworkServiceComponent.java

示例3: addPluginListener

@Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC)
void addPluginListener(PluginListener listener) {
    synchronized (this.pluginListeners) {
        if (!this.listenersActive) {
            // Early joiner waits for startup
            this.pluginListeners.put(listener, emptyList());
            return;
        }
    }

    // Started already - time to join!

    // Always create trackers without holding any monitors or locks
    // to avoid potential deadlock
    List<PluginTracker<?>> trackers = createTrackers(listener);

    // Dynamic references may be set at any time, even while the
    // component is deactivating, therefore we only add the listener
    // if it should be active
    synchronized (this.pluginListeners) {
        if (this.listenersActive) {
            this.pluginListeners.put(listener, trackers);
            trackers = emptyList();
        }
    }

    // If the component was stopped then we may have dangling
    // trackers in this list which should be closed. Otherwise
    // the list will be empty (see above).
    trackers.forEach(PluginTracker::close);
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:31,代码来源:ApiFactoryServiceImpl.java

示例4: registerIdP

@Reference(
        name = "org.wso2.carbon.analytics.idp.client.core.api.IdPClient",
        service = IdPClient.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unregisterIdP"
)
protected void registerIdP(IdPClient client) {
    HttpIODataHolder.getInstance().setClient(client);
}
 
开发者ID:wso2-extensions,项目名称:siddhi-io-http,代码行数:10,代码来源:ServiceComponent.java

示例5: addMessageBodyEvaluator

/**
 * Adds a MessageBodyEvaluator to BaseMessageBodyEvaluatorRegistry.
 *
 * @param messageBodyEvaluator MessageBodyEvaluator to be added
 */
@Reference(
        name = "MessageBodyEvaluator-Service",
        service = MessageBodyEvaluator.class,
        cardinality = ReferenceCardinality.MULTIPLE,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "removeMessageBodyEvaluator")
protected void addMessageBodyEvaluator(MessageBodyEvaluator messageBodyEvaluator) {
    if (log.isDebugEnabled()) {
        log.debug("Adding" + messageBodyEvaluator.toString() + "to MessageBodyEvaluatorRegistry");
    }
    MessageBodyEvaluatorRegistry.getInstance()
            .addMessageBodyEvaluator(messageBodyEvaluator.getPathLanguage(), messageBodyEvaluator);
}
 
开发者ID:wso2-attic,项目名称:carbon-gateway-framework,代码行数:18,代码来源:MessageBodyEvaluatorServiceComponent.java

示例6: setEntitlementService

/**
 * @param entitlementService
 */
@Reference(
         name = "identity.entitlement.service", 
         service = org.wso2.carbon.identity.entitlement.EntitlementService.class, 
         cardinality = ReferenceCardinality.AT_LEAST_ONE, 
         policy = ReferencePolicy.DYNAMIC, 
         unbind = "unsetEntitlementService")
protected void setEntitlementService(EntitlementService entitlementService) {
    if (log.isDebugEnabled()) {
        log.debug("EntitlementService is set in the Application Authentication Framework bundle");
    }
    ProvisioningServiceDataHolder.getInstance().setEntitlementService(entitlementService);
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:15,代码来源:IdentityProvisionServiceComponent.java

示例7: setRegistryService

@Reference(
        name = "registry.service",
        service = RegistryService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetRegistryService"
)
protected void setRegistryService(RegistryService registryService) {
    SecurityServiceHolder.setRegistryService(registryService);
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:10,代码来源:SecurityDeploymentInterceptor.java

示例8: bindMetricRegistry

@Reference(
        cardinality = ReferenceCardinality.MULTIPLE,
        policy = ReferencePolicy.DYNAMIC
)
protected void bindMetricRegistry(MetricRegistry registry, Map<String, Object> props) {
    MetricCopyingListener listener = new MetricCopyingListener(compositeRegistry, registry, getName(props));
    synchronized (listeners){
        listeners.put(registry, listener);
    }
    listener.register();
}
 
开发者ID:bdelacretaz,项目名称:sling-adaptto-2016,代码行数:11,代码来源:ESReporter.java

示例9: setNotificationSender

@Reference(
        name = "carbon.identity.notification.mgt",
        service = NotificationSender.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetNotificationSender"
)
protected void setNotificationSender(NotificationSender notificationSender) {
    if (log.isDebugEnabled()) {
        log.debug("Un-setting notification sender in Entitlement bundle");
    }
    this.notificationSender = notificationSender;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:13,代码来源:IdentityMgtServiceComponent.java

示例10: addTransportSender

@Reference(
           name = "transport-sender",
           service = TransportSender.class,
           cardinality = ReferenceCardinality.OPTIONAL,
           policy = ReferencePolicy.DYNAMIC,
           unbind = "removeTransportSender"
)
protected void addTransportSender(TransportSender transportSender) {
    ServiceContextHolder.getInstance().addTransportSender(transportSender);
}
 
开发者ID:wso2-attic,项目名称:carbon-gateway-framework,代码行数:10,代码来源:GatewayServiceComponent.java

示例11: addOutboundProviderRegistry

@Reference(
        name = "outbound-provider-registry-service",
        service = org.wso2.carbon.gateway.core.outbound.ProviderRegistry.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "removeOutboundProviderRegistry")
protected void addOutboundProviderRegistry(org.wso2.carbon.gateway.core.outbound.ProviderRegistry registry) {
}
 
开发者ID:wso2-attic,项目名称:carbon-gateway-framework,代码行数:8,代码来源:IFlowDeployer.java

示例12: setConfigurationContext

@Reference(
         name = "configuration.context", 
         service = org.wso2.carbon.utils.ConfigurationContextService.class, 
         cardinality = ReferenceCardinality.MANDATORY, 
         policy = ReferencePolicy.DYNAMIC, 
         unbind = "unsetConfigurationContext")
protected void setConfigurationContext(ConfigurationContextService configurationContext) {
    this.configurationContext = configurationContext;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:9,代码来源:ThriftAuthenticationServiceComponent.java

示例13: setIdentityEventService

@Reference(
        name = "EventService",
        service = EventService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetIdentityEventService"
)
protected void setIdentityEventService(EventService eventService) {
    AccountServiceDataHolder.getInstance().setIdentityEventService(eventService);
}
 
开发者ID:wso2,项目名称:carbon-identity-mgt,代码行数:10,代码来源:AccountServiceComponent.java

示例14: setRealmService

@Reference(
        name = "realm.service",
        service = RealmService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetRealmService"
)
protected void setRealmService(RealmService realmService) {
    log.debug("Setting the Realm Service");
    IdentityMgtServiceComponent.realmService = realmService;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:11,代码来源:IdentityMgtServiceComponent.java

示例15: setDataService

@Reference(
    policy=ReferencePolicy.DYNAMIC,
    policyOption=ReferencePolicyOption.GREEDY
)
void setDataService(DataService service, Map<String, Object> properties) {
    this.dataService = service;
}
 
开发者ID:fipro78,项目名称:osgi-ds-getting-started-pde,代码行数:7,代码来源:DataGetter.java


注:本文中的org.osgi.service.component.annotations.ReferencePolicy.DYNAMIC属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。