Package org.jabsorb

Examples of org.jabsorb.JSONRPCBridge$MethodCandidate


      disableBackService(session);
    }
  }

  private void enableBackService(HttpSession session) {
    JSONRPCBridge bridge = getJSONRPCBridge(session);
    getBackService().register(bridge);
  }
View Full Code Here


    JSONRPCBridge bridge = getJSONRPCBridge(session);
    getBackService().register(bridge);
  }

  private void enableFrontService(HttpSession session) {
    JSONRPCBridge bridge = getJSONRPCBridge(session);
    getFrontService().register(bridge);
  }
View Full Code Here

    JSONRPCBridge bridge = getJSONRPCBridge(session);
    getFrontService().register(bridge);
  }
 
  private void disableBackService(HttpSession session) {
    JSONRPCBridge bridge = getJSONRPCBridge(session);
    getBackService().unregister(bridge);
  }
View Full Code Here

    JSONRPCBridge bridge = getJSONRPCBridge(session);
    getBackService().unregister(bridge);
  }

  private void disableFrontService(HttpSession session) {
    JSONRPCBridge bridge = getJSONRPCBridge(session);
    getFrontService().unregister(bridge);
  }
View Full Code Here

    getFrontService().unregister(bridge);
  }

  private JSONRPCBridge getJSONRPCBridge(HttpSession session) {
    if (session.getAttribute("JSONRPCBridge") == null) {
      session.setAttribute("JSONRPCBridge", new JSONRPCBridge());
    }
    return (JSONRPCBridge) session.getAttribute("JSONRPCBridge");
  }
View Full Code Here

         * Create a new bridge for every request to avoid all the problems with
         * JSON-RPC-Java storing the bridge in the session
         */
        HttpSession session = request.getSession();

        JSONRPCBridge jsonrpcBridge = new JSONRPCBridge();
        jsonrpcBridge.registerObject("Service", serviceInstance, serviceInterface);
        session.setAttribute("JSONRPCBridge", jsonrpcBridge);

        org.json.JSONObject jsonReq = null;
        JSONRPCResult jsonResp = null;
        jsonReq = new org.json.JSONObject(requestData);

        String method = jsonReq.getString("method");
        if ((method != null) && (method.indexOf('.') < 0)) {
            jsonReq.putOpt("method", "Service" + "." + method);
        }

        // invoke the request
        jsonResp = jsonrpcBridge.call(new Object[] {request}, jsonReq);

        return jsonResp.toString().getBytes("UTF-8");
    }
View Full Code Here

         * Create a new bridge for every request to avoid all the problems with
         * JSON-RPC-Java storing the bridge in the session
         */
        HttpSession session = request.getSession();

        JSONRPCBridge jsonrpcBridge = new JSONRPCBridge();
        jsonrpcBridge.registerObject("Service", serviceInstance, serviceInterface);
        session.setAttribute("JSONRPCBridge", jsonrpcBridge);
       
        org.json.JSONObject jsonReq = null;
        JSONRPCResult jsonResp = null;
        jsonReq = new org.json.JSONObject(requestData);

        String method = jsonReq.getString("method");
        if ((method != null) && (method.indexOf('.') < 0)) {
            jsonReq.putOpt("method", "Service" + "." + method);
        }

        // invoke the request
        jsonResp = jsonrpcBridge.call(new Object[] {request}, jsonReq);

        return jsonResp.toString().getBytes("UTF-8");
    }
View Full Code Here

    /**
     * Registers remote JavaScript service serializers.
     */
    private void registerRemoteJSServiceSerializers() {
        final JSONRPCBridge jsonRpcBridge = JSONRPCBridge.getGlobalBridge();

        try {
            jsonRpcBridge.registerSerializer(new StatusCodesSerializer());
        } catch (final Exception e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            throw new IllegalStateException(e);
        }
    }
View Full Code Here

        }

        // Set the location and server
        this.location = "http://" + servername + ":" + port;
        this.server = new Server(port);
        this.bridge = new JSONRPCBridge(); //JSONRPCBridge.getGlobalBridge();

        // Create context and our specially hacked jsonrpc servlet.
        final Context context = new Context(this.server, "/", Context.SESSIONS);
        final JSONRPCServlet servlet = new JSONRPCServlet() {
            /**   */
 
View Full Code Here

         * Create a new bridge for every request to avoid all the problems with
         * JSON-RPC-Java storing the bridge in the session
         */
        HttpSession session = request.getSession();

        JSONRPCBridge jsonrpcBridge = new JSONRPCBridge();
        jsonrpcBridge.registerObject("Service", serviceInstance, serviceInterface);
        session.setAttribute("JSONRPCBridge", jsonrpcBridge);

        org.json.JSONObject jsonReq = null;
        JSONRPCResult jsonResp = null;
        jsonReq = new org.json.JSONObject(requestData);

        String method = jsonReq.getString("method");
        if ((method != null) && (method.indexOf('.') < 0)) {
            jsonReq.putOpt("method", "Service" + "." + method);
        }

        // invoke the request
        jsonResp = jsonrpcBridge.call(new Object[] {request}, jsonReq);

        return jsonResp.toString().getBytes("UTF-8");
    }
View Full Code Here

TOP

Related Classes of org.jabsorb.JSONRPCBridge$MethodCandidate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.