You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by ab...@apache.org on 2012/01/12 14:29:07 UTC
svn commit: r1230520 [2/2] - in /incubator/celix/trunk: cmake/
dependency_manager/ deployment_admin/private/include/
examples/echo_service/client/
examples/osgi-in-action/chapter04-paint-example/paint/private/src/
examples/sender/ examples/whiteboard/t...
Modified: incubator/celix/trunk/framework/private/src/service_registry.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/service_registry.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/service_registry.c (original)
+++ incubator/celix/trunk/framework/private/src/service_registry.c Thu Jan 12 13:29:03 2012
@@ -32,6 +32,7 @@
#include "listener_hook_service.h"
#include "constants.h"
#include "service_reference.h"
+#include "framework.h"
struct serviceRegistry {
FRAMEWORK framework;
@@ -81,7 +82,9 @@ USAGE_COUNT serviceRegistry_addUsageCoun
if (usages == NULL) {
MODULE mod = NULL;
- arrayList_create(bundle->memoryPool, &usages);
+ apr_pool_t *pool = NULL;
+ bundle_getMemoryPool(bundle, &pool);
+ arrayList_create(pool, &usages);
bundle_getCurrentModule(bundle, &mod);
}
arrayList_add(usages, usage);
@@ -110,8 +113,10 @@ void serviceRegistry_flushUsageCount(SER
SERVICE_REGISTRY serviceRegistry_create(FRAMEWORK framework, void (*serviceChanged)(FRAMEWORK, SERVICE_EVENT_TYPE, SERVICE_REGISTRATION, PROPERTIES)) {
SERVICE_REGISTRY registry;
+ apr_pool_t *pool = NULL;
- registry = (SERVICE_REGISTRY) apr_palloc(framework->mp, (sizeof(*registry)));
+ framework_getMemoryPool(framework, &pool);
+ registry = (SERVICE_REGISTRY) apr_palloc(pool, (sizeof(*registry)));
if (registry == NULL) {
// no memory
} else {
@@ -122,8 +127,8 @@ SERVICE_REGISTRY serviceRegistry_create(
registry->serviceRegistrations = hashMap_create(NULL, NULL, NULL, NULL);
registry->framework = framework;
- arrayList_create(framework->mp, ®istry->listenerHooks);
- mutexattr = apr_thread_mutex_create(®istry->mutex, APR_THREAD_MUTEX_NESTED, framework->mp);
+ arrayList_create(pool, ®istry->listenerHooks);
+ mutexattr = apr_thread_mutex_create(®istry->mutex, APR_THREAD_MUTEX_NESTED, pool);
registry->currentServiceId = 1l;
}
@@ -175,10 +180,10 @@ SERVICE_REGISTRATION serviceRegistry_reg
celix_status_t serviceRegistry_registerServiceInternal(SERVICE_REGISTRY registry, BUNDLE bundle, char * serviceName, void * serviceObject, PROPERTIES dictionary, bool isFactory, SERVICE_REGISTRATION *registration) {
ARRAY_LIST regs;
- apr_pool_t *pool;
+ apr_pool_t *pool = NULL;
apr_thread_mutex_lock(registry->mutex);
- pool = bundle->memoryPool;
+ bundle_getMemoryPool(bundle, &pool);
if (isFactory) {
*registration = serviceRegistration_createServiceFactory(pool, registry, bundle, serviceName, ++registry->currentServiceId, serviceObject, dictionary);
@@ -191,7 +196,7 @@ celix_status_t serviceRegistry_registerS
regs = (ARRAY_LIST) hashMap_get(registry->serviceRegistrations, bundle);
if (regs == NULL) {
regs = NULL;
- arrayList_create(bundle->memoryPool, ®s);
+ arrayList_create(pool, ®s);
}
arrayList_add(regs, *registration);
hashMap_put(registry->serviceRegistrations, bundle, regs);
@@ -214,6 +219,7 @@ void serviceRegistry_unregisterService(S
ARRAY_LIST clients;
int i;
ARRAY_LIST regs;
+ ARRAY_LIST references = NULL;
apr_thread_mutex_lock(registry->mutex);
@@ -234,9 +240,13 @@ void serviceRegistry_unregisterService(S
apr_thread_mutex_lock(registry->mutex);
// unget service
- for (i = 0; i < arrayList_size(registration->references); i++) {
- SERVICE_REFERENCE reference = arrayList_get(registration->references, i);
- ARRAY_LIST clients = serviceRegistry_getUsingBundles(registry, registry->framework->mp, reference);
+ serviceRegistration_getServiceReferences(registration, &references);
+ for (i = 0; i < arrayList_size(references); i++) {
+ SERVICE_REFERENCE reference = arrayList_get(references, i);
+ apr_pool_t *pool = NULL;
+
+ framework_getMemoryPool(registry->framework, &pool);
+ ARRAY_LIST clients = serviceRegistry_getUsingBundles(registry, pool, reference);
int j;
for (j = 0; (clients != NULL) && (j < arrayList_size(clients)); j++) {
BUNDLE client = arrayList_get(clients, j);
@@ -284,14 +294,19 @@ void serviceRegistry_unregisterServices(
celix_status_t serviceRegistry_createServiceReference(SERVICE_REGISTRY registry, apr_pool_t *pool, SERVICE_REGISTRATION registration, SERVICE_REFERENCE *reference) {
celix_status_t status = CELIX_SUCCESS;
+ BUNDLE bundle = NULL;
+ ARRAY_LIST references = NULL;
+
apr_pool_t *spool = NULL;
apr_pool_create(&spool, pool);
- serviceReference_create(spool, registration->bundle, registration, reference);
+ serviceRegistration_getBundle(registration, &bundle);
+ serviceReference_create(spool, bundle, registration, reference);
apr_pool_pre_cleanup_register(spool, *reference, serviceRegistry_removeReference);
- arrayList_add(registration->references, *reference);
+ serviceRegistration_getServiceReferences(registration, &references);
+ arrayList_add(references, *reference);
return status;
}
@@ -309,20 +324,26 @@ celix_status_t serviceRegistry_getServic
int regIdx;
for (regIdx = 0; (regs != NULL) && regIdx < arrayList_size(regs); regIdx++) {
SERVICE_REGISTRATION registration = (SERVICE_REGISTRATION) arrayList_get(regs, regIdx);
+ PROPERTIES props = NULL;
- bool matched = false;
- if ((serviceName == NULL) && ((filter == NULL) || filter_match(filter, registration->properties))) {
- matched = true;
- } else if (serviceName != NULL) {
- if ((strcmp(registration->className, serviceName) == 0) && ((filter == NULL) || filter_match(filter, registration->properties))) {
+ status = serviceRegistration_getProperties(registration, &props);
+ if (status == CELIX_SUCCESS) {
+ bool matched = false;
+ if ((serviceName == NULL) && ((filter == NULL) || filter_match(filter, props))) {
matched = true;
+ } else if (serviceName != NULL) {
+ char *className = NULL;
+ serviceRegistration_getServiceName(registration, &className);
+ if ((strcmp(className, serviceName) == 0) && ((filter == NULL) || filter_match(filter, props))) {
+ matched = true;
+ }
}
- }
- if (matched) {
- if (serviceRegistration_isValid(registration)) {
- SERVICE_REFERENCE reference = NULL;
- serviceRegistry_createServiceReference(registry, pool, registration, &reference);
- arrayList_add(*references, reference);
+ if (matched) {
+ if (serviceRegistration_isValid(registration)) {
+ SERVICE_REFERENCE reference = NULL;
+ serviceRegistry_createServiceReference(registry, pool, registration, &reference);
+ arrayList_add(*references, reference);
+ }
}
}
}
@@ -339,7 +360,9 @@ apr_status_t serviceRegistry_removeRefer
serviceReference_getServiceRegistration(reference, ®istration);
if (registration != NULL) {
- arrayList_removeElement(registration->references, reference);
+ ARRAY_LIST references = NULL;
+ serviceRegistration_getServiceReferences(registration, &references);
+ arrayList_removeElement(references, reference);
}
return APR_SUCCESS;
@@ -350,7 +373,9 @@ ARRAY_LIST serviceRegistry_getServicesIn
if (usages != NULL) {
int i;
ARRAY_LIST references = NULL;
- arrayList_create(bundle->memoryPool, &references);
+ apr_pool_t *pool = NULL;
+ bundle_getMemoryPool(bundle, &pool);
+ arrayList_create(pool, &references);
for (i = 0; i < arrayList_size(usages); i++) {
USAGE_COUNT usage = arrayList_get(usages, i);
@@ -424,6 +449,9 @@ void serviceRegistry_ungetServices(SERVI
ARRAY_LIST usages;
int i;
+ apr_pool_t *pool = NULL;
+ bundle_getMemoryPool(bundle, &pool);
+
apr_thread_mutex_lock(registry->mutex);
usages = hashMap_get(registry->inUseMap, bundle);
apr_thread_mutex_unlock(registry->mutex);
@@ -433,7 +461,7 @@ void serviceRegistry_ungetServices(SERVI
}
// usage arrays?
- fusages = arrayList_clone(bundle->memoryPool, usages);
+ fusages = arrayList_clone(pool, usages);
for (i = 0; i < arrayList_size(fusages); i++) {
USAGE_COUNT usage = arrayList_get(fusages, i);
@@ -482,7 +510,9 @@ celix_status_t serviceRegistry_addHooks(
celix_status_t serviceRegistry_removeHook(SERVICE_REGISTRY registry, SERVICE_REGISTRATION registration) {
celix_status_t status = CELIX_SUCCESS;
- char *serviceName = properties_get(registration->properties, (char *) OBJECTCLASS);
+ PROPERTIES props = NULL;
+ serviceRegistration_getProperties(registration, &props);
+ char *serviceName = properties_get(props, (char *) OBJECTCLASS);
if (strcmp(listener_hook_service_name, serviceName) == 0) {
arrayList_removeElement(registry->listenerHooks, registration);
}
Modified: incubator/celix/trunk/framework/private/src/service_tracker.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/service_tracker.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/service_tracker.c (original)
+++ incubator/celix/trunk/framework/private/src/service_tracker.c Thu Jan 12 13:29:03 2012
@@ -42,7 +42,7 @@ struct serviceTracker {
void * addingService(FW_SERVICE_TRACKER, SERVICE_REFERENCE);
celix_status_t serviceTracker_track(FW_SERVICE_TRACKER, SERVICE_REFERENCE, SERVICE_EVENT);
-celix_status_t serviceTracker_untrack(FW_SERVICE_TRACKER fwTracker, SERVICE_REFERENCE reference, SERVICE_EVENT event ATTRIBUTE_UNUSED);
+celix_status_t serviceTracker_untrack(FW_SERVICE_TRACKER fwTracker, SERVICE_REFERENCE reference, SERVICE_EVENT event);
celix_status_t serviceTracker_create(BUNDLE_CONTEXT context, char * service, SERVICE_TRACKER_CUSTOMIZER customizer, SERVICE_TRACKER *tracker) {
celix_status_t status = CELIX_SUCCESS;
@@ -247,7 +247,7 @@ void tracker_serviceChanged(SERVICE_LIST
}
}
-celix_status_t serviceTracker_track(FW_SERVICE_TRACKER fwTracker, SERVICE_REFERENCE reference, SERVICE_EVENT event ATTRIBUTE_UNUSED) {
+celix_status_t serviceTracker_track(FW_SERVICE_TRACKER fwTracker, SERVICE_REFERENCE reference, SERVICE_EVENT event) {
celix_status_t status = CELIX_SUCCESS;
TRACKED tracked = NULL;
@@ -296,7 +296,7 @@ void * addingService(FW_SERVICE_TRACKER
return svc;
}
-celix_status_t serviceTracker_untrack(FW_SERVICE_TRACKER fwTracker, SERVICE_REFERENCE reference, SERVICE_EVENT event ATTRIBUTE_UNUSED) {
+celix_status_t serviceTracker_untrack(FW_SERVICE_TRACKER fwTracker, SERVICE_REFERENCE reference, SERVICE_EVENT event) {
celix_status_t status = CELIX_SUCCESS;
TRACKED tracked = NULL;
unsigned int i;
Copied: incubator/celix/trunk/framework/public/include/archive.h (from r1229165, incubator/celix/trunk/framework/private/include/archive.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/archive.h?p2=incubator/celix/trunk/framework/public/include/archive.h&p1=incubator/celix/trunk/framework/private/include/archive.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/archive.h (original)
+++ incubator/celix/trunk/framework/public/include/archive.h Thu Jan 12 13:29:03 2012
@@ -1,4 +1,4 @@
-/**
+/*
*Licensed to the Apache Software Foundation (ASF) under one
*or more contributor license agreements. See the NOTICE file
*distributed with this work for additional information
@@ -16,18 +16,35 @@
*specific language governing permissions and limitations
*under the License.
*/
-/*
- * archive.h
+/**
*
- * Created on: May 31, 2010
- * Author: alexanderb
+ * @defgroup Archive Archive
+ * @ingroup framework
+ * @{
+ *
+ * \author Alexander Broekhuis
+ * \date May 31, 2010
+ * \copyright Apache License, Version 2.0
*/
-
#ifndef ARCHIVE_H_
#define ARCHIVE_H_
#include "celix_errno.h"
+/**
+ * Extracts the bundle pointed to by bundleName to the given root.
+ *
+ * @param bundleName location of the bundle to extract.
+ * @param revisionRoot directory to where the bundle must be extracted.
+ *
+ * @return Status code indication failure or success:
+ * - CELIX_SUCCESS when no errors are encountered.
+ * - CELIX_FILE_IO_EXCEPTION If the zip file cannot be extracted.
+ */
celix_status_t extractBundle(char * bundleName, char * revisionRoot);
#endif /* ARCHIVE_H_ */
+
+/**
+ * @}
+ */
Copied: incubator/celix/trunk/framework/public/include/bundle.h (from r1229165, incubator/celix/trunk/framework/private/include/bundle.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/bundle.h?p2=incubator/celix/trunk/framework/public/include/bundle.h&p1=incubator/celix/trunk/framework/private/include/bundle.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/bundle.h (original)
+++ incubator/celix/trunk/framework/public/include/bundle.h Thu Jan 12 13:29:03 2012
@@ -27,16 +27,23 @@
#define BUNDLE_H_
#include <apr_general.h>
+#include <apr_portable.h>
+
+typedef struct bundle * BUNDLE;
-#include "headers.h"
#include "celix_errno.h"
+#include "bundle_state.h"
+#include "bundle_archive.h"
+#include "framework.h"
+#include "service_reference.h"
+#include "bundle_context.h"
celix_status_t bundle_create(BUNDLE * bundle, apr_pool_t *mp);
celix_status_t bundle_createFromArchive(BUNDLE * bundle, FRAMEWORK framework, BUNDLE_ARCHIVE archive, apr_pool_t *bundlePool);
celix_status_t bundle_destroy(BUNDLE bundle);
celix_status_t bundle_isSystemBundle(BUNDLE bundle, bool *systemBundle);
-BUNDLE_ARCHIVE bundle_getArchive(BUNDLE bundle);
+celix_status_t bundle_getArchive(BUNDLE bundle, BUNDLE_ARCHIVE *archive);
celix_status_t bundle_getCurrentModule(BUNDLE bundle, MODULE *module);
ARRAY_LIST bundle_getModules(BUNDLE bundle);
void * bundle_getHandle(BUNDLE bundle);
@@ -85,4 +92,9 @@ celix_status_t bundle_getBundleId(BUNDLE
celix_status_t bundle_getRegisteredServices(BUNDLE bundle, apr_pool_t *pool, ARRAY_LIST *list);
celix_status_t bundle_getServicesInUse(BUNDLE bundle, ARRAY_LIST *list);
+celix_status_t bundle_getMemoryPool(BUNDLE bundle, apr_pool_t **pool);
+
+celix_status_t bundle_setFramework(BUNDLE bundle, FRAMEWORK framework);
+celix_status_t bundle_getFramework(BUNDLE bundle, FRAMEWORK *framework);
+
#endif /* BUNDLE_H_ */
Added: incubator/celix/trunk/framework/public/include/bundle_activator.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/bundle_activator.h?rev=1230520&view=auto
==============================================================================
--- incubator/celix/trunk/framework/public/include/bundle_activator.h (added)
+++ incubator/celix/trunk/framework/public/include/bundle_activator.h Thu Jan 12 13:29:03 2012
@@ -0,0 +1,116 @@
+/*
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements. See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership. The ASF licenses this file
+ *to you under the Apache License, Version 2.0 (the
+ *"License"); you may not use this file except in compliance
+ *with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *Unless required by applicable law or agreed to in writing,
+ *software distributed under the License is distributed on an
+ *"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ *specific language governing permissions and limitations
+ *under the License.
+ */
+/**
+ *
+ * @defgroup BundleActivator BundleActivator
+ * @ingroup framework
+ * @{
+ * \brief Customizes the starting and stopping of a bundle.
+ * \details \ref BundleActivator is a header that must be implemented by every
+ * bundle. The Framework creates/starts/stops/destroys activator instances using the
+ * functions described in this header. If the bundleActivator_start()
+ * function executes successfully, it is guaranteed that the same instance's
+ * bundleActivator_stop() function will be called when the bundle is
+ * to be stopped. The same applies to the bundleActivator_create() and
+ * bundleActivator_destroy() functions.
+ * The Framework must not concurrently call the activator functions.
+ * \author Alexander Broekhuis
+ * \date March 18, 2010
+ * \copyright Apache License, Version 2.0
+ */
+#ifndef BUNDLE_ACTIVATOR_H_
+#define BUNDLE_ACTIVATOR_H_
+
+#include "bundle_context.h"
+
+/**
+ * Called when this bundle is started so the bundle can create an instance for its activator.
+ * The framework does not assume any type for the activator instance, this is implementation specific.
+ * The activator instance is handle as a void pointer by the framework, the implementation must cast it to the
+ * implementation specific type.
+ *
+ * @param context The execution context of the bundle being started.
+ * @param[out] userData A pointer to the specific activator instance used by this bundle.
+ *
+ * @return Status code indication failure or success:
+ * - CELIX_SUCCESS when no errors are encountered.
+ * - Any other status code will mark the bundle as stopped and the framework will remove this
+ * bundle's listeners, unregister all services, and release all services used by this bundle.
+ */
+celix_status_t bundleActivator_create(BUNDLE_CONTEXT context, void **userData);
+
+/**
+ * Called when this bundle is started so the Framework can perform the bundle-specific activities necessary
+ * to start this bundle. This method can be used to register services or to allocate any resources that this
+ * bundle needs.
+ *
+ * <p>
+ * This method must complete and return to its caller in a timely manner.
+ *
+ * @param userData The activator instance to be used.
+ * @param context The execution context of the bundle being started.
+ *
+ * @return Status code indication failure or success:
+ * - CELIX_SUCCESS when no errors are encountered.
+ * - Any other status code will mark the bundle as stopped and the framework will remove this
+ * bundle's listeners, unregister all services, and release all services used by this bundle.
+ */
+celix_status_t bundleActivator_start(void * userData, BUNDLE_CONTEXT context);
+
+/**
+ * Called when this bundle is stopped so the Framework can perform the bundle-specific activities necessary
+ * to stop the bundle. In general, this method should undo the work that the <code>bundleActivator_start()</code>
+ * function started. There should be no active threads that were started by this bundle when this bundle returns.
+ * A stopped bundle must not call any Framework objects.
+ *
+ * <p>
+ * This method must complete and return to its caller in a timely manner.
+ *
+ * @param userData The activator instance to be used.
+ * @param context The execution context of the bundle being stopped.
+ *
+ * @return Status code indication failure or success:
+ * - CELIX_SUCCESS when no errors are encountered.
+ * - Any other status code will mark the bundle as stopped and the framework will remove this
+ * bundle's listeners, unregister all services, and release all services used by this bundle.
+ */
+celix_status_t bundleActivator_stop(void * userData, BUNDLE_CONTEXT context);
+
+/**
+ * Called when this bundle is stopped so the bundle can destroy the instance of its activator. In general, this
+ * method should undo the work that the <code>bundleActivator_create()</code> function initialized.
+ *
+ * <p>
+ * This method must complete and return to its caller in a timely manner.
+ *
+ * @param userData The activator instance to be used.
+ * @param context The execution context of the bundle being stopped.
+ *
+ * @return Status code indication failure or success:
+ * - CELIX_SUCCESS when no errors are encountered.
+ * - Any other status code will mark the bundle as stopped and the framework will remove this
+ * bundle's listeners, unregister all services, and release all services used by this bundle.
+ */
+celix_status_t bundleActivator_destroy(void * userData, BUNDLE_CONTEXT context);
+
+#endif /* BUNDLE_ACTIVATOR_H_ */
+
+/**
+ * @}
+ */
Copied: incubator/celix/trunk/framework/public/include/bundle_archive.h (from r1229165, incubator/celix/trunk/framework/private/include/bundle_archive.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/bundle_archive.h?p2=incubator/celix/trunk/framework/public/include/bundle_archive.h&p1=incubator/celix/trunk/framework/private/include/bundle_archive.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
(empty)
Copied: incubator/celix/trunk/framework/public/include/bundle_context.h (from r1229165, incubator/celix/trunk/framework/private/include/bundle_context.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/bundle_context.h?p2=incubator/celix/trunk/framework/public/include/bundle_context.h&p1=incubator/celix/trunk/framework/private/include/bundle_context.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/bundle_context.h (original)
+++ incubator/celix/trunk/framework/public/include/bundle_context.h Thu Jan 12 13:29:03 2012
@@ -26,8 +26,17 @@
#ifndef BUNDLE_CONTEXT_H_
#define BUNDLE_CONTEXT_H_
-#include "headers.h"
+/**
+ * A bundle's execution context within the Framework. The context is used to
+ * grant access to other methods so that this bundle can interact with the
+ * Framework.
+ */
+typedef struct bundleContext *BUNDLE_CONTEXT;
+
#include "service_factory.h"
+#include "service_listener.h"
+#include "properties.h"
+#include "array_list.h"
celix_status_t bundleContext_create(FRAMEWORK framework, BUNDLE bundle, BUNDLE_CONTEXT *bundle_context);
celix_status_t bundleContext_destroy(BUNDLE_CONTEXT context);
Added: incubator/celix/trunk/framework/public/include/bundle_revision.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/bundle_revision.h?rev=1230520&view=auto
==============================================================================
--- incubator/celix/trunk/framework/public/include/bundle_revision.h (added)
+++ incubator/celix/trunk/framework/public/include/bundle_revision.h Thu Jan 12 13:29:03 2012
@@ -0,0 +1,105 @@
+/*
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements. See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership. The ASF licenses this file
+ *to you under the Apache License, Version 2.0 (the
+ *"License"); you may not use this file except in compliance
+ *with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *Unless required by applicable law or agreed to in writing,
+ *software distributed under the License is distributed on an
+ *"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ *specific language governing permissions and limitations
+ *under the License.
+ */
+/**
+ *
+ * @defgroup BundleRevision Bundle Revision
+ * @ingroup framework
+ * @{
+ *
+ * \author Alexander Broekhuis
+ * \date April 12, 2011
+ * \copyright Apache License, Version 2.0
+ */
+#ifndef BUNDLE_REVISION_H_
+#define BUNDLE_REVISION_H_
+
+#include <stdio.h>
+#include <apr_pools.h>
+
+#include "celix_errno.h"
+
+/**
+ * Typedef for BUNDLE_REVISION.
+ *
+ * A bundle revision represents the content of a bundle. A revision is associated with a bundle archive.
+ * An archive can have multiple revisions, each update of a bundle results in a new one.
+ *
+ * In a revision the content of a bundle (ZIP file) is extracted to a specified location inside the archive.
+ */
+typedef struct bundleRevision * BUNDLE_REVISION;
+
+/**
+ * Creates a new revision for the given inputFile or location.
+ * The location parameter is used to identify the bundle, in case of an update or download, the inputFile
+ * parameter can be used to point to the actual data. In the OSGi specification this is the inputstream.
+ *
+ * @param pool The pool on which this revision has to be allocated.
+ * @param root The root for this revision in which the bundle is extracted and state is stored.
+ * @param location The location associated with the revision
+ * @param revisionNr The number of the revision
+ * @param inputFile The (optional) location of the file to use as input for this revision
+ * @param[out] bundle_revision The output parameter for the created revision.
+ *
+ * @return Status code indication failure or success:
+ * - CELIX_SUCCESS when no errors are encountered.
+ * - CELIX_ENOMEM If allocating memory for <code>bundle_revision</code> failed.
+ */
+celix_status_t bundleRevision_create(apr_pool_t *pool, char *root, char *location, long revisionNr, char *inputFile, BUNDLE_REVISION *bundle_revision);
+
+/**
+ * Retrieves the revision number of the given revision.
+ *
+ * @param revision The revision to get the number for.
+ * @param[out] revisionNr The revision number.
+ *
+ * @return Status code indication failure or success:
+ * - CELIX_SUCCESS when no errors are encountered.
+ * - CELIX_ILLEGAL_ARGUMENT If <code>revision</code> is illegal.
+ */
+celix_status_t bundleRevision_getNumber(BUNDLE_REVISION revision, long *revisionNr);
+
+/**
+ * Retrieves the location of the given revision.
+ *
+ * @param revision The revision to get the location for.
+ * @param[out] location The location.
+ *
+ * @return Status code indication failure or success:
+ * - CELIX_SUCCESS when no errors are encountered.
+ * - CELIX_ILLEGAL_ARGUMENT If <code>revision</code> is illegal.
+ */
+celix_status_t bundleRevision_getLocation(BUNDLE_REVISION revision, char **location);
+
+/**
+ * Retrieves the root of the given revision.
+ *
+ * @param revision The revision to get the location for.
+ * @param[out] root The root.
+ *
+ * @return Status code indication failure or success:
+ * - CELIX_SUCCESS when no errors are encountered.
+ * - CELIX_ILLEGAL_ARGUMENT If <code>revision</code> is illegal.
+ */
+celix_status_t bundleRevision_getRoot(BUNDLE_REVISION revision, char **root);
+
+#endif /* BUNDLE_REVISION_H_ */
+
+/**
+ * @}
+ */
Copied: incubator/celix/trunk/framework/public/include/bundle_state.h (from r1229165, incubator/celix/trunk/framework/private/include/bundle_state.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/bundle_state.h?p2=incubator/celix/trunk/framework/public/include/bundle_state.h&p1=incubator/celix/trunk/framework/private/include/bundle_state.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
(empty)
Copied: incubator/celix/trunk/framework/public/include/capability.h (from r1229165, incubator/celix/trunk/framework/private/include/capability.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/capability.h?p2=incubator/celix/trunk/framework/public/include/capability.h&p1=incubator/celix/trunk/framework/private/include/capability.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/capability.h (original)
+++ incubator/celix/trunk/framework/public/include/capability.h Thu Jan 12 13:29:03 2012
@@ -26,10 +26,11 @@
#ifndef CAPABILITY_H_
#define CAPABILITY_H_
+typedef struct capability *CAPABILITY;
+
#include "hash_map.h"
#include "module.h"
-
celix_status_t capability_create(apr_pool_t *pool, MODULE module, HASH_MAP directives, HASH_MAP attributes, CAPABILITY *capability);
celix_status_t capability_getServiceName(CAPABILITY capability, char **serviceName);
celix_status_t capability_getVersion(CAPABILITY capability, VERSION *version);
Copied: incubator/celix/trunk/framework/public/include/celix_errno.h (from r1229165, incubator/celix/trunk/framework/private/include/celix_errno.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/celix_errno.h?p2=incubator/celix/trunk/framework/public/include/celix_errno.h&p1=incubator/celix/trunk/framework/private/include/celix_errno.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
(empty)
Added: incubator/celix/trunk/framework/public/include/celix_log.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/celix_log.h?rev=1230520&view=auto
==============================================================================
--- incubator/celix/trunk/framework/public/include/celix_log.h (added)
+++ incubator/celix/trunk/framework/public/include/celix_log.h Thu Jan 12 13:29:03 2012
@@ -0,0 +1,19 @@
+/*
+ * celix_log.h
+ *
+ * Created on: Jan 12, 2012
+ * Author: alexander
+ */
+
+#ifndef CELIX_LOG_H_
+#define CELIX_LOG_H_
+
+#include <stdio.h>
+
+#if defined(WIN32)
+#define celix_log(msg) printf("%s\n", msg);
+#else
+#define celix_log(msg) printf("%s\n\tat %s(%s:%d)\n", msg, __func__, __FILE__, __LINE__);
+#endif
+
+#endif /* CELIX_LOG_H_ */
Copied: incubator/celix/trunk/framework/public/include/celixbool.h (from r1229165, incubator/celix/trunk/framework/private/include/celixbool.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/celixbool.h?p2=incubator/celix/trunk/framework/public/include/celixbool.h&p1=incubator/celix/trunk/framework/private/include/celixbool.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
(empty)
Copied: incubator/celix/trunk/framework/public/include/constants.h (from r1229165, incubator/celix/trunk/framework/private/include/constants.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/constants.h?p2=incubator/celix/trunk/framework/public/include/constants.h&p1=incubator/celix/trunk/framework/private/include/constants.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
(empty)
Copied: incubator/celix/trunk/framework/public/include/filter.h (from r1229165, incubator/celix/trunk/framework/private/include/filter.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/filter.h?p2=incubator/celix/trunk/framework/public/include/filter.h&p1=incubator/celix/trunk/framework/private/include/filter.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/filter.h (original)
+++ incubator/celix/trunk/framework/public/include/filter.h Thu Jan 12 13:29:03 2012
@@ -26,6 +26,11 @@
#ifndef FILTER_H_
#define FILTER_H_
+#include <apr_general.h>
+
+#include "celix_errno.h"
+#include "properties.h"
+
typedef struct filter * FILTER;
FILTER filter_create(char * filterString, apr_pool_t *pool);
Copied: incubator/celix/trunk/framework/public/include/framework.h (from r1229165, incubator/celix/trunk/framework/private/include/framework.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/framework.h?p2=incubator/celix/trunk/framework/public/include/framework.h&p1=incubator/celix/trunk/framework/private/include/framework.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/framework.h (original)
+++ incubator/celix/trunk/framework/public/include/framework.h Thu Jan 12 13:29:03 2012
@@ -26,13 +26,19 @@
#ifndef FRAMEWORK_H_
#define FRAMEWORK_H_
-#include "headers.h"
+typedef struct activator * ACTIVATOR;
+typedef struct framework * FRAMEWORK;
+
#include "manifest.h"
#include "wire.h"
#include "hash_map.h"
#include "array_list.h"
#include "celix_errno.h"
#include "service_factory.h"
+#include "bundle_archive.h"
+#include "service_listener.h"
+#include "service_registration.h"
+#include "bundle_context.h"
celix_status_t framework_create(FRAMEWORK *framework, apr_pool_t *memoryPool, PROPERTIES config);
celix_status_t framework_destroy(FRAMEWORK framework);
@@ -84,4 +90,7 @@ ARRAY_LIST framework_getBundles(FRAMEWOR
BUNDLE framework_getBundle(FRAMEWORK framework, char * location);
BUNDLE framework_getBundleById(FRAMEWORK framework, long id);
+celix_status_t framework_getMemoryPool(FRAMEWORK framework, apr_pool_t **pool);
+celix_status_t framework_getFrameworkBundle(FRAMEWORK framework, BUNDLE *bundle);
+
#endif /* FRAMEWORK_H_ */
Modified: incubator/celix/trunk/framework/public/include/listener_hook_service.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/listener_hook_service.h?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/public/include/listener_hook_service.h (original)
+++ incubator/celix/trunk/framework/public/include/listener_hook_service.h Thu Jan 12 13:29:03 2012
@@ -8,11 +8,14 @@
#ifndef LISTENER_HOOK_SERVICE_H_
#define LISTENER_HOOK_SERVICE_H_
-#include "headers.h"
-
-#define listener_hook_service_name "listener_hook_service"
typedef struct listener_hook *listener_hook_t;
+typedef struct listener_hook_info *listener_hook_info_t;
+typedef struct listener_hook_service *listener_hook_service_t;
+
+#include "bundle_context.h"
+
+#define listener_hook_service_name "listener_hook_service"
struct listener_hook_info {
BUNDLE_CONTEXT context;
@@ -20,14 +23,10 @@ struct listener_hook_info {
bool removed;
};
-typedef struct listener_hook_info *listener_hook_info_t;
-
struct listener_hook_service {
void *handle;
celix_status_t (*added)(void *hook, ARRAY_LIST listeners);
celix_status_t (*removed)(void *hook, ARRAY_LIST listeners);
};
-typedef struct listener_hook_service *listener_hook_service_t;
-
#endif /* LISTENER_HOOK_SERVICE_H_ */
Copied: incubator/celix/trunk/framework/public/include/manifest.h (from r1229165, incubator/celix/trunk/framework/private/include/manifest.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/manifest.h?p2=incubator/celix/trunk/framework/public/include/manifest.h&p1=incubator/celix/trunk/framework/private/include/manifest.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
(empty)
Copied: incubator/celix/trunk/framework/public/include/module.h (from r1229165, incubator/celix/trunk/framework/private/include/module.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/module.h?p2=incubator/celix/trunk/framework/public/include/module.h&p1=incubator/celix/trunk/framework/private/include/module.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/module.h (original)
+++ incubator/celix/trunk/framework/public/include/module.h Thu Jan 12 13:29:03 2012
@@ -26,10 +26,14 @@
#ifndef MODULE_H_
#define MODULE_H_
+typedef struct module *MODULE;
+
#include "celixbool.h"
#include "linkedlist.h"
-#include "headers.h"
#include "manifest.h"
+#include "version.h"
+#include "array_list.h"
+#include "bundle.h"
MODULE module_create(MANIFEST headerMap, char * moduleId, BUNDLE bundle);
MODULE module_createFrameworkModule(BUNDLE bundle);
Copied: incubator/celix/trunk/framework/public/include/properties.h (from r1229165, incubator/celix/trunk/framework/private/include/properties.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/properties.h?p2=incubator/celix/trunk/framework/public/include/properties.h&p1=incubator/celix/trunk/framework/private/include/properties.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
(empty)
Copied: incubator/celix/trunk/framework/public/include/requirement.h (from r1229165, incubator/celix/trunk/framework/private/include/requirement.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/requirement.h?p2=incubator/celix/trunk/framework/public/include/requirement.h&p1=incubator/celix/trunk/framework/private/include/requirement.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/requirement.h (original)
+++ incubator/celix/trunk/framework/public/include/requirement.h Thu Jan 12 13:29:03 2012
@@ -26,15 +26,16 @@
#ifndef REQUIREMENT_H_
#define REQUIREMENT_H_
+typedef struct requirement *REQUIREMENT;
+
#include "capability.h"
#include "hash_map.h"
-#include "headers.h"
+#include "version_range.h"
-REQUIREMENT requirement_create(apr_pool_t *pool, HASH_MAP directives, HASH_MAP attributes);
-void requirement_destroy(REQUIREMENT requirement);
-VERSION_RANGE requirement_getVersionRange(REQUIREMENT requirement);
-char * requirement_getTargetName(REQUIREMENT requirement);
+celix_status_t requirement_create(apr_pool_t *pool, HASH_MAP directives, HASH_MAP attributes, REQUIREMENT *requirement);
+celix_status_t requirement_getVersionRange(REQUIREMENT requirement, VERSION_RANGE *range);
+celix_status_t requirement_getTargetName(REQUIREMENT requirement, char **targetName);
-bool requirement_isSatisfied(REQUIREMENT requirement, CAPABILITY capability);
+celix_status_t requirement_isSatisfied(REQUIREMENT requirement, CAPABILITY capability, bool *inRange);
#endif /* REQUIREMENT_H_ */
Copied: incubator/celix/trunk/framework/public/include/service_event.h (from r1229165, incubator/celix/trunk/framework/private/include/attribute.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/service_event.h?p2=incubator/celix/trunk/framework/public/include/service_event.h&p1=incubator/celix/trunk/framework/private/include/attribute.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/attribute.h (original)
+++ incubator/celix/trunk/framework/public/include/service_event.h Thu Jan 12 13:29:03 2012
@@ -1,4 +1,4 @@
-/**
+/*
*Licensed to the Apache Software Foundation (ASF) under one
*or more contributor license agreements. See the NOTICE file
*distributed with this work for additional information
@@ -16,26 +16,39 @@
*specific language governing permissions and limitations
*under the License.
*/
-/*
- * attribute.h
+/**
*
- * Created on: Jul 27, 2010
- * Author: alexanderb
+ * @defgroup ServiceListener Service Listener
+ * @ingroup framework
+ * @{
+ *
+ * \author Alexander Broekhuis
+ * \date January 11, 2012
+ * \copyright Apache License, Version 2.0
*/
+#ifndef SERVICE_EVENT_H_
+#define SERVICE_EVENT_H_
-#ifndef ATTRIBUTE_H_
-#define ATTRIBUTE_H_
+typedef enum serviceEventType SERVICE_EVENT_TYPE;
+typedef struct serviceEvent * SERVICE_EVENT;
-#include <apr_general.h>
-#include "celix_errno.h"
+#include "service_reference.h"
-struct attribute {
- char * key;
- char * value;
+enum serviceEventType
+{
+ REGISTERED = 0x00000001,
+ MODIFIED = 0x00000002,
+ UNREGISTERING = 0x00000004,
+ MODIFIED_ENDMATCH = 0x00000008,
};
-typedef struct attribute * ATTRIBUTE;
+struct serviceEvent {
+ SERVICE_REFERENCE reference;
+ SERVICE_EVENT_TYPE type;
+};
-celix_status_t attribute_create(char * key, char * value, apr_pool_t *memory_pool, ATTRIBUTE *attribute);
+#endif /* SERVICE_EVENT_H_ */
-#endif /* ATTRIBUTE_H_ */
+/**
+ * @}
+ */
Copied: incubator/celix/trunk/framework/public/include/service_factory.h (from r1229165, incubator/celix/trunk/framework/private/include/service_factory.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/service_factory.h?p2=incubator/celix/trunk/framework/public/include/service_factory.h&p1=incubator/celix/trunk/framework/private/include/service_factory.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/service_factory.h (original)
+++ incubator/celix/trunk/framework/public/include/service_factory.h Thu Jan 12 13:29:03 2012
@@ -28,8 +28,11 @@
#include <apr_general.h>
+typedef struct service_factory * service_factory_t;
+
#include "celix_errno.h"
-#include "headers.h"
+#include "service_registration.h"
+#include "bundle.h"
struct service_factory {
void *factory;
@@ -37,6 +40,5 @@ struct service_factory {
celix_status_t (*ungetService)(void *factory, BUNDLE bundle, SERVICE_REGISTRATION registration);
};
-typedef struct service_factory * service_factory_t;
#endif /* SERVICE_FACTORY_H_ */
Copied: incubator/celix/trunk/framework/public/include/service_listener.h (from r1229165, incubator/celix/trunk/framework/private/include/attribute.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/service_listener.h?p2=incubator/celix/trunk/framework/public/include/service_listener.h&p1=incubator/celix/trunk/framework/private/include/attribute.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/attribute.h (original)
+++ incubator/celix/trunk/framework/public/include/service_listener.h Thu Jan 12 13:29:03 2012
@@ -1,4 +1,4 @@
-/**
+/*
*Licensed to the Apache Software Foundation (ASF) under one
*or more contributor license agreements. See the NOTICE file
*distributed with this work for additional information
@@ -16,26 +16,36 @@
*specific language governing permissions and limitations
*under the License.
*/
-/*
- * attribute.h
+/**
+ *
+ * @defgroup ServiceListener Service Listener
+ * @ingroup framework
+ * @{
*
- * Created on: Jul 27, 2010
- * Author: alexanderb
+ * \author Alexander Broekhuis
+ * \date January 11, 2012
+ * \copyright Apache License, Version 2.0
*/
-
-#ifndef ATTRIBUTE_H_
-#define ATTRIBUTE_H_
+#ifndef SERVICE_LISTENER_H_
+#define SERVICE_LISTENER_H_
#include <apr_general.h>
+
+typedef struct serviceListener * SERVICE_LISTENER;
+
#include "celix_errno.h"
+#include "service_event.h"
-struct attribute {
- char * key;
- char * value;
+struct serviceListener {
+ apr_pool_t *pool;
+ void * handle;
+ celix_status_t (*serviceChanged)(void * listener, SERVICE_EVENT event);
};
-typedef struct attribute * ATTRIBUTE;
-celix_status_t attribute_create(char * key, char * value, apr_pool_t *memory_pool, ATTRIBUTE *attribute);
-#endif /* ATTRIBUTE_H_ */
+#endif /* SERVICE_LISTENER_H_ */
+
+/**
+ * @}
+ */
Copied: incubator/celix/trunk/framework/public/include/service_reference.h (from r1229165, incubator/celix/trunk/framework/private/include/service_reference.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/service_reference.h?p2=incubator/celix/trunk/framework/public/include/service_reference.h&p1=incubator/celix/trunk/framework/private/include/service_reference.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/service_reference.h (original)
+++ incubator/celix/trunk/framework/public/include/service_reference.h Thu Jan 12 13:29:03 2012
@@ -26,8 +26,12 @@
#ifndef SERVICE_REFERENCE_H_
#define SERVICE_REFERENCE_H_
+typedef struct serviceReference * SERVICE_REFERENCE;
+
#include "celixbool.h"
-#include "headers.h"
+#include "array_list.h"
+#include "service_registration.h"
+#include "bundle.h"
celix_status_t serviceReference_create(apr_pool_t *pool, BUNDLE bundle, SERVICE_REGISTRATION registration, SERVICE_REFERENCE *reference);
Copied: incubator/celix/trunk/framework/public/include/service_registration.h (from r1229165, incubator/celix/trunk/framework/private/include/service_registration.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/service_registration.h?p2=incubator/celix/trunk/framework/public/include/service_registration.h&p1=incubator/celix/trunk/framework/private/include/service_registration.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/service_registration.h (original)
+++ incubator/celix/trunk/framework/public/include/service_registration.h Thu Jan 12 13:29:03 2012
@@ -28,8 +28,11 @@
#include "celixbool.h"
-#include "headers.h"
+typedef struct serviceRegistration * SERVICE_REGISTRATION;
+
#include "service_registry.h"
+#include "array_list.h"
+#include "bundle.h"
SERVICE_REGISTRATION serviceRegistration_create(apr_pool_t *pool, SERVICE_REGISTRY registry, BUNDLE bundle, char * serviceName, long serviceId, void * serviceObject, PROPERTIES dictionary);
SERVICE_REGISTRATION serviceRegistration_createServiceFactory(apr_pool_t *pool, SERVICE_REGISTRY registry, BUNDLE bundle, char * serviceName, long serviceId, void * serviceObject, PROPERTIES dictionary);
@@ -41,4 +44,10 @@ celix_status_t serviceRegistration_unreg
celix_status_t serviceRegistration_getService(SERVICE_REGISTRATION registration, BUNDLE bundle, void **service);
+celix_status_t serviceRegistration_getProperties(SERVICE_REGISTRATION registration, PROPERTIES *properties);
+celix_status_t serviceRegistration_getRegistry(SERVICE_REGISTRATION registration, SERVICE_REGISTRY *registry);
+celix_status_t serviceRegistration_getServiceReferences(SERVICE_REGISTRATION registration, ARRAY_LIST *references);
+celix_status_t serviceRegistration_getBundle(SERVICE_REGISTRATION registration, BUNDLE *bundle);
+celix_status_t serviceRegistration_getServiceName(SERVICE_REGISTRATION registration, char **serviceName);
+
#endif /* SERVICE_REGISTRATION_H_ */
Copied: incubator/celix/trunk/framework/public/include/service_registry.h (from r1229165, incubator/celix/trunk/framework/private/include/service_registry.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/service_registry.h?p2=incubator/celix/trunk/framework/public/include/service_registry.h&p1=incubator/celix/trunk/framework/private/include/service_registry.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/service_registry.h (original)
+++ incubator/celix/trunk/framework/public/include/service_registry.h Thu Jan 12 13:29:03 2012
@@ -26,10 +26,16 @@
#ifndef SERVICE_REGISTRY_H_
#define SERVICE_REGISTRY_H_
-#include "headers.h"
+#include <apr_general.h>
+
+typedef struct serviceRegistry * SERVICE_REGISTRY;
+
#include "properties.h"
#include "filter.h"
#include "service_factory.h"
+#include "service_event.h"
+#include "array_list.h"
+#include "service_registration.h"
SERVICE_REGISTRY serviceRegistry_create(FRAMEWORK framework, void (*serviceChanged)(FRAMEWORK, SERVICE_EVENT_TYPE, SERVICE_REGISTRATION, PROPERTIES));
celix_status_t serviceRegistry_destroy(SERVICE_REGISTRY registry);
Copied: incubator/celix/trunk/framework/public/include/service_tracker.h (from r1229165, incubator/celix/trunk/framework/private/include/service_tracker.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/service_tracker.h?p2=incubator/celix/trunk/framework/public/include/service_tracker.h&p1=incubator/celix/trunk/framework/private/include/service_tracker.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/service_tracker.h (original)
+++ incubator/celix/trunk/framework/public/include/service_tracker.h Thu Jan 12 13:29:03 2012
@@ -26,7 +26,21 @@
#ifndef SERVICE_TRACKER_H_
#define SERVICE_TRACKER_H_
-#include "headers.h"
+#include "service_listener.h"
+#include "array_list.h"
+#include "bundle_context.h"
+
+struct serviceTrackerCustomizer {
+ void * handle;
+ celix_status_t (*addingService)(void * handle, SERVICE_REFERENCE reference, void **service);
+ celix_status_t (*addedService)(void * handle, SERVICE_REFERENCE reference, void * service);
+ celix_status_t (*modifiedService)(void * handle, SERVICE_REFERENCE reference, void * service);
+ celix_status_t (*removedService)(void * handle, SERVICE_REFERENCE reference, void * service);
+};
+
+typedef struct serviceTrackerCustomizer * SERVICE_TRACKER_CUSTOMIZER;
+
+typedef struct serviceTracker * SERVICE_TRACKER;
struct fwServiceTracker {
apr_pool_t *pool;
Copied: incubator/celix/trunk/framework/public/include/utils.h (from r1229165, incubator/celix/trunk/framework/private/include/utils.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/utils.h?p2=incubator/celix/trunk/framework/public/include/utils.h&p1=incubator/celix/trunk/framework/private/include/utils.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
(empty)
Copied: incubator/celix/trunk/framework/public/include/version.h (from r1229165, incubator/celix/trunk/framework/private/include/version.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/version.h?p2=incubator/celix/trunk/framework/public/include/version.h&p1=incubator/celix/trunk/framework/private/include/version.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/version.h (original)
+++ incubator/celix/trunk/framework/public/include/version.h Thu Jan 12 13:29:03 2012
@@ -61,7 +61,7 @@ typedef struct version * VERSION;
celix_status_t version_createVersion(apr_pool_t *pool, int major, int minor, int micro, char * qualifier, VERSION *version);
/**
- * Creates a clone of <code>version</version> allocated on <code>pool</code>.
+ * Creates a clone of <code>version</code> allocated on <code>pool</code>.
*
* @param version The version to clone
* @param pool The pool in which the clone must be allocated
@@ -134,14 +134,12 @@ celix_status_t version_createEmptyVersio
* major, minor and micro components are equal and the qualifier component
* is equal (using <code>String.compareTo</code>).
*
- * @param version The <code>VERSION</code> to be compared with <code>compare</null>.
- * @param compare The <code>VERSION</code> to be compared with <code>version</null>.
- * @param result A negative integer, zero, or a positive integer if <code>version</null> is
- * less than, equal to, or greater than the <code>compare</null>.
+ * @param version The <code>VERSION</code> to be compared with <code>compare</code>.
+ * @param compare The <code>VERSION</code> to be compared with <code>version</code>.
+ * @param result A negative integer, zero, or a positive integer if <code>version</code> is
+ * less than, equal to, or greater than the <code>compare</code>.
* @return Status code indication failure or success:
* - CELIX_SUCCESS when no errors are encountered.
- *
- * @return
*/
celix_status_t version_compareTo(VERSION version, VERSION compare, int *result);
Copied: incubator/celix/trunk/framework/public/include/version_range.h (from r1229165, incubator/celix/trunk/framework/private/include/version_range.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/version_range.h?p2=incubator/celix/trunk/framework/public/include/version_range.h&p1=incubator/celix/trunk/framework/private/include/version_range.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/version_range.h (original)
+++ incubator/celix/trunk/framework/public/include/version_range.h Thu Jan 12 13:29:03 2012
@@ -43,7 +43,7 @@
typedef struct versionRange * VERSION_RANGE;
/**
- * Creates a new <code>VERSION_RANGE>.
+ * Creates a new <code>VERSION_RANGE</code>.
*
* @param pool The pool in which the version range is created
* @param low Lower bound version
Copied: incubator/celix/trunk/framework/public/include/wire.h (from r1229165, incubator/celix/trunk/framework/private/include/wire.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/wire.h?p2=incubator/celix/trunk/framework/public/include/wire.h&p1=incubator/celix/trunk/framework/private/include/wire.h&r1=1229165&r2=1230520&rev=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/wire.h (original)
+++ incubator/celix/trunk/framework/public/include/wire.h Thu Jan 12 13:29:03 2012
@@ -26,11 +26,13 @@
#ifndef WIRE_H_
#define WIRE_H_
+typedef struct wire *WIRE;
+
#include "requirement.h"
#include "capability.h"
#include "module.h"
#include "linkedlist.h"
-#include "headers.h"
+#include "module.h"
/**
* @defgroup Version Version
@@ -88,7 +90,7 @@ celix_status_t wire_getImporter(WIRE wir
* Getter for the exporter of the wire.
*
* @param wire The wire to get the exporter from.
- * @param importer The exporting module.
+ * @param exporter The exporting module.
* @return Status code indication failure or success:
* - CELIX_SUCCESS when no errors are encountered.
*/
Modified: incubator/celix/trunk/launcher/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/launcher/CMakeLists.txt?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/launcher/CMakeLists.txt (original)
+++ incubator/celix/trunk/launcher/CMakeLists.txt Thu Jan 12 13:29:03 2012
@@ -19,5 +19,6 @@ add_executable(launcher launcher.c)
target_link_libraries(launcher framework)
include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+include_directories("${PROJECT_SOURCE_DIR}/framework/private/include")
install(TARGETS launcher RUNTIME DESTINATION bin COMPONENT framework)
\ No newline at end of file
Modified: incubator/celix/trunk/launcher/launcher.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/launcher/launcher.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/launcher/launcher.c (original)
+++ incubator/celix/trunk/launcher/launcher.c Thu Jan 12 13:29:03 2012
@@ -25,10 +25,10 @@
#include "framework.h"
#include "properties.h"
-#include "headers.h"
#include "bundle_context.h"
#include "bundle.h"
#include "linked_list_iterator.h"
+#include "celix_log.h"
void launcher_shutdown(int signal);
@@ -77,7 +77,9 @@ int main(void) {
ARRAY_LIST installed = NULL;
arrayList_create(pool, &installed);
BUNDLE_CONTEXT context = NULL;
- bundle_getContext(framework->bundle, &context);
+ BUNDLE bundle = NULL;
+ framework_getFrameworkBundle(framework, &bundle);
+ bundle_getContext(bundle, &context);
LINKED_LIST_ITERATOR iter = linkedListIterator_create(bundles, 0);
while (linkedListIterator_hasNext(iter)) {
BUNDLE current = NULL;
Modified: incubator/celix/trunk/log_service/private/include/log.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/log_service/private/include/log.h?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/log_service/private/include/log.h (original)
+++ incubator/celix/trunk/log_service/private/include/log.h Thu Jan 12 13:29:03 2012
@@ -27,7 +27,7 @@
#define LOG_H_
#include <apr_general.h>
-#include "headers.h"
+
#include "linkedlist.h"
#include "log_entry.h"
#include "log_listener.h"
Modified: incubator/celix/trunk/log_service/private/include/log_factory.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/log_service/private/include/log_factory.h?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/log_service/private/include/log_factory.h (original)
+++ incubator/celix/trunk/log_service/private/include/log_factory.h Thu Jan 12 13:29:03 2012
@@ -26,7 +26,6 @@
#ifndef LOG_FACTORY_H_
#define LOG_FACTORY_H_
-#include "headers.h"
#include "log.h"
typedef struct log_service_factory * log_service_factory_t;
Modified: incubator/celix/trunk/log_service/private/include/log_service_impl.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/log_service/private/include/log_service_impl.h?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/log_service/private/include/log_service_impl.h (original)
+++ incubator/celix/trunk/log_service/private/include/log_service_impl.h Thu Jan 12 13:29:03 2012
@@ -26,7 +26,6 @@
#ifndef LOG_SERVICE_IMPL_H_
#define LOG_SERVICE_IMPL_H_
-#include "headers.h"
#include "log_service.h"
#include "log.h"
Modified: incubator/celix/trunk/log_service/public/include/log_entry.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/log_service/public/include/log_entry.h?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/log_service/public/include/log_entry.h (original)
+++ incubator/celix/trunk/log_service/public/include/log_entry.h Thu Jan 12 13:29:03 2012
@@ -26,7 +26,6 @@
#ifndef LOG_ENTRY_H_
#define LOG_ENTRY_H_
-#include "headers.h"
#include "log_service.h"
struct log_entry {
Modified: incubator/celix/trunk/log_writer/log_writer.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/log_writer/log_writer.h?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/log_writer/log_writer.h (original)
+++ incubator/celix/trunk/log_writer/log_writer.h Thu Jan 12 13:29:03 2012
@@ -26,7 +26,6 @@
#ifndef LOG_WRITER_H_
#define LOG_WRITER_H_
-#include "headers.h"
#include "service_component.h"
#include "service_dependency.h"
#include "log_reader_service.h"
Modified: incubator/celix/trunk/remote_services/discovery/private/src/discovery.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/discovery/private/src/discovery.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/discovery/private/src/discovery.c (original)
+++ incubator/celix/trunk/remote_services/discovery/private/src/discovery.c Thu Jan 12 13:29:03 2012
@@ -10,13 +10,13 @@
#include <slp.h>
#include <unistd.h>
-#include "headers.h"
#include "bundle_context.h"
#include "array_list.h"
#include "utils.h"
#include "celix_errno.h"
#include "filter.h"
#include "service_reference.h"
+#include "service_registration.h"
#include "discovery.h"
@@ -155,7 +155,8 @@ celix_status_t discovery_addService(disc
SERVICE_REGISTRATION registration = NULL;
serviceReference_getServiceRegistration(reference, ®istration);
- PROPERTIES serviceProperties = registration->properties;
+ PROPERTIES serviceProperties = NULL;
+ serviceRegistration_getProperties(registration, &serviceProperties);
char *scope = properties_get(serviceProperties, (char *) ENDPOINT_LISTENER_SCOPE);
FILTER filter = filter_create(scope, discovery->pool);
if (filter_match(filter, endpoint->properties)) {
@@ -303,7 +304,8 @@ celix_status_t discovery_endpointListene
SERVICE_REGISTRATION registration = NULL;
serviceReference_getServiceRegistration(reference, ®istration);
- PROPERTIES serviceProperties = registration->properties;
+ PROPERTIES serviceProperties = NULL;
+ serviceRegistration_getProperties(registration, &serviceProperties);
char *discoveryListener = properties_get(serviceProperties, "DISCOVERY");
if (discoveryListener != NULL && strcmp(discoveryListener, "true") == 0) {
Modified: incubator/celix/trunk/remote_services/discovery/private/src/discovery_activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/discovery/private/src/discovery_activator.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/discovery/private/src/discovery_activator.c (original)
+++ incubator/celix/trunk/remote_services/discovery/private/src/discovery_activator.c Thu Jan 12 13:29:03 2012
@@ -11,7 +11,6 @@
#include <apr_strings.h>
#include <apr_uuid.h>
-#include "headers.h"
#include "bundle_activator.h"
#include "service_tracker.h"
#include "service_registration.h"
Modified: incubator/celix/trunk/remote_services/example_service/private/src/example_impl.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/example_service/private/src/example_impl.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/example_service/private/src/example_impl.c (original)
+++ incubator/celix/trunk/remote_services/example_service/private/src/example_impl.c Thu Jan 12 13:29:03 2012
@@ -6,7 +6,8 @@
*/
#include <math.h>
-#include "headers.h"
+#include <stdio.h>
+
#include "example_impl.h"
celix_status_t example_create(apr_pool_t *pool, example_t *example) {
Modified: incubator/celix/trunk/remote_services/remote_service_admin/private/include/export_registration_impl.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/remote_service_admin/private/include/export_registration_impl.h?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/remote_service_admin/private/include/export_registration_impl.h (original)
+++ incubator/celix/trunk/remote_services/remote_service_admin/private/include/export_registration_impl.h Thu Jan 12 13:29:03 2012
@@ -8,9 +8,9 @@
#ifndef EXPORT_REGISTRATION_IMPL_H_
#define EXPORT_REGISTRATION_IMPL_H_
-#include "headers.h"
#include "remote_service_admin.h"
#include "remote_endpoint.h"
+#include "service_tracker.h"
struct export_registration {
apr_pool_t *pool;
Modified: incubator/celix/trunk/remote_services/remote_service_admin/private/include/import_registration_impl.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/remote_service_admin/private/include/import_registration_impl.h?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/remote_service_admin/private/include/import_registration_impl.h (original)
+++ incubator/celix/trunk/remote_services/remote_service_admin/private/include/import_registration_impl.h Thu Jan 12 13:29:03 2012
@@ -8,9 +8,9 @@
#ifndef IMPORT_REGISTRATION_IMPL_H_
#define IMPORT_REGISTRATION_IMPL_H_
-#include "headers.h"
#include "remote_service_admin.h"
#include "remote_proxy.h"
+#include "service_tracker.h"
struct import_registration {
apr_pool_t *pool;
Modified: incubator/celix/trunk/remote_services/remote_service_admin/private/src/export_registration_impl.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/remote_service_admin/private/src/export_registration_impl.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/remote_service_admin/private/src/export_registration_impl.c (original)
+++ incubator/celix/trunk/remote_services/remote_service_admin/private/src/export_registration_impl.c Thu Jan 12 13:29:03 2012
@@ -8,7 +8,6 @@
#include <apr_strings.h>
-#include "headers.h"
#include "celix_errno.h"
#include "export_registration_impl.h"
@@ -17,6 +16,7 @@
#include "service_tracker.h"
#include "bundle_context.h"
#include "bundle.h"
+#include "celix_log.h"
celix_status_t exportRegistration_endpointAdding(void * handle, SERVICE_REFERENCE reference, void **service);
celix_status_t exportRegistration_endpointAdded(void * handle, SERVICE_REFERENCE reference, void *service);
Modified: incubator/celix/trunk/remote_services/remote_service_admin/private/src/import_registration_impl.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/remote_service_admin/private/src/import_registration_impl.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/remote_service_admin/private/src/import_registration_impl.c (original)
+++ incubator/celix/trunk/remote_services/remote_service_admin/private/src/import_registration_impl.c Thu Jan 12 13:29:03 2012
@@ -9,7 +9,6 @@
#include <apr_strings.h>
-#include "headers.h"
#include "celix_errno.h"
#include "import_registration_impl.h"
Modified: incubator/celix/trunk/remote_services/remote_service_admin/private/src/remote_service_admin_activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/remote_service_admin/private/src/remote_service_admin_activator.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/remote_service_admin/private/src/remote_service_admin_activator.c (original)
+++ incubator/celix/trunk/remote_services/remote_service_admin/private/src/remote_service_admin_activator.c Thu Jan 12 13:29:03 2012
@@ -6,7 +6,6 @@
*/
#include <stdlib.h>
-#include "headers.h"
#include "bundle_activator.h"
#include "service_registration.h"
Modified: incubator/celix/trunk/remote_services/remote_service_admin/private/src/remote_service_admin_impl.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/remote_service_admin/private/src/remote_service_admin_impl.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/remote_service_admin/private/src/remote_service_admin_impl.c (original)
+++ incubator/celix/trunk/remote_services/remote_service_admin/private/src/remote_service_admin_impl.c Thu Jan 12 13:29:03 2012
@@ -10,7 +10,6 @@
#include <apr_uuid.h>
#include <apr_strings.h>
-#include "headers.h"
#include "remote_service_admin_impl.h"
#include "export_registration_impl.h"
#include "import_registration_impl.h"
@@ -20,6 +19,7 @@
#include "bundle_context.h"
#include "bundle.h"
#include "service_reference.h"
+#include "service_registration.h"
static const char *ajax_reply_start =
"HTTP/1.1 200 OK\r\n"
@@ -139,7 +139,8 @@ celix_status_t remoteServiceAdmin_export
SERVICE_REGISTRATION registration = NULL;
serviceReference_getServiceRegistration(reference, ®istration);
- PROPERTIES serviceProperties = registration->properties;
+ PROPERTIES serviceProperties = NULL;
+ serviceRegistration_getProperties(registration, &serviceProperties);
char *exports = properties_get(serviceProperties, (char *) SERVICE_EXPORTED_INTERFACES);
char *provided = properties_get(serviceProperties, (char *) OBJECTCLASS);
@@ -196,11 +197,14 @@ celix_status_t remoteServiceAdmin_export
celix_status_t remoteServiceAdmin_installEndpoint(remote_service_admin_t admin, export_registration_t registration, SERVICE_REFERENCE reference, char *interface) {
celix_status_t status = CELIX_SUCCESS;
PROPERTIES endpointProperties = properties_create();
+ PROPERTIES serviceProperties = NULL;
SERVICE_REGISTRATION sRegistration = NULL;
serviceReference_getServiceRegistration(reference, &sRegistration);
- HASH_MAP_ITERATOR iter = hashMapIterator_create(sRegistration->properties);
+ serviceRegistration_getProperties(sRegistration, &serviceProperties);
+
+ HASH_MAP_ITERATOR iter = hashMapIterator_create(serviceProperties);
while (hashMapIterator_hasNext(iter)) {
HASH_MAP_ENTRY entry = hashMapIterator_nextEntry(iter);
char *key = (char *) hashMapEntry_getKey(entry);
@@ -218,7 +222,7 @@ celix_status_t remoteServiceAdmin_instal
properties_set(endpointProperties, (char *) SERVICE_LOCATION, apr_pstrdup(admin->pool, service));
endpoint_description_t endpointDescription = NULL;
- remoteServiceAdmin_createEndpointDescription(admin, sRegistration->properties, endpointProperties, interface, &endpointDescription);
+ remoteServiceAdmin_createEndpointDescription(admin, serviceProperties, endpointProperties, interface, &endpointDescription);
exportRegistration_setEndpointDescription(registration, endpointDescription);
return status;
Modified: incubator/celix/trunk/remote_services/remote_service_admin/public/include/remote_service_admin.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/remote_service_admin/public/include/remote_service_admin.h?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/remote_service_admin/public/include/remote_service_admin.h (original)
+++ incubator/celix/trunk/remote_services/remote_service_admin/public/include/remote_service_admin.h Thu Jan 12 13:29:03 2012
@@ -9,6 +9,7 @@
#define REMOTE_SERVICE_ADMIN_H_
#include "endpoint_listener.h"
+#include "service_reference.h"
#define REMOTE_SERVICE_ADMIN "remote_service_admin"
Modified: incubator/celix/trunk/remote_services/topology_manager/private/include/topology_manager.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/topology_manager/private/include/topology_manager.h?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/topology_manager/private/include/topology_manager.h (original)
+++ incubator/celix/trunk/remote_services/topology_manager/private/include/topology_manager.h Thu Jan 12 13:29:03 2012
@@ -9,6 +9,8 @@
#define TOPOLOGY_MANAGER_H_
#include "endpoint_listener.h"
+#include "service_reference.h"
+#include "bundle_context.h"
typedef struct topology_manager *topology_manager_t;
Modified: incubator/celix/trunk/remote_services/topology_manager/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/topology_manager/private/src/activator.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/topology_manager/private/src/activator.c (original)
+++ incubator/celix/trunk/remote_services/topology_manager/private/src/activator.c Thu Jan 12 13:29:03 2012
@@ -12,7 +12,6 @@
#include <apr_uuid.h>
#include "constants.h"
-#include "headers.h"
#include "bundle_activator.h"
#include "service_tracker.h"
#include "service_registration.h"
Modified: incubator/celix/trunk/remote_services/topology_manager/private/src/topology_manager.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/topology_manager/private/src/topology_manager.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/topology_manager/private/src/topology_manager.c (original)
+++ incubator/celix/trunk/remote_services/topology_manager/private/src/topology_manager.c Thu Jan 12 13:29:03 2012
@@ -10,7 +10,6 @@
#include <apr_uuid.h>
#include <apr_strings.h>
-#include "headers.h"
#include "topology_manager.h"
#include "bundle_context.h"
#include "constants.h"
@@ -22,6 +21,7 @@
#include "listener_hook_service.h"
#include "utils.h"
#include "service_reference.h"
+#include "service_registration.h"
struct topology_manager {
apr_pool_t *pool;
@@ -104,7 +104,8 @@ celix_status_t topologyManager_serviceCh
topology_manager_t manager = listen->handle;
SERVICE_REGISTRATION registration = NULL;
serviceReference_getServiceRegistration(event->reference, ®istration);
- PROPERTIES props = registration->properties;
+ PROPERTIES props = NULL;
+ serviceRegistration_getProperties(registration, &props);
char *name = properties_get(props, (char *) OBJECTCLASS);
char *export = properties_get(props, (char *) SERVICE_EXPORTED_INTERFACES);
@@ -201,7 +202,8 @@ celix_status_t topologyManager_notifyLis
SERVICE_REFERENCE eplRef = arrayList_get(endpointListeners, eplIt);
SERVICE_REGISTRATION registration = NULL;
serviceReference_getServiceRegistration(eplRef, ®istration);
- PROPERTIES props = registration->properties;
+ PROPERTIES props = NULL;
+ serviceRegistration_getProperties(registration, &props);
char *scope = properties_get(props, (char *) ENDPOINT_LISTENER_SCOPE);
FILTER filter = filter_create(scope, manager->pool);
endpoint_listener_t epl = NULL;
@@ -260,7 +262,8 @@ celix_status_t topologyManager_removeSer
SERVICE_REGISTRATION registration = NULL;
serviceReference_getServiceRegistration(reference, ®istration);
- PROPERTIES props = registration->properties;
+ PROPERTIES props = NULL;
+ serviceRegistration_getProperties(registration, &props);
char *name = properties_get(props, (char *) OBJECTCLASS);
printf("TOPOLOGY_MANAGER: Remove Service: %s.\n", name);
Modified: incubator/celix/trunk/shell/command_private.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/shell/command_private.h?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/shell/command_private.h (original)
+++ incubator/celix/trunk/shell/command_private.h Thu Jan 12 13:29:03 2012
@@ -27,7 +27,7 @@
#define COMMAND_PRIVATE_H_
#include "command.h"
-#include "headers.h"
+#include "bundle_context.h"
struct command {
char * name;
Modified: incubator/celix/trunk/shell/inspect_command.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/shell/inspect_command.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/shell/inspect_command.c (original)
+++ incubator/celix/trunk/shell/inspect_command.c Thu Jan 12 13:29:03 2012
@@ -135,9 +135,12 @@ celix_status_t inspectCommand_printExpor
for (j = 0; j < arrayList_size(refs); j++) {
SERVICE_REFERENCE ref = arrayList_get(refs, j);
SERVICE_REGISTRATION reg = NULL;
+ PROPERTIES props = NULL;
serviceReference_getServiceRegistration(ref, ®);
char line[256];
- char *objectClass = properties_get(reg->properties, (char *) OBJECTCLASS);
+
+ serviceRegistration_getProperties(reg, &props);
+ char *objectClass = properties_get(props, (char *) OBJECTCLASS);
sprintf(line, "ObjectClass = %s\n", objectClass);
out(line);
if ((j + 1) < arrayList_size(refs)) {
Modified: incubator/celix/trunk/shell/install_command.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/shell/install_command.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/shell/install_command.c (original)
+++ incubator/celix/trunk/shell/install_command.c Thu Jan 12 13:29:03 2012
@@ -65,7 +65,9 @@ void installCommand_execute(COMMAND comm
strcat(info, ", ");
}
long id;
- bundleArchive_getId(bundle_getArchive(bundle), &id);
+ BUNDLE_ARCHIVE archive = NULL;
+ bundle_getArchive(bundle, &archive);
+ bundleArchive_getId(archive, &id);
char bundleId[sizeof(id) + 1];
sprintf(bundleId, "%ld", id);
strcat(info, bundleId);
Modified: incubator/celix/trunk/shell/ps_command.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/shell/ps_command.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/shell/ps_command.c (original)
+++ incubator/celix/trunk/shell/ps_command.c Thu Jan 12 13:29:03 2012
@@ -82,8 +82,11 @@ void psCommand_execute(COMMAND command,
out(line);
for (i = 0; i < arrayList_size(bundles); i++) {
BUNDLE bundle = arrayList_get(bundles, i);
+ BUNDLE_ARCHIVE archive = NULL;
long id;
- bundleArchive_getId(bundle_getArchive(bundle), &id);
+
+ bundle_getArchive(bundle, &archive);
+ bundleArchive_getId(archive, &id);
BUNDLE_STATE state;
bundle_getState(bundle, &state);
char * stateString = psCommand_stateString(state);
@@ -92,11 +95,11 @@ void psCommand_execute(COMMAND command,
bundle_getCurrentModule(bundle, &module);
module_getSymbolicName(module, &name);
if (showLocation) {
- bundleArchive_getLocation(bundle_getArchive(bundle), &name);
+ bundleArchive_getLocation(archive, &name);
} else if (showSymbolicName) {
// do nothing
} else if (showUpdateLocation) {
- bundleArchive_getLocation(bundle_getArchive(bundle), &name);
+ bundleArchive_getLocation(archive, &name);
}
sprintf(line, " %-5ld %-12s %s\n", id, stateString, name);
Modified: incubator/celix/trunk/shell/shell.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/shell/shell.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/shell/shell.c (original)
+++ incubator/celix/trunk/shell/shell.c Thu Jan 12 13:29:03 2012
@@ -28,7 +28,6 @@
#include "shell_private.h"
#include "bundle_activator.h"
#include "command_private.h"
-#include "headers.h"
#include "bundle_context.h"
#include "service_registration.h"
Modified: incubator/celix/trunk/shell/shell.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/shell/shell.h?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/shell/shell.h (original)
+++ incubator/celix/trunk/shell/shell.h Thu Jan 12 13:29:03 2012
@@ -26,8 +26,8 @@
#ifndef SHELL_H_
#define SHELL_H_
-#include "headers.h"
#include "array_list.h"
+#include "service_reference.h"
static const char * const SHELL_SERVICE_NAME = "shellService";
Modified: incubator/celix/trunk/shell/shell_private.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/shell/shell_private.h?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/shell/shell_private.h (original)
+++ incubator/celix/trunk/shell/shell_private.h Thu Jan 12 13:29:03 2012
@@ -26,7 +26,6 @@
#ifndef SHELL_PRIVATE_H_
#define SHELL_PRIVATE_H_
-#include "headers.h"
#include "shell.h"
#include "hash_map.h"
#include "command.h"
Modified: incubator/celix/trunk/shell/update_command.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/shell/update_command.c?rev=1230520&r1=1230519&r2=1230520&view=diff
==============================================================================
--- incubator/celix/trunk/shell/update_command.c (original)
+++ incubator/celix/trunk/shell/update_command.c Thu Jan 12 13:29:03 2012
@@ -33,7 +33,6 @@
#include "bundle_context.h"
#include "bundle.h"
#include "update_command.h"
-#include "inputstream.h"
void updateCommand_execute(COMMAND command, char * line, void (*out)(char *), void (*err)(char *));
celix_status_t updateCommand_download(COMMAND command, char * url, char **inputFile);