realization of Signal-Slot paradigm for Vaadin
Signal-Slot-Custom component for Vaadin
This is realization of Signal-Slot paradigm for Vaadin, it's entry signal bus to application. Signal's may generated anywhere for 3 scope: Local - only for current instants Application - for current UI (thread) Deployment - for all UI in current container Server - for JMX propagation
Also intoduce some CDI as @Resource(lookup="JNDI") implementation
To work with this:
- Add this add-on to project
- Make own superclass of SigSlotComponent.
Here is trivial chat application widget with signal-slot (as included in demo project) @Push public class Chat extends SigSlotComponent { private String name = null; private TextField query = new TextField();
@Signal("sendtext")
public Button send = new Button("send");
private VerticalLayout text = new VerticalLayout(query,send);
@Slot("sendtext") public void send(Object o) { if (name == null) name = query.getValue(); else signal(SignalScope.Deployment, "chatmessage", name + ":" + query.getValue()); query.setValue(""); }
@Slot(value = "chatmessage", scope = SignalScope.Deployment)
public void receiver(String message) {
text.addComponent(new Label(message), text.getComponentIndex(query));
}
public Chat() {
setCompositionRoot(text);
}
}
Install
- add JMX support for Server scope signal distribution
- add @Resource(lookup="JNDI") annotation (replace CDI)