Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


OSGi service listed in OSGi console but ServiceHelper is not successfully retrieving it

asked 2014-07-09 20:25:25 -0700

CobyS gravatar image

Anyone have any ideas of what might be causing this. The function prototype is:

ServiceHelper.getInstance(Class clazz, String containerName, Object bundle)

Here are my parameters: MyInterface = The name of my interface as listed by the OSGi container services command. "consumerService" = The 'name' portion as listed by the OSGi container services command. this = the calling object(which is in the bundle).

ServiceHelper.getInstance( MyInterface.class, "consumerService", this)

The above call returns null. Is there something I am missing here?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-07-25 17:29:29 -0700

Madhu gravatar image

The ContainerName parameter in ServiceHelper.getInstance is the name of OpenDaylight Container. OpenDaylight Container is a special entity that can be created for a special isolation use-case.

So, if you are not using Containers, then, depending on the type of your service, either you have to use ServiceHelper.getInstance( MyInterface.class, "default", this) or ServiceHelper.getGlobalInstance(MyInterface.class, this)

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools



Asked: 2014-07-09 20:25:25 -0700

Seen: 350 times

Last updated: Jul 25 '14