本文整理汇总了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);
}
}
}
示例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());
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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;
}
示例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);
}
示例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) {
}
示例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;
}
示例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);
}
示例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;
}
示例15: setDataService
@Reference(
policy=ReferencePolicy.DYNAMIC,
policyOption=ReferencePolicyOption.GREEDY
)
void setDataService(DataService service, Map<String, Object> properties) {
this.dataService = service;
}