org.apache.turbine.services.jsonrpc

## Class TurbineJsonRpcService

- java.lang.Object
- - org.apache.turbine.services.BaseInitable
  - - org.apache.turbine.services.BaseService
    - - org.apache.turbine.services.TurbineBaseService
      - - org.apache.turbine.services.jsonrpc.TurbineJsonRpcService

- All Implemented Interfaces:
    Initable, JsonRpcService, Service

      public class TurbineJsonRpcService
      extends TurbineBaseService
      implements JsonRpcService

  This is a service that will respond to JSON-RPC calls.
  Version:
    $Id: TurbineJsonRpcService.java 1706239 2015-10-01 13:18:35Z tv $
  Author:
    Scott Eade

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `JSON_BRIDGE_KEY` The key used to store the bridge in the session.

    - ### Fields inherited from class org.apache.turbine.services.BaseService

      `configuration, name, serviceBroker`

    - ### Fields inherited from class org.apache.turbine.services.BaseInitable

      `initableBroker, isInitialized`

    - ### Fields inherited from interface org.apache.turbine.services.jsonrpc.JsonRpcService

      `SERVICE_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TurbineJsonRpcService()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearBridge(javax.servlet.http.HttpSession session)` Remove the `JSONRPCBridge` from the session
    `org.jabsorb.JSONRPCBridge` | `getBridge(javax.servlet.http.HttpSession session)` Get the `JSONRPCBridge` from the session
    `Object` | `processCall(CharArrayWriter cdata, org.jabsorb.JSONRPCBridge json_bridge, javax.servlet.http.HttpServletRequest request)` Process a JSON RPC call
    `void` | `registerObject(javax.servlet.http.HttpSession session, String key, Object value)` Register an object with the `JSONRPCBridge` in a given session
    `void` | `registerObjectGlobal(String key, Object value)` Register an object with the `JSONRPCBridge` globally

    - ### Methods inherited from class org.apache.turbine.services.TurbineBaseService

      `init, init, init, shutdown`

    - ### Methods inherited from class org.apache.turbine.services.BaseService

      `getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker`

    - ### Methods inherited from class org.apache.turbine.services.BaseInitable

      `getInit, getInitableBroker, setInit, setInitableBroker`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.turbine.services.Service

      `getConfiguration, getName, getProperties, setName, setServiceBroker`

    - ### Methods inherited from interface org.apache.turbine.services.Initable

      `getInit, init, init, setInitableBroker, shutdown`

- - ### Field Detail

    - #### JSON_BRIDGE_KEY

          public static final String JSON_BRIDGE_KEY

      The key used to store the bridge in the session.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TurbineJsonRpcService

          public TurbineJsonRpcService()

  - ### Method Detail

    - #### processCall

          public Object processCall(CharArrayWriter cdata,
                           org.jabsorb.JSONRPCBridge json_bridge,
                           javax.servlet.http.HttpServletRequest request)

      Description copied from interface: `JsonRpcService`
      Process a JSON RPC call
      Specified by:
        `processCall` in interface `JsonRpcService`
      Parameters:
        `cdata` - the JSON data
        `json_bridge` - the `JSONRPCBridge` object
        `request` - the request
      Returns:
        the return object of the JSON RPC call

    - #### registerObjectGlobal

          public void registerObjectGlobal(String key,
                                  Object value)

      Description copied from interface: `JsonRpcService`
      Register an object with the `JSONRPCBridge` globally
      Specified by:
        `registerObjectGlobal` in interface `JsonRpcService`
      Parameters:
        `key` - the name of the object in the session
        `value` - the object to register

    - #### registerObject

          public void registerObject(javax.servlet.http.HttpSession session,
                            String key,
                            Object value)

      Description copied from interface: `JsonRpcService`
      Register an object with the `JSONRPCBridge` in a given session
      Specified by:
        `registerObject` in interface `JsonRpcService`
      Parameters:
        `session` - the session
        `key` - the name of the object in the session
        `value` - the object to register

    - #### getBridge

          public org.jabsorb.JSONRPCBridge getBridge(javax.servlet.http.HttpSession session)

      Description copied from interface: `JsonRpcService`
      Get the `JSONRPCBridge` from the session
      Specified by:
        `getBridge` in interface `JsonRpcService`
      Parameters:
        `session` - the session
      Returns:
        the `JSONRPCBridge` instance

    - #### clearBridge

          public void clearBridge(javax.servlet.http.HttpSession session)

      Description copied from interface: `JsonRpcService`
      Remove the `JSONRPCBridge` from the session
      Specified by:
        `clearBridge` in interface `JsonRpcService`
      Parameters:
        `session` - the session

Copyright © 2000–2018 The Apache Software Foundation. All rights reserved.