20 #include "celix_types.h" 21 #include "celix_service_factory.h" 22 #include "celix_properties.h" 23 #include "celix_array_list.h" 24 #include "celix_filter.h" 26 #ifndef CELIX_BUNDLE_CONTEXT_H_ 27 #define CELIX_BUNDLE_CONTEXT_H_ 135 #define CELIX_EMPTY_SERVICE_REGISTRATION_OPTIONS { .svc = NULL, \ 137 .serviceName = NULL, \ 138 .properties = NULL, \ 139 .serviceLanguage = NULL, \ 140 .serviceVersion = NULL } 229 #define CELIX_EMPTY_SERVICE_FILTER_OPTIONS {.serviceName = NULL, .versionRange = NULL, .filter = NULL, .serviceLanguage = NULL, .ignoreServiceLanguage = false} 265 celix_bundle_context_t* ctx,
266 const char* serviceName,
267 void* callbackHandle,
268 void (*
set)(
void* handle,
void* svc)
282 celix_bundle_context_t* ctx,
283 const char* serviceName,
284 void* callbackHandle,
285 void (*add)(
void* handle,
void* svc),
286 void (*
remove)(
void* handle,
void* svc)
309 void (*
set)(
void *handle,
void *svc) OPTS_INIT;
315 void (*setWithProperties)(
void *handle,
void *svc,
const celix_properties_t *props) OPTS_INIT;
321 void (*setWithOwner)(
void *handle,
void *svc,
const celix_properties_t *props,
const celix_bundle_t *svcOwner) OPTS_INIT;
329 void (*add)(
void *handle,
void *svc) OPTS_INIT;
335 void (*addWithProperties)(
void *handle,
void *svc,
const celix_properties_t *props) OPTS_INIT;
341 void (*addWithOwner)(
void *handle,
void *svc,
const celix_properties_t *props,
const celix_bundle_t *svcOwner) OPTS_INIT;
352 void (*
remove)(
void *handle,
void *svc) OPTS_INIT;
358 void (*removeWithProperties)(
void *handle,
void *svc,
const celix_properties_t *props) OPTS_INIT;
364 void (*removeWithOwner)(
void *handle,
void *svc,
const celix_properties_t *props,
const celix_bundle_t *svcOwner) OPTS_INIT;
371 #define CELIX_EMPTY_SERVICE_TRACKING_OPTIONS { .filter.serviceName = NULL, \ 372 .filter.versionRange = NULL, \ 373 .filter.filter = NULL, \ 374 .filter.serviceLanguage = NULL, \ 375 .filter.ignoreServiceLanguage = false, \ 376 .callbackHandle = NULL, \ 380 .setWithProperties = NULL, \ 381 .addWithProperties = NULL, \ 382 .removeWithProperties = NULL, \ 383 .setWithOwner = NULL, \ 384 .addWithOwner = NULL, \ 385 .removeWithOwner = NULL} 430 celix_bundle_context_t *ctx,
432 const char *serviceName ,
433 void *callbackHandle,
434 void (*use)(
void *handle,
void* svc)
454 celix_bundle_context_t *ctx,
455 const char* serviceName,
456 void *callbackHandle,
457 void (*use)(
void *handle,
void *svc)
476 celix_bundle_context_t *ctx,
477 const char* serviceName,
478 void *callbackHandle,
479 void (*use)(
void *handle,
void *svc)
510 void (*use)(
void *handle,
void *svc) OPTS_INIT;
516 void (*useWithProperties)(
void *handle,
void *svc,
const celix_properties_t *props) OPTS_INIT;
522 void (*useWithOwner)(
void *handle,
void *svc,
const celix_properties_t *props,
const celix_bundle_t *svcOwner) OPTS_INIT;
529 #define CELIX_EMPTY_SERVICE_USE_OPTIONS {.filter.serviceName = NULL, \ 530 .filter.versionRange = NULL, \ 531 .filter.filter = NULL, \ 532 .filter.serviceLanguage = NULL, \ 533 .waitTimeoutInSeconds = 0.0F, \ 534 .callbackHandle = NULL, \ 536 .useWithProperties = NULL, \ 537 .useWithOwner = NULL} 555 celix_bundle_context_t *ctx,
573 celix_bundle_context_t *ctx,
649 celix_bundle_context_t* ctx,
650 void* callbackHandle,
651 void (*onStarted)(
void* handle,
const celix_bundle_t *bundle),
652 void (*onStopped)(
void *handle,
const celix_bundle_t *bundle)
671 void (*onStarted)(
void *handle,
const celix_bundle_t *bundle) OPTS_INIT;
679 void (*onStopped)(
void *handle,
const celix_bundle_t *bundle) OPTS_INIT;
688 void (*onBundleEvent)(
void *handle,
const celix_bundle_event_t *event) OPTS_INIT;
701 #define CELIX_EMPTY_BUNDLE_TRACKING_OPTIONS {.callbackHandle = NULL, .onStarted = NULL, .onStopped = NULL, .onBundleEvent = NULL} 714 celix_bundle_context_t* ctx,
730 celix_bundle_context_t *ctx,
732 void *callbackHandle,
733 void (*use)(
void *handle,
const celix_bundle_t *bundle)
746 celix_bundle_context_t *ctx,
747 void *callbackHandle,
748 void (*use)(
void *handle,
const celix_bundle_t *bundle)
799 celix_bundle_context_t *ctx,
800 const char *serviceName,
801 void *callbackHandle,
865 #endif //CELIX_BUNDLE_CONTEXT_H_ long celix_bundleContext_findService(celix_bundle_context_t *ctx, const char *serviceName)
long celix_bundleContext_trackService(celix_bundle_context_t *ctx, const char *serviceName, void *callbackHandle, void(*set)(void *handle, void *svc))
bool ignoreServiceLanguage OPTS_INIT
Definition: celix_bundle_context.h:222
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))
celix_array_list_t * celix_bundleContext_listBundles(celix_bundle_context_t *ctx)
Definition: celix_bundle_context.h:485
celix_bundle_t * celix_bundleContext_getBundle(celix_bundle_context_t *ctx)
Definition: celix_bundle_context.h:193
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))
void celix_bundleContext_useServicesWithOptions(celix_bundle_context_t *ctx, const celix_service_use_options_t *opts)
const char *serviceLanguage OPTS_INIT
Definition: celix_bundle_context.h:119
const char *versionRange OPTS_INIT
Definition: celix_bundle_context.h:204
bool celix_bundleContext_startBundle(celix_bundle_context_t *ctx, long bundleId)
bool celix_bundleContext_useService(celix_bundle_context_t *ctx, const char *serviceName, void *callbackHandle, void(*use)(void *handle, void *svc))
const char * celix_bundleContext_getProperty(celix_bundle_context_t *ctx, const char *key, const char *defaultVal)
celix_service_factory_t *factory OPTS_INIT
Definition: celix_bundle_context.h:99
Definition: celix_bundle_context.h:75
const char *serviceName OPTS_INIT
Definition: celix_bundle_context.h:105
celix_array_list_t * celix_bundleContext_findServicesWithOptions(celix_bundle_context_t *ctx, const celix_service_filter_options_t *opts)
long celix_bundleContext_findServiceWithOptions(celix_bundle_context_t *ctx, const celix_service_filter_options_t *opts)
long celix_bundleContext_registerServiceWithOptions(celix_bundle_context_t *ctx, const celix_service_registration_options_t *opts)
bool celix_bundleContext_uninstallBundle(celix_bundle_context_t *ctx, long bundleId)
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))
long celix_bundleContext_trackServicesWithOptions(celix_bundle_context_t *ctx, const celix_service_tracking_options_t *opts)
bool celix_bundleContext_getPropertyAsBool(celix_bundle_context_t *ctx, const char *key, bool defaultValue)
struct celix_service_registration_options celix_service_registration_options_t
celix_properties_t *properties OPTS_INIT
Definition: celix_bundle_context.h:114
void *callbackHandle OPTS_INIT
Definition: celix_bundle_context.h:501
bool celix_bundleContext_useServiceWithId(celix_bundle_context_t *ctx, long serviceId, const char *serviceName, void *callbackHandle, void(*use)(void *handle, void *svc))
const char *serviceLanguage OPTS_INIT
Definition: celix_bundle_context.h:215
void celix_bundleContext_useServices(celix_bundle_context_t *ctx, const char *serviceName, void *callbackHandle, void(*use)(void *handle, void *svc))
double celix_bundleContext_getPropertyAsDouble(celix_bundle_context_t *ctx, const char *key, double defaultValue)
struct celix_service_tracking_options celix_service_tracking_options_t
long celix_bundleContext_registerService(celix_bundle_context_t *ctx, void *svc, const char *serviceName, celix_properties_t *properties)
long celix_bundleContext_trackBundlesWithOptions(celix_bundle_context_t *ctx, const celix_bundle_tracking_options_t *opts)
bool celix_bundleContext_useServiceWithOptions(celix_bundle_context_t *ctx, const celix_service_use_options_t *opts)
void celix_bundleContext_useBundles(celix_bundle_context_t *ctx, void *callbackHandle, void(*use)(void *handle, const celix_bundle_t *bundle))
long celix_bundleContext_getPropertyAsLong(celix_bundle_context_t *ctx, const char *key, long defaultValue)
struct celix_bundle_tracker_options celix_bundle_tracking_options_t
struct celix_service_use_options celix_service_use_options_t
const char * serviceLanguage
Definition: celix_bundle_context.h:773
double waitTimeoutInSeconds OPTS_INIT
Definition: celix_bundle_context.h:496
Definition: celix_bundle_context.h:659
Definition: celix_bundle_context.h:292
long celix_bundleContext_installBundle(celix_bundle_context_t *ctx, const char *bundleLoc, bool autoStart)
bool celix_bundleContext_useBundle(celix_bundle_context_t *ctx, long bundleId, void *callbackHandle, void(*use)(void *handle, const celix_bundle_t *bundle))
celix_dependency_manager_t * celix_bundleContext_getDependencyManager(celix_bundle_context_t *ctx)
const char * serviceName
Definition: celix_bundle_context.h:768
Definition: celix_bundle_context.h:759
celix_service_filter_options_t filter OPTS_INIT
Definition: celix_bundle_context.h:489
void *callbackHandle OPTS_INIT
Definition: celix_bundle_context.h:301
void *svc OPTS_INIT
Definition: celix_bundle_context.h:83
void celix_bundleContext_stopTracker(celix_bundle_context_t *ctx, long trackerId)
struct celix_service_filter_options celix_service_filter_options_t
void *callbackHandle OPTS_INIT
Definition: celix_bundle_context.h:663
void celix_bundleContext_unregisterService(celix_bundle_context_t *ctx, long serviceId)
struct celix_service_tracker_info celix_service_tracker_info_t
bool includeFrameworkBundle OPTS_INIT
Definition: celix_bundle_context.h:694
celix_array_list_t * celix_bundleContext_findServices(celix_bundle_context_t *ctx, const char *serviceName)
const char *serviceVersion OPTS_INIT
Definition: celix_bundle_context.h:128
long bundleId
Definition: celix_bundle_context.h:778
celix_service_filter_options_t filter OPTS_INIT
Definition: celix_bundle_context.h:296
bool celix_bundleContext_isBundleInstalled(celix_bundle_context_t *ctx, long bndId)
celix_filter_t * filter
Definition: celix_bundle_context.h:763
bool celix_bundleContext_stopBundle(celix_bundle_context_t *ctx, long bundleId)
const char *serviceName OPTS_INIT
Definition: celix_bundle_context.h:197
const char *filter OPTS_INIT
Definition: celix_bundle_context.h:210
long celix_bundleContext_registerServiceFactory(celix_bundle_context_t *ctx, celix_service_factory_t *factory, const char *serviceName, celix_properties_t *props)