Example usage for org.apache.wicket Application get

List of usage examples for org.apache.wicket Application get

Introduction

In this page you can find the example usage for org.apache.wicket Application get.

Prototype

public static Application get() 

Source Link

Document

Get Application for current thread.

Usage

From source file:org.wicketstuff.whiteboard.WhiteboardBehavior.java

License:Apache License

/**
 * Load the clipArts list from the clipArt folder and synchronizing the list between whiteboard clients
 *///from   w w  w .j a v a2s  .  c o  m
private void handleClipArts() {
    loadClipArts();
    IWebSocketConnectionRegistry reg = WebSocketSettings.Holder.get(Application.get()).getConnectionRegistry();
    for (IWebSocketConnection c : reg.getConnections(Application.get())) {
        try {
            JSONArray jsonArray = new JSONArray();
            for (String clipArtURL : clipArts) {
                jsonArray.put(clipArtURL);
            }
            c.sendMessage(getClipArtListMessage(jsonArray).toString());
        } catch (Exception e) {
            log.error("Unexpected error while sending message through the web socket", e);
        }
    }
}