problem with registerSignalHandlers()

asked 2014-08-26 21:47:51 -0700

qieman gravatar image

In the Java SDK Guide, To register signal handler, it just defines a handler method and annotated it , and then call registerSignalHandlers(instance of the class that defines the handler method). But this doesn't work for me. When I try to do these steps, the registerSigalHandlers method returns BUS_NO_SUCH_INTERFACE error. Now I solve the problem after reading the sample code. I found we must call registerBusObject(instance of a class that implements the BusInterface that contains the signals we want to handle) before calling registerSigalHandlers. This seems strange to me, as the BusObject I register just does nothing. Does it necessary to register such a BusObject before calling registerSiganlHandlers()?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-08-27 10:56:27 -0700

Nikhil Dabhade gravatar image

Hi qieman,

In AllJoyn terminology a signal or a method call is always a part on an interface. An interface in AllJoyn or in most systems is useful when it is implemented by an object. The object in this case becomes our BusObject. On the side receiving a signal one could think that why do I need a bus object. The reason is the signal you receive is still a part of an interface. We do not have any generic signal emitter or receiver concept. Since it is a part of an interface a bus object needs to handle it. The signal handler for it will thus is a part of the bus object that understands the interface to which the signal belongs.

A BusObject needs to be registered before you start the bus. If you call registerSignalHandler before calling register bus object the bus may not recognize which bus object are you referring to. Thus the sequence holds.

Let me know if something was not clear.

Regards, Nikhil

edit flag offensive delete publish link more


Hi Nikhil, Many thanks. I understand it now. But I think it's just better to add this step in "Using Alljoyn Signals" section in the pdf "guide_to_aj_dev_using_java_sdk.pdf",

qieman ( 2014-08-27 17:50:29 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-08-26 21:47:51 -0700

Seen: 179 times

Last updated: Aug 27 '14