Search in sources :

Example 1 with ChartWebSocketResource

use of org.apache.wicket.examples.websocket.charts.ChartWebSocketResource in project wicket by apache.

the class JSR356Application method init.

@Override
public void init() {
    super.init();
    scheduledExecutorService = Executors.newScheduledThreadPool(1);
    setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig(8080, 8443)));
    mountPage("/behavior", WebSocketBehaviorDemoPage.class);
    mountPage("/resource", WebSocketResourceDemoPage.class);
    getSharedResources().add(ChartWebSocketResource.NAME, new ChartWebSocketResource());
    if (System.getenv("OPENSHIFT_APP_NAME") != null) {
        // OpenShift uses special proxy for WebSocket connections
        // https://blog.openshift.com/paas-websockets/
        final WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(this);
        webSocketSettings.setPort(8000);
        webSocketSettings.setSecurePort(8443);
    }
}
Also used : HttpsMapper(org.apache.wicket.protocol.https.HttpsMapper) WebSocketSettings(org.apache.wicket.protocol.ws.WebSocketSettings) HttpsConfig(org.apache.wicket.protocol.https.HttpsConfig) ChartWebSocketResource(org.apache.wicket.examples.websocket.charts.ChartWebSocketResource)

Aggregations

ChartWebSocketResource (org.apache.wicket.examples.websocket.charts.ChartWebSocketResource)1 HttpsConfig (org.apache.wicket.protocol.https.HttpsConfig)1 HttpsMapper (org.apache.wicket.protocol.https.HttpsMapper)1 WebSocketSettings (org.apache.wicket.protocol.ws.WebSocketSettings)1