Receives an {@link ObjectMessage} (it can be an event or a command) and sends it to his {@link BusConsumer}
This is the bus hook for any {@link BusConsumer} that should register itself in this listener. @author Freedomotic Team @see BusConsumer
171172173174175176177178179180181
// Initialize bus here! busService = INJECTOR.getInstance(BusService.class); busService.init(); // register listener this.listener = new BusMessagesListener(this); // this class is a BusConsumer too // listen for exit signal (an event) and call onExit method if received listener.consumeEventFrom("app.event.system.exit"); // Stop on initialization error.
65666768697071
register(); setAsNotPollingSensor(); } private void register() { listener = new BusMessagesListener(this); }
6465666768697071
// } this.busService = Freedomotic.INJECTOR.getInstance(BusService.class); } private void register() { listener = new BusMessagesListener(this); listener.consumeCommandFrom(listenMessagesOn()); }
8283848586878889
/** * Register one or more channels to listen to */ private void register() { listener = new BusMessagesListener(this); listener.consumeCommandFrom(getMessagingChannel()); }
6768697071727374
6869707172737475
this.busService = Freedomotic.INJECTOR.getInstance(BusService.class); register(); } private void register() { listener = new BusMessagesListener(this); listener.consumeCommandFrom(getCommandsChannelToListen()); }
70717273747576
/** * Register one or more channels to listen to */ private void register() { listener = new BusMessagesListener(this); listener.consumeCommandFrom(getMessagingChannel());}
7273747576777879808182
} public void register() { LOG.info("Registering the trigger named '" + getName() + "'"); listener = new BusMessagesListener(this); listener.consumeEventFrom(channel); numberOfExecutions = 0; suspensionStart = System.currentTimeMillis(); Freedomotic.INJECTOR.injectMembers(this); }