Search in sources :

Example 1 with DefaultWebSocketProcessor

use of org.atmosphere.websocket.DefaultWebSocketProcessor in project atmosphere by Atmosphere.

the class WebSocketProcessorFactory method createProcessor.

private WebSocketProcessor createProcessor(AtmosphereFramework framework) {
    WebSocketProcessor processor = null;
    String webSocketProcessorName = framework.getWebSocketProcessorClassName();
    if (!webSocketProcessorName.equalsIgnoreCase(DefaultWebSocketProcessor.class.getName())) {
        try {
            processor = framework.newClassInstance(WebSocketProcessor.class, (Class<WebSocketProcessor>) IOUtils.loadClass(getClass(), webSocketProcessorName));
        } catch (Exception ex) {
            logger.error("Unable to create {}", webSocketProcessorName);
            processor = new DefaultWebSocketProcessor();
        }
    }
    if (processor == null) {
        processor = new DefaultWebSocketProcessor();
    }
    processor.configure(framework.getAtmosphereConfig());
    return processor;
}
Also used : DefaultWebSocketProcessor(org.atmosphere.websocket.DefaultWebSocketProcessor) DefaultWebSocketProcessor(org.atmosphere.websocket.DefaultWebSocketProcessor) WebSocketProcessor(org.atmosphere.websocket.WebSocketProcessor)

Aggregations

DefaultWebSocketProcessor (org.atmosphere.websocket.DefaultWebSocketProcessor)1 WebSocketProcessor (org.atmosphere.websocket.WebSocketProcessor)1