Apache Celix  2.4.0
Apache Celix is a framework for C, C++14 and C++17 to develop dynamic modular software applications using component and in-process service-oriented programming.
celix_bundle_context.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
20 #ifndef CELIX_BUNDLE_CONTEXT_H_
21 #define CELIX_BUNDLE_CONTEXT_H_
22 
23 #include <stdarg.h>
24 
25 #include "celix_cleanup.h"
26 #include "celix_types.h"
27 #include "celix_service_factory.h"
28 #include "celix_properties.h"
29 #include "celix_array_list.h"
30 #include "celix_filter.h"
31 #include "celix_bundle_event.h"
32 #include "celix_log_level.h"
33 #include "celix_framework_export.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
42 #ifdef __cplusplus
43 #define CELIX_OPTS_INIT {}
44 #else
45 #define CELIX_OPTS_INIT
46 #endif
47 
62 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_registerServiceAsync(celix_bundle_context_t *ctx, void *svc, const char* serviceName, celix_properties_t *properties);
63 
75 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_registerService(celix_bundle_context_t *ctx, void *svc, const char* serviceName, celix_properties_t *properties);
76 
99 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_registerServiceFactoryAsync(celix_bundle_context_t *ctx, celix_service_factory_t *factory, const char* serviceName, celix_properties_t *props);
100 
119 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_registerServiceFactory(celix_bundle_context_t *ctx, celix_service_factory_t *factory, const char* serviceName, celix_properties_t *props);
120 
134  void *svc CELIX_OPTS_INIT;
135 
151  celix_service_factory_t *factory CELIX_OPTS_INIT;
152 
159  const char* serviceName CELIX_OPTS_INIT;
160 
170  celix_properties_t *properties CELIX_OPTS_INIT;
171 
177  const char* serviceLanguage CELIX_OPTS_INIT;
178 
187  const char* serviceVersion CELIX_OPTS_INIT;
188 
192  void *asyncData CELIX_OPTS_INIT;
193 
204  void (*asyncCallback)(void *data, long serviceId) CELIX_OPTS_INIT;
206 
207 #ifndef __cplusplus
208 
211 #define CELIX_EMPTY_SERVICE_REGISTRATION_OPTIONS { .svc = NULL, \
212  .factory = NULL, \
213  .serviceName = NULL, \
214  .properties = NULL, \
215  .serviceLanguage = NULL, \
216  .serviceVersion = NULL, \
217  .asyncData = NULL, \
218  .asyncCallback = NULL }
219 #endif
220 
233 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_registerServiceWithOptionsAsync(celix_bundle_context_t *ctx, const celix_service_registration_options_t *opts);
234 
244 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_registerServiceWithOptions(celix_bundle_context_t *ctx, const celix_service_registration_options_t *opts);
245 
252 CELIX_FRAMEWORK_EXPORT void celix_bundleContext_waitForAsyncRegistration(celix_bundle_context_t *ctx, long serviceId);
253 
262 CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_isServiceRegistered(celix_bundle_context_t *ctx, long serviceId);
263 
264 
275 CELIX_FRAMEWORK_EXPORT void celix_bundleContext_unregisterService(celix_bundle_context_t *ctx, long serviceId);
276 
281  celix_bundle_context_t* ctx;
282  long svcId;
284 
291 static CELIX_UNUSED inline celix_service_registration_guard_t
292 celix_serviceRegistrationGuard_init(celix_bundle_context_t* ctx, long serviceId) {
293  return (celix_service_registration_guard_t) { .ctx = ctx, .svcId = serviceId };
294 }
295 
301 static CELIX_UNUSED inline void celix_serviceRegistrationGuard_deinit(celix_service_registration_guard_t* reg) {
302  if (reg->svcId >= 0) {
304  }
305 }
306 
307 CELIX_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(celix_service_registration_guard_t, celix_serviceRegistrationGuard_deinit)
308 
309 
323 CELIX_FRAMEWORK_EXPORT void celix_bundleContext_unregisterServiceAsync(celix_bundle_context_t *ctx, long serviceId, void* doneData, void (*doneCallback)(void* doneData));
324 
330 CELIX_FRAMEWORK_EXPORT void celix_bundleContext_waitForAsyncUnregistration(celix_bundle_context_t *ctx, long serviceId);
331 
339 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_findService(celix_bundle_context_t *ctx, const char* serviceName);
340 
348 CELIX_FRAMEWORK_EXPORT celix_array_list_t* celix_bundleContext_findServices(celix_bundle_context_t *ctx, const char* serviceName);
349 
359  const char* serviceName CELIX_OPTS_INIT;
360 
368  const char* versionRange CELIX_OPTS_INIT;
369 
375  const char* filter CELIX_OPTS_INIT;
376 
381  const char* serviceLanguage CELIX_OPTS_INIT;
382 
383 
388  bool ignoreServiceLanguage CELIX_OPTS_INIT;
390 
391 #ifndef __cplusplus
392 
395 #define CELIX_EMPTY_SERVICE_FILTER_OPTIONS {.serviceName = NULL, .versionRange = NULL, .filter = NULL, .serviceLanguage = NULL, .ignoreServiceLanguage = false}
396 #endif
397 
405 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_findServiceWithOptions(celix_bundle_context_t *ctx, const celix_service_filter_options_t *opts);
406 
414 CELIX_FRAMEWORK_EXPORT celix_array_list_t* celix_bundleContext_findServicesWithOptions(celix_bundle_context_t *ctx, const celix_service_filter_options_t *opts);
415 
433 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackServiceAsync(
434  celix_bundle_context_t *ctx,
435  const char* serviceName,
436  void* callbackHandle,
437  void (*set)(void* handle, void* svc)
438 );
439 
455 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackService(
456  celix_bundle_context_t *ctx,
457  const char* serviceName,
458  void* callbackHandle,
459  void (*set)(void* handle, void* svc)
460 );
461 
476 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackServicesAsync(
477  celix_bundle_context_t *ctx,
478  const char* serviceName,
479  void* callbackHandle,
480  void (*add)(void* handle, void* svc),
481  void (*remove)(void* handle, void* svc)
482 );
483 
497 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackServices(
498  celix_bundle_context_t *ctx,
499  const char* serviceName,
500  void* callbackHandle,
501  void (*add)(void* handle, void* svc),
502  void (*remove)(void* handle, void* svc)
503 );
504 
513 
517  void* callbackHandle CELIX_OPTS_INIT;
518 
525  void (*set)(void *handle, void *svc) CELIX_OPTS_INIT;
526 
531  void (*setWithProperties)(void *handle, void *svc, const celix_properties_t *props) CELIX_OPTS_INIT; //highest ranking
532 
537  void (*setWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner) CELIX_OPTS_INIT; //highest ranking
538 
545  void (*add)(void *handle, void *svc) CELIX_OPTS_INIT;
546 
551  void (*addWithProperties)(void *handle, void *svc, const celix_properties_t *props) CELIX_OPTS_INIT;
552 
557  void (*addWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner) CELIX_OPTS_INIT;
558 
568  void (*remove)(void *handle, void *svc) CELIX_OPTS_INIT;
569 
574  void (*removeWithProperties)(void *handle, void *svc, const celix_properties_t *props) CELIX_OPTS_INIT;
575 
580  void (*removeWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner) CELIX_OPTS_INIT;
581 
582 
586  void *trackerCreatedCallbackData CELIX_OPTS_INIT;
587 
595  void (*trackerCreatedCallback)(void *trackerCreatedCallbackData) CELIX_OPTS_INIT;
597 
598 #ifndef __cplusplus
599 
602 #define CELIX_EMPTY_SERVICE_TRACKING_OPTIONS { .filter.serviceName = NULL, \
603  .filter.versionRange = NULL, \
604  .filter.filter = NULL, \
605  .filter.serviceLanguage = NULL, \
606  .filter.ignoreServiceLanguage = false, \
607  .callbackHandle = NULL, \
608  .set = NULL, \
609  .add = NULL, \
610  .remove = NULL, \
611  .setWithProperties = NULL, \
612  .addWithProperties = NULL, \
613  .removeWithProperties = NULL, \
614  .setWithOwner = NULL, \
615  .addWithOwner = NULL, \
616  .removeWithOwner = NULL, \
617  .trackerCreatedCallbackData = NULL, \
618  .trackerCreatedCallback = NULL }
619 #endif
620 
633 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackServicesWithOptionsAsync(celix_bundle_context_t *ctx, const celix_service_tracking_options_t *opts);
634 
646 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackServicesWithOptions(celix_bundle_context_t *ctx, const celix_service_tracking_options_t *opts);
647 
662 CELIX_FRAMEWORK_EXPORT void celix_bundleContext_stopTrackerAsync(
663  celix_bundle_context_t *ctx,
664  long trackerId,
665  void *doneCallbackData,
666  void (*doneCallback)(void* doneCallbackData));
667 
671 CELIX_FRAMEWORK_EXPORT void celix_bundleContext_waitForAsyncTracker(celix_bundle_context_t *ctx, long trackerId);
672 
676 CELIX_FRAMEWORK_EXPORT void celix_bundleContext_waitForAsyncStopTracker(celix_bundle_context_t *ctx, long trackerId);
677 
687 CELIX_FRAMEWORK_EXPORT void celix_bundleContext_stopTracker(celix_bundle_context_t *ctx, long trackerId);
688 
706 CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_useServiceWithId(
707  celix_bundle_context_t *ctx,
708  long serviceId,
709  const char* serviceName /*sanity check*/,
710  void *callbackHandle,
711  void (*use)(void *handle, void* svc)
712 );
713 
731 CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_useService(
732  celix_bundle_context_t *ctx,
733  const char* serviceName,
734  void *callbackHandle,
735  void (*use)(void *handle, void *svc)
736 );
737 
755 CELIX_FRAMEWORK_EXPORT size_t celix_bundleContext_useServices(
756  celix_bundle_context_t *ctx,
757  const char* serviceName,
758  void *callbackHandle,
759  void (*use)(void *handle, void *svc)
760 );
761 
770 
776  double waitTimeoutInSeconds CELIX_OPTS_INIT;
777 
781  void *callbackHandle CELIX_OPTS_INIT;
782 
790  void (*use)(void *handle, void *svc) CELIX_OPTS_INIT;
791 
796  void (*useWithProperties)(void *handle, void *svc, const celix_properties_t *props) CELIX_OPTS_INIT;
797 
802  void (*useWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner) CELIX_OPTS_INIT;
807 #define CELIX_SERVICE_USE_DIRECT (1)
808 
812 #define CELIX_SERVICE_USE_SOD (2)
813  int flags CELIX_OPTS_INIT;
815 
816 #ifndef __cplusplus
817 
820 #define CELIX_EMPTY_SERVICE_USE_OPTIONS {.filter.serviceName = NULL, \
821  .filter.versionRange = NULL, \
822  .filter.filter = NULL, \
823  .filter.serviceLanguage = NULL, \
824  .waitTimeoutInSeconds = 0.0F, \
825  .callbackHandle = NULL, \
826  .use = NULL, \
827  .useWithProperties = NULL, \
828  .useWithOwner = NULL, \
829  .flags=0}
830 #endif
831 
848 CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_useServiceWithOptions(
849  celix_bundle_context_t *ctx,
850  const celix_service_use_options_t *opts);
851 
852 
869 CELIX_FRAMEWORK_EXPORT size_t celix_bundleContext_useServicesWithOptions(
870  celix_bundle_context_t *ctx,
871  const celix_service_use_options_t *opts);
872 
880 CELIX_FRAMEWORK_EXPORT celix_array_list_t* celix_bundleContext_listBundles(celix_bundle_context_t *ctx);
881 
889 CELIX_FRAMEWORK_EXPORT celix_array_list_t* celix_bundleContext_listInstalledBundles(celix_bundle_context_t *ctx);
890 
891 
898 CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_isBundleInstalled(celix_bundle_context_t *ctx, long bndId);
899 
906 CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_isBundleActive(celix_bundle_context_t *ctx, long bndId);
907 
922 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_installBundle(celix_bundle_context_t *ctx, const char* bundleUrl, bool autoStart);
923 
937 CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_uninstallBundle(celix_bundle_context_t *ctx, long bndId);
938 
952 CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_stopBundle(celix_bundle_context_t *ctx, long bndId);
953 
967 CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_startBundle(celix_bundle_context_t *ctx, long bndId);
968 
993 CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_updateBundle(celix_bundle_context_t *ctx, long bndId, const char* updatedBundleUrl);
994 
1003 CELIX_FRAMEWORK_EXPORT char* celix_bundleContext_getBundleSymbolicName(celix_bundle_context_t *ctx, long bndId);
1004 
1019 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackBundlesAsync(
1020  celix_bundle_context_t *ctx,
1021  void* callbackHandle,
1022  void (*onStarted)(void* handle, const celix_bundle_t *bundle),
1023  void (*onStopped)(void *handle, const celix_bundle_t *bundle)
1024 );
1025 
1039 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackBundles(
1040  celix_bundle_context_t *ctx,
1041  void* callbackHandle,
1042  void (*onStarted)(void* handle, const celix_bundle_t *bundle),
1043  void (*onStopped)(void *handle, const celix_bundle_t *bundle)
1044 );
1045 
1053  void* callbackHandle CELIX_OPTS_INIT;
1054 
1061  void (*onInstalled)(void *handle, const celix_bundle_t *bundle) CELIX_OPTS_INIT;
1062 
1069  void (*onStarted)(void *handle, const celix_bundle_t *bundle) CELIX_OPTS_INIT;
1070 
1077  void (*onStopped)(void *handle, const celix_bundle_t *bundle) CELIX_OPTS_INIT;
1078 
1084  void (*onBundleEvent)(void *handle, const celix_bundle_event_t *event) CELIX_OPTS_INIT;
1085 
1090  bool includeFrameworkBundle CELIX_OPTS_INIT;
1091 
1095  void *trackerCreatedCallbackData CELIX_OPTS_INIT;
1096 
1105  void (*trackerCreatedCallback)(void *trackerCreatedCallbackData) CELIX_OPTS_INIT;
1107 
1108 #ifndef __cplusplus
1109 
1112 #define CELIX_EMPTY_BUNDLE_TRACKING_OPTIONS {.callbackHandle = NULL, .onInstalled = NULL, .onStarted = NULL, .onStopped = NULL, .onBundleEvent = NULL, .includeFrameworkBundle = false, .trackerCreatedCallbackData = NULL, .trackerCreatedCallback = NULL}
1113 #endif
1114 
1128 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackBundlesWithOptionsAsync(
1129  celix_bundle_context_t *ctx,
1131 );
1132 
1145 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackBundlesWithOptions(
1146  celix_bundle_context_t *ctx,
1148 );
1149 
1163 CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_useBundle(
1164  celix_bundle_context_t *ctx,
1165  long bundleId,
1166  void *callbackHandle,
1167  void (*use)(void *handle, const celix_bundle_t *bundle));
1168 
1180 CELIX_FRAMEWORK_EXPORT size_t celix_bundleContext_useBundles(
1181  celix_bundle_context_t *ctx,
1182  void *callbackHandle,
1183  void (*use)(void *handle, const celix_bundle_t *bundle));
1184 
1192  celix_filter_t *filter;
1193 
1197  const char* serviceName;
1198 
1203  const char* serviceLanguage;
1204 
1208  long bundleId;
1210 
1238 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackServiceTrackersAsync(
1239  celix_bundle_context_t *ctx,
1240  const char* serviceName,
1241  void *callbackHandle,
1242  void (*trackerAdd)(void *handle, const celix_service_tracker_info_t *info),
1243  void (*trackerRemove)(void *handle, const celix_service_tracker_info_t *info),
1244  void *doneCallbackData,
1245  void (*doneCallback)(void* doneCallbackData));
1246 
1268 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackServiceTrackers(
1269  celix_bundle_context_t *ctx,
1270  const char* serviceName,
1271  void *callbackHandle,
1272  void (*trackerAdd)(void *handle, const celix_service_tracker_info_t *info),
1273  void (*trackerRemove)(void *handle, const celix_service_tracker_info_t *info));
1274 
1280 CELIX_FRAMEWORK_EXPORT celix_dependency_manager_t* celix_bundleContext_getDependencyManager(celix_bundle_context_t *ctx);
1281 
1282 
1286 CELIX_FRAMEWORK_EXPORT void celix_bundleContext_waitForEvents(celix_bundle_context_t *ctx);
1287 
1293  const char* name CELIX_OPTS_INIT;
1299  double initialDelayInSeconds CELIX_OPTS_INIT;
1301  double intervalInSeconds CELIX_OPTS_INIT;
1305  void* callbackData CELIX_OPTS_INIT;
1307  void (*callback)(void* callbackData) CELIX_OPTS_INIT;
1310  void* removeCallbackData
1313  void (*removeCallback)(void* removeCallbackData)
1314  CELIX_OPTS_INIT;
1317 
1318 #define CELIX_EMPTY_SCHEDULED_EVENT_OPTIONS {NULL, 0.0, 0.0, NULL, NULL, NULL, NULL}
1319 
1348 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_scheduleEvent(celix_bundle_context_t* ctx,
1349  const celix_scheduled_event_options_t* options);
1350 
1361 CELIX_FRAMEWORK_EXPORT celix_status_t celix_bundleContext_wakeupScheduledEvent(celix_bundle_context_t* ctx,
1362  long scheduledEventId);
1363 
1376 CELIX_FRAMEWORK_EXPORT celix_status_t celix_bundleContext_waitForScheduledEvent(celix_bundle_context_t* ctx,
1377  long scheduledEventId,
1378  double waitTimeInSeconds);
1379 
1392 CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_removeScheduledEvent(celix_bundle_context_t* ctx,
1393  long scheduledEventId);
1394 
1407 CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_removeScheduledEventAsync(celix_bundle_context_t* ctx,
1408  long scheduledEventId);
1409 
1423 CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_tryRemoveScheduledEventAsync(celix_bundle_context_t* ctx,
1424  long scheduledEventId);
1425 
1429 CELIX_FRAMEWORK_EXPORT celix_bundle_t* celix_bundleContext_getBundle(const celix_bundle_context_t *ctx);
1430 
1431 
1435 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_getBundleId(const celix_bundle_context_t *ctx);
1436 
1437 CELIX_FRAMEWORK_EXPORT celix_framework_t* celix_bundleContext_getFramework(const celix_bundle_context_t *ctx);
1438 
1446 CELIX_FRAMEWORK_EXPORT void celix_bundleContext_log(
1447  const celix_bundle_context_t *ctx,
1448  celix_log_level_e level,
1449  const char* format,
1450  ...) __attribute__((format(printf,3,4)));
1451 
1455 CELIX_FRAMEWORK_EXPORT void celix_bundleContext_vlog(
1456  const celix_bundle_context_t *ctx,
1457  celix_log_level_e level,
1458  const char* format,
1459  va_list formatArgs) __attribute__((format(printf,3,0)));
1460 
1466 CELIX_FRAMEWORK_EXPORT void celix_bundleContext_logTssErrors(const celix_bundle_context_t* ctx,
1467  celix_log_level_e level);
1468 
1481 CELIX_FRAMEWORK_EXPORT const char* celix_bundleContext_getProperty(celix_bundle_context_t *ctx, const char* key, const char* defaultVal);
1482 
1496 CELIX_FRAMEWORK_EXPORT long celix_bundleContext_getPropertyAsLong(celix_bundle_context_t *ctx, const char* name, long defaultValue);
1497 
1511 CELIX_FRAMEWORK_EXPORT double celix_bundleContext_getPropertyAsDouble(celix_bundle_context_t *ctx, const char* name, double defaultValue);
1512 
1526 CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_getPropertyAsBool(celix_bundle_context_t *ctx, const char* name, bool defaultValue);
1527 
1528 #undef CELIX_OPTS_INIT
1529 
1530 #ifdef __cplusplus
1531 }
1532 #endif
1533 
1534 #endif //CELIX_BUNDLE_CONTEXT_H_
celix_bundleContext_useServicesWithOptions
CELIX_FRAMEWORK_EXPORT size_t celix_bundleContext_useServicesWithOptions(celix_bundle_context_t *ctx, const celix_service_use_options_t *opts)
Use the services with the provided service filter options using the provided callback.
celix_bundleContext_useService
CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_useService(celix_bundle_context_t *ctx, const char *serviceName, void *callbackHandle, void(*use)(void *handle, void *svc))
Use the highest ranking service with the provided service name using the provided callback.
celix_bundleContext_useServiceWithId
CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_useServiceWithId(celix_bundle_context_t *ctx, long serviceId, const char *serviceName, void *callbackHandle, void(*use)(void *handle, void *svc))
Use the service with the provided service id using the provided callback. The Celix framework will en...
celix_bundleContext_wakeupScheduledEvent
CELIX_FRAMEWORK_EXPORT celix_status_t celix_bundleContext_wakeupScheduledEvent(celix_bundle_context_t *ctx, long scheduledEventId)
Wakeup a scheduled event and returns immediately, not waiting for the scheduled event callback to be ...
celix_service_registration_guard::ctx
celix_bundle_context_t * ctx
Definition: celix_bundle_context.h:281
celix_bundleContext_getBundleId
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_getBundleId(const celix_bundle_context_t *ctx)
Returns the bundle if for the bundle of this bundle context.
celix_bundleContext_waitForAsyncTracker
CELIX_FRAMEWORK_EXPORT void celix_bundleContext_waitForAsyncTracker(celix_bundle_context_t *ctx, long trackerId)
Wait for (async) creation of tracker.
celix_bundleContext_registerService
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_registerService(celix_bundle_context_t *ctx, void *svc, const char *serviceName, celix_properties_t *properties)
Register a service to the Celix framework.
celix_bundleContext_useServiceWithOptions
CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_useServiceWithOptions(celix_bundle_context_t *ctx, const celix_service_use_options_t *opts)
Use the highest ranking service satisfying the provided service filter options using the provided cal...
celix_service_tracking_options::addWithOwner
void(* addWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner) CELIX_OPTS_INIT
The optional addWithOwner callback is handled as the add callback, but with the addition that the ser...
Definition: celix_bundle_context.h:557
celix_bundle_tracker_options::CELIX_OPTS_INIT
bool includeFrameworkBundle CELIX_OPTS_INIT
Default the framework bundle (bundle id 0) will not trigger the callbacks. This is done,...
Definition: celix_bundle_context.h:1090
celix_service_registration_guard
Service registration guard.
Definition: celix_bundle_context.h:280
celix_scheduled_event_options::callback
void(* callback)(void *callbackData) CELIX_OPTS_INIT
Callback function called to process a scheduled event. Will be called on the event thread.
Definition: celix_bundle_context.h:1307
celix_bundle_tracker_options::CELIX_OPTS_INIT
void *trackerCreatedCallbackData CELIX_OPTS_INIT
Data for the trackerCreatedCallback.
Definition: celix_bundle_context.h:1095
celix_service_use_options::CELIX_OPTS_INIT
double waitTimeoutInSeconds CELIX_OPTS_INIT
An optional timeout (in seconds), if > 0 the use service call will block until the timeout is expired...
Definition: celix_bundle_context.h:776
celix_service_tracking_options::CELIX_OPTS_INIT
void *callbackHandle CELIX_OPTS_INIT
The optional callback pointer used in all the provided callback function (set, add,...
Definition: celix_bundle_context.h:517
celix_bundleContext_logTssErrors
CELIX_FRAMEWORK_EXPORT void CELIX_FRAMEWORK_EXPORT void CELIX_FRAMEWORK_EXPORT void celix_bundleContext_logTssErrors(const celix_bundle_context_t *ctx, celix_log_level_e level)
Logs celix thread-specific storage error messages(celix_err) ith the provided celix log level....
celix_bundleContext_trackServiceTrackersAsync
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackServiceTrackersAsync(celix_bundle_context_t *ctx, const char *serviceName, void *callbackHandle, void(*trackerAdd)(void *handle, const celix_service_tracker_info_t *info), void(*trackerRemove)(void *handle, const celix_service_tracker_info_t *info), void *doneCallbackData, void(*doneCallback)(void *doneCallbackData))
Track the service tracker targeting the provided service name.
celix_bundle_tracker_options::onBundleEvent
void(* onBundleEvent)(void *handle, const celix_bundle_event_t *event) CELIX_OPTS_INIT
Definition: celix_bundle_context.h:1084
celix_service_registration_options::CELIX_OPTS_INIT
void *asyncData CELIX_OPTS_INIT
Async data pointer for the async register callback.
Definition: celix_bundle_context.h:192
celix_service_registration_options
Service Registration Options when registering services to the Celix framework.
Definition: celix_bundle_context.h:124
celix_bundleContext_trackBundles
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackBundles(celix_bundle_context_t *ctx, void *callbackHandle, void(*onStarted)(void *handle, const celix_bundle_t *bundle), void(*onStopped)(void *handle, const celix_bundle_t *bundle))
Track bundles.
celix_service_filter_options::CELIX_OPTS_INIT
const char *serviceName CELIX_OPTS_INIT
The service name.
Definition: celix_bundle_context.h:359
celix_service_registration_options::CELIX_OPTS_INIT
const char *serviceVersion CELIX_OPTS_INIT
The optional service version (in the form of <MAJOR>.<MINOR>.<MICRO>.<QUALIFIER>).
Definition: celix_bundle_context.h:187
celix_bundle_tracker_options::trackerCreatedCallback
void(* trackerCreatedCallback)(void *trackerCreatedCallbackData) CELIX_OPTS_INIT
The callback called when the tracker has ben created (and is active) when using the track bundles asc...
Definition: celix_bundle_context.h:1105
celix_bundleContext_waitForScheduledEvent
CELIX_FRAMEWORK_EXPORT celix_status_t celix_bundleContext_waitForScheduledEvent(celix_bundle_context_t *ctx, long scheduledEventId, double waitTimeInSeconds)
Wait until the next scheduled event is processed.
celix_bundle_tracker_options
The Service Bundle Tracking options can be used to fine tune the requested bundle tracker options.
Definition: celix_bundle_context.h:1049
celix_service_tracking_options::setWithProperties
void(* setWithProperties)(void *handle, void *svc, const celix_properties_t *props) CELIX_OPTS_INIT
The optional setWithProperties callback is handled as the set callback, but with the addition that th...
Definition: celix_bundle_context.h:531
celix_bundleContext_findServiceWithOptions
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_findServiceWithOptions(celix_bundle_context_t *ctx, const celix_service_filter_options_t *opts)
Finds the highest ranking service and returns the service id.
celix_bundleContext_removeScheduledEvent
CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_removeScheduledEvent(celix_bundle_context_t *ctx, long scheduledEventId)
Cancel and remove a scheduled event.
celix_service_registration_options_t
struct celix_service_registration_options celix_service_registration_options_t
Service Registration Options when registering services to the Celix framework.
celix_bundleContext_getDependencyManager
CELIX_FRAMEWORK_EXPORT celix_dependency_manager_t * celix_bundleContext_getDependencyManager(celix_bundle_context_t *ctx)
Gets the dependency manager for this bundle context.
celix_bundleContext_registerServiceWithOptions
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_registerServiceWithOptions(celix_bundle_context_t *ctx, const celix_service_registration_options_t *opts)
Register a service to the Celix framework using the provided service registration options.
celix_bundleContext_getBundle
CELIX_FRAMEWORK_EXPORT celix_bundle_t * celix_bundleContext_getBundle(const celix_bundle_context_t *ctx)
Returns the bundle for this bundle context.
celix_bundleContext_installBundle
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_installBundle(celix_bundle_context_t *ctx, const char *bundleUrl, bool autoStart)
Install and optional start a bundle. Will silently ignore bundle ids < 0.
celix_bundleContext_findServicesWithOptions
CELIX_FRAMEWORK_EXPORT celix_array_list_t * celix_bundleContext_findServicesWithOptions(celix_bundle_context_t *ctx, const celix_service_filter_options_t *opts)
Finds the services conform the provider filter options and returns a list of the found service ids.
celix_service_registration_options::CELIX_OPTS_INIT
celix_properties_t *properties CELIX_OPTS_INIT
The optional service properties.
Definition: celix_bundle_context.h:170
celix_service_registration_guard_t
struct celix_service_registration_guard celix_service_registration_guard_t
Service registration guard.
celix_service_use_options_t
struct celix_service_use_options celix_service_use_options_t
Service Use Options used to fine tune which services to use and which callbacks to use.
celix_bundleContext_listBundles
CELIX_FRAMEWORK_EXPORT celix_array_list_t * celix_bundleContext_listBundles(celix_bundle_context_t *ctx)
List the installed and started bundle ids. The bundle ids does not include the framework bundle (bund...
celix_bundleContext_getBundleSymbolicName
CELIX_FRAMEWORK_EXPORT char * celix_bundleContext_getBundleSymbolicName(celix_bundle_context_t *ctx, long bndId)
Returns the bundle symbolic name for the provided bundle id. The caller is owner of the return string...
celix_bundleContext_getPropertyAsDouble
CELIX_FRAMEWORK_EXPORT double celix_bundleContext_getPropertyAsDouble(celix_bundle_context_t *ctx, const char *name, double defaultValue)
Get the config property for the given key converted as double value.
celix_service_use_options::useWithOwner
void(* useWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner) CELIX_OPTS_INIT
The optional useWithOwner callback is handled as the yse callback, but with the addition that the ser...
Definition: celix_bundle_context.h:802
celix_service_filter_options::CELIX_OPTS_INIT
const char *versionRange CELIX_OPTS_INIT
The optional version range.
Definition: celix_bundle_context.h:368
celix_service_tracking_options_t
struct celix_service_tracking_options celix_service_tracking_options_t
Service Tracker Options used to fine tune which services to track and the callback to be used for the...
celix_service_tracking_options::remove
void(* remove)(void *handle, void *svc) CELIX_OPTS_INIT
The optional remove callback will be called for every service conform the provided service filter opt...
Definition: celix_bundle_context.h:568
celix_service_tracking_options::addWithProperties
void(* addWithProperties)(void *handle, void *svc, const celix_properties_t *props) CELIX_OPTS_INIT
The optional addWithProperties callback is handled as the add callback, but with the addition that th...
Definition: celix_bundle_context.h:551
celix_scheduled_event_options::CELIX_OPTS_INIT
void *removeCallbackData CELIX_OPTS_INIT
Data passed to the done callback function when a scheduled event is removed.
Definition: celix_bundle_context.h:1311
celix_bundleContext_waitForEvents
CELIX_FRAMEWORK_EXPORT void celix_bundleContext_waitForEvents(celix_bundle_context_t *ctx)
Wait until all Celix event for this bundle are completed.
celix_service_filter_options::CELIX_OPTS_INIT
const char *serviceLanguage CELIX_OPTS_INIT
Definition: celix_bundle_context.h:381
celix_bundleContext_getPropertyAsBool
CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_getPropertyAsBool(celix_bundle_context_t *ctx, const char *name, bool defaultValue)
Get the config property for the given key converted as bool value.
celix_bundleContext_trackBundlesAsync
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackBundlesAsync(celix_bundle_context_t *ctx, void *callbackHandle, void(*onStarted)(void *handle, const celix_bundle_t *bundle), void(*onStopped)(void *handle, const celix_bundle_t *bundle))
Track bundles.
celix_bundleContext_trackServiceTrackers
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackServiceTrackers(celix_bundle_context_t *ctx, const char *serviceName, void *callbackHandle, void(*trackerAdd)(void *handle, const celix_service_tracker_info_t *info), void(*trackerRemove)(void *handle, const celix_service_tracker_info_t *info))
Track the service tracker targeting the provided service name.
celix_service_tracker_info::bundleId
long bundleId
Bundle id of the owner of the service tracker.
Definition: celix_bundle_context.h:1208
celix_bundleContext_stopTrackerAsync
CELIX_FRAMEWORK_EXPORT void celix_bundleContext_stopTrackerAsync(celix_bundle_context_t *ctx, long trackerId, void *doneCallbackData, void(*doneCallback)(void *doneCallbackData))
Stop the tracker with the provided track id.
celix_bundleContext_tryRemoveScheduledEventAsync
CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_tryRemoveScheduledEventAsync(celix_bundle_context_t *ctx, long scheduledEventId)
Try to cancel and remove a scheduled event asynchronously.
celix_service_use_options::useWithProperties
void(* useWithProperties)(void *handle, void *svc, const celix_properties_t *props) CELIX_OPTS_INIT
The optional useWithProperties callback is handled as the use callback, but with the addition that th...
Definition: celix_bundle_context.h:796
celix_service_filter_options::CELIX_OPTS_INIT
const char *filter CELIX_OPTS_INIT
LDAP filter to use for fine tuning the filtering, e.g. (|(location=middle)(location=front))
Definition: celix_bundle_context.h:375
celix_service_registration_options::CELIX_OPTS_INIT
const char *serviceLanguage CELIX_OPTS_INIT
The optional service language.
Definition: celix_bundle_context.h:177
celix_bundleContext_registerServiceFactory
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_registerServiceFactory(celix_bundle_context_t *ctx, celix_service_factory_t *factory, const char *serviceName, celix_properties_t *props)
Register a service factory in the framework.
celix_bundleContext_stopBundle
CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_stopBundle(celix_bundle_context_t *ctx, long bndId)
Stop the bundle with the provided bundle id. Will silently ignore bundle ids < 0.
celix_bundleContext_trackBundlesWithOptions
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackBundlesWithOptions(celix_bundle_context_t *ctx, const celix_bundle_tracking_options_t *opts)
Tracks bundles using the provided bundle tracker options.
celix_bundleContext_trackServicesAsync
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackServicesAsync(celix_bundle_context_t *ctx, const char *serviceName, void *callbackHandle, void(*add)(void *handle, void *svc), void(*remove)(void *handle, void *svc))
Track services with the provided serviceName.
celix_service_registration_options::asyncCallback
void(* asyncCallback)(void *data, long serviceId) CELIX_OPTS_INIT
Async callback.
Definition: celix_bundle_context.h:204
celix_service_tracking_options::CELIX_OPTS_INIT
celix_service_filter_options_t filter CELIX_OPTS_INIT
The service filter options, used to setup the filter for the service to track.
Definition: celix_bundle_context.h:512
celix_bundleContext_stopTracker
CELIX_FRAMEWORK_EXPORT void celix_bundleContext_stopTracker(celix_bundle_context_t *ctx, long trackerId)
Stop the tracker with the provided track id.
celix_service_tracking_options::trackerCreatedCallback
void(* trackerCreatedCallback)(void *trackerCreatedCallbackData) CELIX_OPTS_INIT
The callback called when the tracker has ben created (and is active) when using a async call.
Definition: celix_bundle_context.h:595
celix_bundleContext_listInstalledBundles
CELIX_FRAMEWORK_EXPORT celix_array_list_t * celix_bundleContext_listInstalledBundles(celix_bundle_context_t *ctx)
List the installed bundle ids. The bundle ids does not include the framework bundle (bundle id CELIX_...
celix_bundleContext_getPropertyAsLong
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_getPropertyAsLong(celix_bundle_context_t *ctx, const char *name, long defaultValue)
Get the config property for the given key converted as long value.
celix_service_tracking_options::removeWithOwner
void(* removeWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner) CELIX_OPTS_INIT
The optional removeWithOwner callback is handled as the remove callback, but with the addition that t...
Definition: celix_bundle_context.h:580
celix_bundleContext_unregisterService
CELIX_FRAMEWORK_EXPORT void celix_bundleContext_unregisterService(celix_bundle_context_t *ctx, long serviceId)
Unregister the service or service factory with service id.
celix_service_use_options
Service Use Options used to fine tune which services to use and which callbacks to use.
Definition: celix_bundle_context.h:765
celix_bundleContext_useBundles
CELIX_FRAMEWORK_EXPORT size_t celix_bundleContext_useBundles(celix_bundle_context_t *ctx, void *callbackHandle, void(*use)(void *handle, const celix_bundle_t *bundle))
Use the currently installed bundles.
celix_bundleContext_uninstallBundle
CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_uninstallBundle(celix_bundle_context_t *ctx, long bndId)
Uninstall the bundle with the provided bundle id. If needed the bundle will be stopped first....
celix_service_use_options::use
void(* use)(void *handle, void *svc) CELIX_OPTS_INIT
The optional use callback will be called when for every services found conform the service filter opt...
Definition: celix_bundle_context.h:790
celix_bundleContext_findServices
CELIX_FRAMEWORK_EXPORT celix_array_list_t * celix_bundleContext_findServices(celix_bundle_context_t *ctx, const char *serviceName)
Finds the services with the provided service name and returns a list of the found service ids.
celix_bundleContext_scheduleEvent
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_scheduleEvent(celix_bundle_context_t *ctx, const celix_scheduled_event_options_t *options)
Add a scheduled event to the Celix framework.
celix_service_tracker_info::filter
celix_filter_t * filter
The parsed service filter, e.g. parsed "(&(objectClass=example_calc)(service.language=C)(meta....
Definition: celix_bundle_context.h:1192
celix_scheduled_event_options::CELIX_OPTS_INIT
double initialDelayInSeconds CELIX_OPTS_INIT
Initial delay in seconds before the event is processed.
Definition: celix_bundle_context.h:1299
celix_service_tracking_options::CELIX_OPTS_INIT
void *trackerCreatedCallbackData CELIX_OPTS_INIT
Data for the trackerCreatedCallback.
Definition: celix_bundle_context.h:586
celix_service_tracking_options
Service Tracker Options used to fine tune which services to track and the callback to be used for the...
Definition: celix_bundle_context.h:508
celix_scheduled_event_options::removeCallback
void(* removeCallback)(void *removeCallbackData) CELIX_OPTS_INIT
Callback function called when a scheduled event is removed. Will be called on the event thread.
Definition: celix_bundle_context.h:1313
celix_bundleContext_waitForAsyncStopTracker
CELIX_FRAMEWORK_EXPORT void celix_bundleContext_waitForAsyncStopTracker(celix_bundle_context_t *ctx, long trackerId)
Wait for (async) stopping of tracking.
celix_service_registration_guard::svcId
long svcId
Definition: celix_bundle_context.h:282
celix_service_use_options::CELIX_OPTS_INIT
int flags CELIX_OPTS_INIT
Definition: celix_bundle_context.h:813
celix_bundleContext_isBundleActive
CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_isBundleActive(celix_bundle_context_t *ctx, long bndId)
Check whether the bundle is active.
celix_service_filter_options
Service filter options which can be used to query for certain services.
Definition: celix_bundle_context.h:353
celix_bundleContext_trackService
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackService(celix_bundle_context_t *ctx, const char *serviceName, void *callbackHandle, void(*set)(void *handle, void *svc))
Track the highest ranking service with the provided serviceName.
celix_bundle_tracker_options::onStarted
void(* onStarted)(void *handle, const celix_bundle_t *bundle) CELIX_OPTS_INIT
Tracker callback when a bundle is started.
Definition: celix_bundle_context.h:1069
celix_scheduled_event_options::CELIX_OPTS_INIT
void *callbackData CELIX_OPTS_INIT
Data passed to the callback function when a event is scheduled.
Definition: celix_bundle_context.h:1305
celix_bundleContext_unregisterServiceAsync
CELIX_FRAMEWORK_EXPORT void celix_bundleContext_unregisterServiceAsync(celix_bundle_context_t *ctx, long serviceId, void *doneData, void(*doneCallback)(void *doneData))
Unregister the service or service factory with service id.
celix_bundleContext_waitForAsyncUnregistration
CELIX_FRAMEWORK_EXPORT void celix_bundleContext_waitForAsyncUnregistration(celix_bundle_context_t *ctx, long serviceId)
Waits til the async service unregistration for the provided serviceId is done.
celix_bundleContext_log
CELIX_FRAMEWORK_EXPORT void celix_bundleContext_log(const celix_bundle_context_t *ctx, celix_log_level_e level, const char *format,...) __attribute__((format(printf
Logs a message to Celix framework logger with the provided log level.
celix_bundleContext_registerServiceFactoryAsync
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_registerServiceFactoryAsync(celix_bundle_context_t *ctx, celix_service_factory_t *factory, const char *serviceName, celix_properties_t *props)
Register a service factory in the framework.
celix_bundle_tracker_options::onInstalled
void(* onInstalled)(void *handle, const celix_bundle_t *bundle) CELIX_OPTS_INIT
Tracker callback when a bundle is installed.
Definition: celix_bundle_context.h:1061
celix_scheduled_event_options_t
struct celix_scheduled_event_options celix_scheduled_event_options_t
celix_bundleContext_getProperty
const CELIX_FRAMEWORK_EXPORT char * celix_bundleContext_getProperty(celix_bundle_context_t *ctx, const char *key, const char *defaultVal)
Get the config property for the given key.
celix_bundleContext_registerServiceAsync
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_registerServiceAsync(celix_bundle_context_t *ctx, void *svc, const char *serviceName, celix_properties_t *properties)
Register a service to the Celix framework.
celix_service_filter_options_t
struct celix_service_filter_options celix_service_filter_options_t
Service filter options which can be used to query for certain services.
celix_bundleContext_waitForAsyncRegistration
CELIX_FRAMEWORK_EXPORT void celix_bundleContext_waitForAsyncRegistration(celix_bundle_context_t *ctx, long serviceId)
Waits til the async service registration for the provided serviceId is done.
celix_service_tracking_options::removeWithProperties
void(* removeWithProperties)(void *handle, void *svc, const celix_properties_t *props) CELIX_OPTS_INIT
The optional removeWithProperties callback is handled as the remove callback, but with the addition t...
Definition: celix_bundle_context.h:574
celix_bundleContext_updateBundle
CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_updateBundle(celix_bundle_context_t *ctx, long bndId, const char *updatedBundleUrl)
Update the bundle with the provided bundle id.
celix_bundleContext_useBundle
CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_useBundle(celix_bundle_context_t *ctx, long bundleId, void *callbackHandle, void(*use)(void *handle, const celix_bundle_t *bundle))
Use the bundle with the provided bundle id.
celix_scheduled_event_options
Celix scheduled event options, used for creating scheduling events with the celix framework.
Definition: celix_bundle_context.h:1292
celix_bundleContext_findService
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_findService(celix_bundle_context_t *ctx, const char *serviceName)
Finds the highest ranking service and returns the service id.
celix_bundleContext_removeScheduledEventAsync
CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_removeScheduledEventAsync(celix_bundle_context_t *ctx, long scheduledEventId)
Cancel and remove a scheduled event asynchronously.
celix_bundleContext_useServices
CELIX_FRAMEWORK_EXPORT size_t celix_bundleContext_useServices(celix_bundle_context_t *ctx, const char *serviceName, void *callbackHandle, void(*use)(void *handle, void *svc))
Use the services with the provided service name using the provided callback.
celix_service_tracking_options::set
void(* set)(void *handle, void *svc) CELIX_OPTS_INIT
The optional set callback will be called when a new highest ranking service is available conform the ...
Definition: celix_bundle_context.h:525
celix_bundleContext_trackServicesWithOptionsAsync
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackServicesWithOptionsAsync(celix_bundle_context_t *ctx, const celix_service_tracking_options_t *opts)
Tracks services using the provided tracker options.
celix_service_filter_options::CELIX_OPTS_INIT
bool ignoreServiceLanguage CELIX_OPTS_INIT
Definition: celix_bundle_context.h:388
celix_scheduled_event_options::CELIX_OPTS_INIT
double intervalInSeconds CELIX_OPTS_INIT
Schedule interval in seconds. 0 means one-shot scheduled event.
Definition: celix_bundle_context.h:1301
celix_service_tracker_info_t
struct celix_service_tracker_info celix_service_tracker_info_t
Service Tracker Info provided to the service tracker tracker callbacks.
celix_service_registration_options::CELIX_OPTS_INIT
const char *serviceName CELIX_OPTS_INIT
The required service name.
Definition: celix_bundle_context.h:159
celix_service_use_options::CELIX_OPTS_INIT
celix_service_filter_options_t filter CELIX_OPTS_INIT
The service filter options, used to setup the filter for the service to track.
Definition: celix_bundle_context.h:769
celix_service_tracker_info
Service Tracker Info provided to the service tracker tracker callbacks.
Definition: celix_bundle_context.h:1188
celix_bundle_tracking_options_t
struct celix_bundle_tracker_options celix_bundle_tracking_options_t
The Service Bundle Tracking options can be used to fine tune the requested bundle tracker options.
celix_service_tracking_options::setWithOwner
void(* setWithOwner)(void *handle, void *svc, const celix_properties_t *props, const celix_bundle_t *svcOwner) CELIX_OPTS_INIT
The optional setWithOwner callback is handled as the set callback, but with the addition that the ser...
Definition: celix_bundle_context.h:537
celix_bundle_tracker_options::onStopped
void(* onStopped)(void *handle, const celix_bundle_t *bundle) CELIX_OPTS_INIT
Tracker callback when a bundle is stopped.
Definition: celix_bundle_context.h:1077
celix_bundleContext_trackBundlesWithOptionsAsync
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackBundlesWithOptionsAsync(celix_bundle_context_t *ctx, const celix_bundle_tracking_options_t *opts)
Tracks bundles using the provided bundle tracker options.
celix_service_use_options::CELIX_OPTS_INIT
void *callbackHandle CELIX_OPTS_INIT
The optional callback pointer used in all the provided callback function (set, add,...
Definition: celix_bundle_context.h:781
celix_bundleContext_vlog
CELIX_FRAMEWORK_EXPORT void CELIX_FRAMEWORK_EXPORT void celix_bundleContext_vlog(const celix_bundle_context_t *ctx, celix_log_level_e level, const char *format, va_list formatArgs) __attribute__((format(printf
Logs a message to Celix framework logger with the provided log level.
celix_service_registration_options::CELIX_OPTS_INIT
celix_service_factory_t *factory CELIX_OPTS_INIT
The service factory pointer.
Definition: celix_bundle_context.h:151
celix_bundleContext_isServiceRegistered
CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_isServiceRegistered(celix_bundle_context_t *ctx, long serviceId)
Checks whether a service for the provided service id is registered in the service registry.
celix_bundleContext_trackServiceAsync
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackServiceAsync(celix_bundle_context_t *ctx, const char *serviceName, void *callbackHandle, void(*set)(void *handle, void *svc))
Track the highest ranking service with the provided serviceName.
celix_bundleContext_trackServicesWithOptions
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackServicesWithOptions(celix_bundle_context_t *ctx, const celix_service_tracking_options_t *opts)
Tracks services using the provided tracker options.
celix_bundleContext_getFramework
CELIX_FRAMEWORK_EXPORT celix_framework_t * celix_bundleContext_getFramework(const celix_bundle_context_t *ctx)
celix_scheduled_event_options::CELIX_OPTS_INIT
const char *name CELIX_OPTS_INIT
The name of the event, used for logging and debugging.
Definition: celix_bundle_context.h:1293
celix_bundleContext_isBundleInstalled
CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_isBundleInstalled(celix_bundle_context_t *ctx, long bndId)
Check whether a bundle is installed.
celix_service_tracking_options::add
void(* add)(void *handle, void *svc) CELIX_OPTS_INIT
The optional add callback will be called for every current and future service found conform the provi...
Definition: celix_bundle_context.h:545
celix_bundle_tracker_options::CELIX_OPTS_INIT
void *callbackHandle CELIX_OPTS_INIT
The optional callback pointer used in all the provided callback function (set, add,...
Definition: celix_bundle_context.h:1053
celix_bundleContext_startBundle
CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_startBundle(celix_bundle_context_t *ctx, long bndId)
Start the bundle with the provided bundle id. Will silently ignore bundle ids < 0.
celix_service_tracker_info::serviceLanguage
const char * serviceLanguage
Definition: celix_bundle_context.h:1203
celix_service_registration_options::CELIX_OPTS_INIT
void *svc CELIX_OPTS_INIT
The service pointer.
Definition: celix_bundle_context.h:134
celix_bundleContext_registerServiceWithOptionsAsync
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_registerServiceWithOptionsAsync(celix_bundle_context_t *ctx, const celix_service_registration_options_t *opts)
Register a service to the Celix framework using the provided service registration options.
celix_service_tracker_info::serviceName
const char * serviceName
The service name filter attribute parsed from the service filter (i.e. the value of the objectClass a...
Definition: celix_bundle_context.h:1197
celix_bundleContext_trackServices
CELIX_FRAMEWORK_EXPORT long celix_bundleContext_trackServices(celix_bundle_context_t *ctx, const char *serviceName, void *callbackHandle, void(*add)(void *handle, void *svc), void(*remove)(void *handle, void *svc))
Track services with the provided serviceName.