I am trying to create an application witch will announce the signal through all the bus. The idea that you do not need to connect to particular object in the bus. I saw that interfaces could be Introspectable, but as I found this interfaces automatically added to bus object when it is registering on bus. So the question is how to make signal visible in the bus.
Interface:
@BusInterface(name = Door.DOOR_INTF_NAME, announced = "true")
public interface Door {
String DOOR_INTF_NAME = "com.example.Door";
String PERSON_PASSED_THROUGH = "PersonPassedThrough";
@BusSignal(name = PERSON_PASSED_THROUGH, sessionless = true)
void personPassedThrough(String person) throws BusException;
}
publushing:
private void doRegisterBusObject(Object obj) {
LocatableBusObject object = (LocatableBusObject) obj;
String location = object.getBusObjectLocation();
if (!location.startsWith("/")) {
location = "/" + location;
}
// Register the object on the local bus
Status status = bus.registerBusObject(object, location);
if (Status.OK != status) {
return;
}
// Have About send a signal a new door is available.
aboutObj.announce(CONTACT_PORT, aboutData);
}
The object is visible, but signal is not.
Basically, the interface org.allseen.Introspectable is added by the router, only in case when we announce description for the @BusInterface.
Until then, we will not have this interface.