You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by er...@apache.org on 2018/02/06 20:24:53 UTC

celix git commit: PubSub serializer selection: if only one is available, use this one

Repository: celix
Updated Branches:
  refs/heads/develop 4b8222dc1 -> 008b4f103


PubSub serializer selection: if only one is available, use this one


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/008b4f10
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/008b4f10
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/008b4f10

Branch: refs/heads/develop
Commit: 008b4f103162ccca75bf585735f4feb855a64cc2
Parents: 4b8222d
Author: Erjan Altena <er...@gmail.com>
Authored: Tue Feb 6 21:24:38 2018 +0100
Committer: Erjan Altena <er...@gmail.com>
Committed: Tue Feb 6 21:24:38 2018 +0100

----------------------------------------------------------------------
 pubsub/pubsub_spi/src/pubsub_admin_match.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/008b4f10/pubsub/pubsub_spi/src/pubsub_admin_match.c
----------------------------------------------------------------------
diff --git a/pubsub/pubsub_spi/src/pubsub_admin_match.c b/pubsub/pubsub_spi/src/pubsub_admin_match.c
index 2a695c1..cfe1dad 100644
--- a/pubsub/pubsub_spi/src/pubsub_admin_match.c
+++ b/pubsub/pubsub_spi/src/pubsub_admin_match.c
@@ -189,7 +189,17 @@ celix_status_t pubsub_admin_get_best_serializer(properties_pt endpoint_props, ar
 	void *svc = NULL;
 
 	/* Analyze the serializers */
-	if(requested_serializer_type != NULL){ /* We got precise specification on the serializer we want */
+	if (arrayList_size(serializerList) == 1) {
+		// Only one serializer, use this one
+		svcRef = (service_reference_pt)arrayList_get(serializerList,0);
+		manage_service_from_reference(svcRef, &svc, true);
+		*serSvc = svc;
+		char *serializer_type = NULL;
+		get_serializer_type(svcRef, &serializer_type);
+		printf("Selected the only serializer available. Type = %s\n", serializer_type);
+
+	}
+	else if(requested_serializer_type != NULL){ /* We got precise specification on the serializer we want */
 		for(i=0;i<arrayList_size(serializerList);i++){
 			svcRef = (service_reference_pt)arrayList_get(serializerList,i);
 			char *serializer_type = NULL;