Skip to content

Commit

Permalink
Rename the application class
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-g committed Jun 20, 2012
1 parent 142fe22 commit 9e4ea25
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Expand Up @@ -2,10 +2,16 @@ package org.apache.wicket.websocket.jetty.example

import org.apache.wicket.protocol.http.WebApplication

object NativeWebSocketExampleApplication
{
def get = WebApplication.get().asInstanceOf[NativeWebSocketExampleApplication]
}

/**
*
* The application class that setups the event system that pushes messages
* to the connected clients
*/
class WicketApplication extends WebApplication
class NativeWebSocketExampleApplication extends WebApplication
{
var eventSystem : EventSystem = _

Expand All @@ -25,9 +31,5 @@ class WicketApplication extends WebApplication
def getEventSystem = eventSystem
}

object WicketApplication
{
def get = WebApplication.get().asInstanceOf[WicketApplication]
}


Expand Up @@ -26,7 +26,7 @@ class WebSocketDemo extends WebPage {
val sessionId = message.getSessionId
val pageId = message.getPageId
// register in the global registry. Optional
WicketApplication.get.getEventSystem.clientConnected(application.getName, sessionId, pageId)
NativeWebSocketExampleApplication.get.getEventSystem.clientConnected(application.getName, sessionId, pageId)
}

protected override def onClose(message: ClosedMessage)
Expand All @@ -35,7 +35,7 @@ class WebSocketDemo extends WebPage {
val sessionId = message.getSessionId
val pageId = message.getPageId
// unregister in the global registry. Optional
WicketApplication.get.getEventSystem.clientDisconnected(application.getName, sessionId, pageId)
NativeWebSocketExampleApplication.get.getEventSystem.clientDisconnected(application.getName, sessionId, pageId)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/web.xml
Expand Up @@ -13,7 +13,7 @@
<!--<filter-class>org.apache.wicket.protocol.http.Tomcat7WebSocketFilter</filter-class>-->
<init-param>
<param-name>applicationClassName</param-name>
<param-value>org.apache.wicket.websocket.jetty.example.WicketApplication</param-value>
<param-value>org.apache.wicket.websocket.jetty.example.NativeWebSocketExampleApplication</param-value>
</init-param>
</filter>

Expand Down

0 comments on commit 9e4ea25

Please sign in to comment.