View MessageController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gwt.user.server; | |
import org.jboss.errai.bus.client.api.base.MessageBuilder; | |
import org.jboss.errai.bus.client.api.messaging.Message; | |
import org.jboss.errai.bus.client.api.messaging.MessageCallback; | |
import org.jboss.errai.bus.client.api.messaging.RequestDispatcher; | |
import org.jboss.errai.bus.server.annotations.Service; | |
import com.google.inject.Inject; | |
@Service | |
public class MessageController implements MessageCallback { |
View ClientService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private RequestDispatcher dispatcher = ErraiBus.getDispatcher(); | |
private MessageBus bus = ErraiBus.get(); |
View ClientService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MessageBuilder.createMessage() | |
.toSubject("MessageController") | |
.signalling() | |
.noErrorHandling() | |
.sendNowWith(getDispatcher()); |
View ClientService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bus.subscribe("ClientService", new MessageCallback() { | |
public void callback(Message message) { | |
Window.alert("ClientService message is received. " + message.get(String.class, "text")); | |
} | |
}); |
View gwtErraiMessaging.gwt.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<inherits name='org.jboss.errai.bus.ErraiBus' /> |
View web.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<servlet> | |
<servlet-name>ErraiServlet</servlet-name> | |
<servlet-class>org.jboss.errai.bus.server.servlet.DefaultBlockingServlet</servlet-class> | |
<init-param> | |
<param-name>auto-discover-services</param-name> | |
<param-value>true</param-value> | |
</init-param> | |
<load-on-startup>1</load-on-startup> | |
</servlet> | |
<servlet-mapping> |
View ErraiApp.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Request dispatcher implementation (default is SimpleDispatcher) | |
# | |
errai.dispatcher_implementation=org.jboss.errai.bus.server.SimpleDispatcher |
View web.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<context-param> | |
<param-name>ErraiApp.properties</param-name> | |
<param-value>WEB_INF/ErraiApp.properties</param-value> | |
</context-param> |
View MessageController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ErraiService<?> service = ErraiServiceSingleton.getService(); | |
this.bus = service.getBus(); |
View MessageController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gwt.user.server; | |
import org.jboss.errai.bus.client.api.base.MessageBuilder; | |
import org.jboss.errai.bus.client.api.messaging.Message; | |
import org.jboss.errai.bus.client.api.messaging.MessageBus; | |
import org.jboss.errai.bus.client.api.messaging.MessageCallback; | |
import org.jboss.errai.bus.server.annotations.Service; | |
import org.jboss.errai.bus.server.service.ErraiService; | |
import org.jboss.errai.bus.server.service.ErraiServiceSingleton; | |
@Service |
OlderNewer