Search in sources :

Example 1 with WebSocketHostObject

use of org.jaggeryjs.hostobjects.web.WebSocketHostObject in project jaggery by wso2.

the class JaggeryWebSocketServlet method doGet.

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    try {
        CommonManager.getInstance().getEngine().enterContext();
    } catch (ScriptException e) {
        log.error(e.getMessage(), e);
        throw new ServletException(e);
    }
    WebAppManager.execute(request, response);
    JaggeryContext context = CommonManager.getJaggeryContext();
    Scriptable scope = context.getScope();
    wsMessageInBound = new WSMessageInBound((WebSocketHostObject) scope.get("webSocket", scope));
    RhinoEngine.exitContext();
    super.doGet(request, response);
}
Also used : ServletException(javax.servlet.ServletException) ScriptException(org.jaggeryjs.scriptengine.exceptions.ScriptException) WebSocketHostObject(org.jaggeryjs.hostobjects.web.WebSocketHostObject) JaggeryContext(org.jaggeryjs.scriptengine.engine.JaggeryContext) Scriptable(org.mozilla.javascript.Scriptable)

Aggregations

ServletException (javax.servlet.ServletException)1 WebSocketHostObject (org.jaggeryjs.hostobjects.web.WebSocketHostObject)1 JaggeryContext (org.jaggeryjs.scriptengine.engine.JaggeryContext)1 ScriptException (org.jaggeryjs.scriptengine.exceptions.ScriptException)1 Scriptable (org.mozilla.javascript.Scriptable)1