Package de.novanic.gwteventservice.demo.hello.client.event

Examples of de.novanic.gwteventservice.demo.hello.client.event.ServerGeneratedMessageEvent


    private class ServerMessageGeneratorTimerTask extends TimerTask
    {
        public void run() {
            final String theEventMessage = "GWTEventService is greeting everybody with \"Hello\" at " + getCurrentTimeFormatted() + " (and every five seconds again)! :-)";
            //create the event
            Event theEvent = new ServerGeneratedMessageEvent(theEventMessage);
            //add the event, so clients can receive it
            addEvent(ServerGeneratedMessageEvent.SERVER_MESSAGE_DOMAIN, theEvent);
        }
View Full Code Here


        RemoteEventService theRemoteEventService = RemoteEventServiceFactory.getInstance().getRemoteEventService();
        //add a listener to the SERVER_MESSAGE_DOMAIN
        theRemoteEventService.addListener(ServerGeneratedMessageEvent.SERVER_MESSAGE_DOMAIN, new RemoteEventListener() {
            public void apply(Event anEvent) {
                if(anEvent instanceof ServerGeneratedMessageEvent) {
                    ServerGeneratedMessageEvent theServerGeneratedMessageEvent = (ServerGeneratedMessageEvent)anEvent;
                    myEventReceiveBoxUI.addItem(theServerGeneratedMessageEvent.getServerGeneratedMessage());
                }
            }
        });

        /* Logic for GWTEventService ends here */
 
View Full Code Here

TOP

Related Classes of de.novanic.gwteventservice.demo.hello.client.event.ServerGeneratedMessageEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.