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

0

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

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

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
1

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

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

Follow
2 followers

Stats

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

Seen: 252 times

Last updated: Jul 25 '14